/* ============================================================
   TAROT RIDER WAITE - PROFESSIONAL STYLES
   ============================================================ */

/* ============================================================
   VARIABLES
   ============================================================ */
:root {
    --bg-primary: #171E36;
    --bg-secondary: #1F2947;
    --bg-card: #252D45;
    --text-primary: #FFFFFF;
    --text-secondary: #B8C5D6;
    --accent-gold: #D4AF37;
    --accent-glow: #FFD700;
    --border-color: #2D3652;
    --shadow-color: rgba(0, 0, 0, 0.3);
    
    --font-title: 'Cinzel', serif;
    --font-body: 'Cormorant Garamond', serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================================
   BASE STYLES
   ============================================================ */
* {
    box-sizing: border-box;
}

.tarot-container {
    width: 100%;
    min-height: 100vh;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    padding: 20px;
    position: relative;
}

.tarot-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(212, 175, 55, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.tarot-container > * {
    position: relative;
    z-index: 1;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
    text-align: center;
    padding: 40px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.mystical-symbol {
    width: 120px;
    height: 120px;
    color: var(--accent-gold);
    margin: 0 auto 30px;
    animation: float 6s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.3));
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
}

.app-title {
    font-family: var(--font-title);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin: 0 0 20px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, #F4E4C1 50%, var(--accent-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

.title-mystical {
    display: inline-block;
    animation: pulse-glow 2s ease-in-out infinite;
    font-size: 0.7em;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.app-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 1px;
    margin: 0;
    font-style: italic;
}

/* ============================================================
   QUESTION SECTION
   ============================================================ */
.question-section {
    max-width: 700px;
    margin: 60px auto;
}

.question-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 32px var(--shadow-color);
}

.question-label {
    display: block;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent-gold);
    margin-bottom: 20px;
    text-align: center;
    font-family: var(--font-title);
    letter-spacing: 1px;
}

.question-input {
    width: 100%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    resize: vertical;
    transition: var(--transition-smooth);
    line-height: 1.6;
}

.question-input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.question-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.char-counter {
    text-align: right;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.char-counter #char-count {
    color: var(--accent-gold);
    font-weight: 600;
}

.consult-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-gold) 0%, #B8960D 100%);
    color: #1a1a1a;
    border: none;
    border-radius: 12px;
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--font-title);
    cursor: pointer;
    margin-top: 30px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

.consult-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.consult-btn:hover::before {
    width: 300px;
    height: 300px;
}

.consult-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.5);
}

.consult-btn:active {
    transform: translateY(0);
}

.consult-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-text,
.btn-icon {
    position: relative;
    z-index: 1;
}

.btn-icon {
    margin-left: 10px;
    font-size: 1.3em;
}

/* ============================================================
   DECK SECTION
   ============================================================ */
.deck-section {
    max-width: 1400px;
    margin: 60px auto;
    padding: 40px 20px;
}

.section-title {
    font-family: var(--font-title);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    text-align: center;
    color: var(--accent-gold);
    margin: 0 0 40px;
    letter-spacing: 1.5px;
}

.selection-progress {
    max-width: 500px;
    margin: 0 auto 40px;
    text-align: center;
}

.progress-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-weight: 600;
}

.progress-text #selected-count {
    color: var(--accent-gold);
    font-size: 1.5rem;
    font-weight: 700;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-gold) 0%, var(--accent-glow) 100%);
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
}

.deck-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .deck-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.card-back {
    aspect-ratio: 2/3;
    background: linear-gradient(135deg, #1a2332 0%, #2a3546 100%);
    border: 3px solid var(--accent-gold);
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.card-back::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 2px solid var(--accent-gold);
    border-radius: 8px;
    opacity: 0.3;
}

.card-back::after {
    content: '✦';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: var(--accent-gold);
    opacity: 0.4;
}

.card-back:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
    border-color: var(--accent-glow);
}

.card-back.selected {
    animation: golden-pulse 1.5s ease-in-out infinite;
    border-color: var(--accent-glow);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.4);
}

@keyframes golden-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.9), 0 0 80px rgba(255, 215, 0, 0.5);
        transform: scale(1.08);
    }
}

.card-back.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(100%);
}

/* ============================================================
   READING SECTION
   ============================================================ */
.reading-section {
    max-width: 1200px;
    margin: 60px auto;
    padding: 40px 20px;
}

.selected-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 800px;
    margin: 0 auto 60px;
}

.revealed-card {
    text-align: center;
    opacity: 0;
    animation: revealCard 0.8s ease forwards;
}

.revealed-card:nth-child(1) { animation-delay: 0.2s; }
.revealed-card:nth-child(2) { animation-delay: 0.6s; }
.revealed-card:nth-child(3) { animation-delay: 1s; }

@keyframes revealCard {
    0% {
        opacity: 0;
        transform: rotateY(180deg) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: rotateY(0deg) scale(1);
    }
}

.revealed-card img {
    width: 100%;
    max-width: 220px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.3);
    border: 2px solid var(--accent-gold);
}

.card-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent-gold);
    margin-top: 20px;
    font-family: var(--font-title);
    letter-spacing: 1px;
}

.loading-reading {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 30px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-style: italic;
}

.reading-result {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 32px var(--shadow-color);
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reading-content {
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.new-reading-btn {
    display: block;
    margin: 40px auto 0;
    background: linear-gradient(135deg, #2a3546 0%, #1a2332 100%);
    color: var(--accent-gold);
    border: 2px solid var(--accent-gold);
    border-radius: 12px;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-title);
    cursor: pointer;
    transition: var(--transition-smooth);
    letter-spacing: 1px;
}

.new-reading-btn:hover {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #B8960D 100%);
    color: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-secondary);
    border: 2px solid var(--accent-gold);
    border-radius: 20px;
    padding: 50px 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalAppear 0.4s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.modal-title {
    font-family: var(--font-title);
    font-size: 1.8rem;
    color: var(--accent-gold);
    margin: 0 0 20px;
    letter-spacing: 1px;
}

.modal-message {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 40px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 14px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: var(--font-body);
    letter-spacing: 0.5px;
}

.modal-btn-primary {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #B8960D 100%);
    color: #1a1a1a;
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.modal-btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.modal-btn-secondary:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.hidden {
    display: none !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .question-container {
        padding: 30px 20px;
    }
    
    .deck-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .selected-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .reading-result {
        padding: 30px 20px;
    }
    
    .modal-content {
        padding: 40px 25px;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 30px 15px;
    }
    
    .mystical-symbol {
        width: 80px;
        height: 80px;
    }
    
    .question-label {
        font-size: 1.1rem;
    }
    
    .question-input {
        padding: 15px;
        font-size: 1rem;
    }
    
    .consult-btn {
        padding: 15px 30px;
        font-size: 1.1rem;
    }
}
