/*
 * Tarot site styling
 *
 * We use a dark starry background with a hint of purple to evoke a mystical
 * atmosphere. Cards appear on a virtual table, with soft shadows and gentle
 * animations when dealt. Buttons are styled to stand out without breaking the
 * overall mood.
 */

body {
    margin: 0;
    padding: 0;
    font-family: 'Philosopher', Arial, sans-serif;
    color: #eee;
    /* Gradient background reminiscent of a night sky */
    background: linear-gradient(135deg, #0d1033 0%, #302b63 50%, #2c2b5e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

#app {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    box-sizing: border-box;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    margin: 0;
    color: #ffeebd;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.subtitle {
    font-size: 1rem;
    color: #c7b8f5;
    margin-top: 8px;
}

#menu {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

/* Containers for user input and question */
.input-container,
.question-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.input-container label,
.question-container label {
    color: #c7b8f5;
    font-size: 0.9rem;
    font-family: 'Cinzel', serif;
    margin-right: 4px;
}

.input-container input,
.question-container input {
    background-color: #2c2b5e;
    color: #f8e6a5;
    border: 1px solid #413f7d;
    border-radius: 4px;
    padding: 6px 10px;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    min-width: 140px;
}

/* Suggested question templates */
.question-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    justify-content: center;
}

.question-template {
    background-color: #2b2356;
    color: #d1c6e7;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.2s, transform 0.2s;
    user-select: none;
}

.question-template:hover {
    background-color: #3b2d79;
    transform: translateY(-2px);
}

/* Information box displayed during reading */
.reading-info {
    width: 100%;
    max-width: 700px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    color: #d1c6e7;
    font-size: 0.95rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

/* Container for the select element */
.select-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.select-container label {
    color: #c7b8f5;
    font-size: 0.9rem;
    font-family: 'Cinzel', serif;
}

.select-container select {
    background-color: #2c2b5e;
    color: #f8e6a5;
    border: 1px solid #413f7d;
    border-radius: 4px;
    padding: 6px 10px;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
}

/* Secondary buttons for history and daily sections */
.secondary-btn {
    background-color: #2b2356;
    color: #d1c6e7;
}

.secondary-btn:hover {
    background-color: #3b2d79;
    color: #fff;
}

.action-btn {
    background-color: #48319d;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    font-family: 'Cinzel', serif;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
}

.action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Layout for the reading section: stack card table and interpretation vertically */
#reading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Hide reading section when .hidden is applied */
#reading.hidden {
    display: none;
}

.card-table {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    /* Чёрный коврик с лёгким узором напоминает тарошный стол */
    background: radial-gradient(circle at center, rgba(15, 15, 25, 0.95) 0%, #000008 100%);
    padding: 30px;
    border-radius: 16px;
    border: 3px solid rgba(255, 215, 128, 0.25);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.6), 0 0 10px rgba(255, 215, 128, 0.1) inset;
    position: relative;
}

.card-slot {
    width: 110px;
    height: 190px;
    perspective: 1000px;
    position: relative;
}

.card {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transform-style: preserve-3d;
    transition: transform 0.8s ease;
}

.card.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.card-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Фильтры для альтернативных колод */
.card-face img.bw-filter {
    filter: grayscale(100%) contrast(110%);
}
.card-face img.sepia-filter {
    filter: sepia(100%) contrast(110%);
}

/* Reversed card image rotated 180 degrees */
.card-face img.reversed {
    transform: rotate(180deg);
}

.card-front {
    transform: rotateY(180deg);
}

.interpretation {
    width: 100%;
    max-width: 700px;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    font-size: 0.95rem;
    line-height: 1.4;
}

.interpretation h3 {
    margin: 0 0 5px;
    font-size: 1.1rem;
    font-family: 'Cinzel', serif;
    color: #f8e6a5;
}

.interpretation p {
    margin: 0 0 10px;
    color: #d1c6e7;
}

footer {
    margin-top: 40px;
    text-align: center;
    font-size: 0.75rem;
    color: #8277ab;
}

footer a {
    color: #9c8fda;
    text-decoration: underline;
}

/* History section styling */
#historySection, #dailySection {
    display: none;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    text-align: left;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

#historySection h2, #dailySection h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    color: #ffeebd;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}

.history-entry, .daily-entry {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 10px 15px;
}

.history-entry h4, .daily-entry h4 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: #f8e6a5;
    font-family: 'Cinzel', serif;
}

.history-entry ul {
    padding-left: 18px;
    margin: 0;
    list-style-type: disc;
}

.history-entry li {
    color: #d1c6e7;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

/* Back buttons for history and daily sections */
#historySection .action-btn, #dailySection .action-btn {
    display: block;
    margin: 15px auto 0;
}

/* Hidden class to toggle visibility */
.hidden {
    display: none;
}
