/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2d1b69;
    --secondary-color: #744c9e;
    --accent-color: #d4af37;
    --dark-color: #1a0f2e;
    --light-color: #f8f6ff;
    --text-color: #2c2c54;
    --border-color: #e1d9f1;
    --shadow-light: 0 2px 10px rgba(45, 27, 105, 0.1);
    --shadow-medium: 0 4px 20px rgba(45, 27, 105, 0.15);
    --shadow-heavy: 0 8px 30px rgba(45, 27, 105, 0.2);
    --gradient-primary: linear-gradient(135deg, #2d1b69 0%, #744c9e 100%);
    --gradient-accent: linear-gradient(135deg, #d4af37 0%, #f7dc6f 100%);
    --gradient-dark: linear-gradient(135deg, #1a0f2e 0%, #2d1b69 100%);
}

body {
    font-family: 'Crimson Text', serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, #f8f6ff 0%, #e8e2f4 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--gradient-primary);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-medium);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    font-size: 1.5rem;
    color: var(--accent-color);
}

.logo h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: var(--accent-color);
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    background: var(--gradient-dark);
    color: white;
    overflow: hidden;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-accent);
    color: var(--dark-color);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

.btn-secondary {
    background: var(--gradient-primary);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(40, 167, 69, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Card Deck Animation */
.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-deck {
    position: relative;
    width: 200px;
    height: 300px;
}

.card-back {
    position: absolute;
    width: 140px;
    height: 220px;
    background: var(--gradient-accent);
    border-radius: 15px;
    box-shadow: var(--shadow-heavy);
    border: 3px solid var(--accent-color);
}

.card-back::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background: repeating-linear-gradient(
        45deg,
        var(--primary-color),
        var(--primary-color) 5px,
        var(--secondary-color) 5px,
        var(--secondary-color) 10px
    );
    border-radius: 10px;
}

.card-back-1 {
    animation: float 3s ease-in-out infinite;
    z-index: 3;
}

.card-back-2 {
    animation: float 3s ease-in-out infinite 1s;
    transform: rotate(-15deg) translate(-20px, 10px);
    z-index: 2;
}

.card-back-3 {
    animation: float 3s ease-in-out infinite 2s;
    transform: rotate(15deg) translate(20px, 20px);
    z-index: 1;
}

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

/* Sections */
.readings-section,
.about-section {
    padding: 4rem 0;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 3rem;
    color: var(--secondary-color);
}

/* Reading Types */
.reading-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.reading-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow-light);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.reading-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
    transition: left 0.5s ease;
}

.reading-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--accent-color);
}

.reading-card:hover::before {
    left: 100%;
}

.reading-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

.reading-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.reading-badge {
    display: inline-block;
    background: var(--gradient-accent);
    color: var(--dark-color);
    padding: 0.3rem 1rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 1rem;
}

/* Reading Area */
.reading-area {
    padding: 3rem 0;
    background: white;
    min-height: 70vh;
}

.reading-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.reading-header h2 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
}

.cards-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.tarot-card {
    width: 140px;
    height: 220px;
    background: var(--gradient-accent);
    border-radius: 15px;
    border: 3px solid var(--accent-color);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    perspective: 1000px;
}

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

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.card-back-face {
    background: var(--gradient-accent);
}

.card-back-face::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    background: repeating-linear-gradient(
        45deg,
        var(--primary-color),
        var(--primary-color) 3px,
        var(--secondary-color) 3px,
        var(--secondary-color) 6px
    );
    border-radius: 8px;
}

.card-front-face {
    background: white;
    transform: rotateY(180deg);
    box-shadow: inset 0 0 20px rgba(45, 27, 105, 0.1);
}

.card-number {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.card-name {
    font-size: 1rem;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 0.5rem;
}

.card-keywords {
    font-size: 0.7rem;
    color: var(--secondary-color);
    text-align: center;
    line-height: 1.2;
}

.tarot-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

.reading-controls {
    text-align: center;
    margin-bottom: 3rem;
}

.reading-controls .btn {
    margin: 0 0.5rem;
}

/* Interpretation */
.interpretation {
    background: var(--light-color);
    padding: 2rem;
    border-radius: 20px;
    border: 2px solid var(--border-color);
    margin-top: 2rem;
}

.interpretation h3 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.card-interpretation {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-light);
}

.card-interpretation:last-child {
    margin-bottom: 0;
}

.card-interpretation h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.position-label {
    background: var(--gradient-accent);
    color: var(--dark-color);
    padding: 0.2rem 0.8rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-text h2 {
    font-family: 'Playfair Display', serif;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.about-text ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.about-text li {
    margin-bottom: 0.5rem;
}

.mystical-circle {
    width: 200px;
    height: 200px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 auto;
    animation: rotate 20s linear infinite;
}

.mystical-circle i {
    position: absolute;
    font-size: 2rem;
    color: var(--accent-color);
}

.mystical-circle i:nth-child(1) { top: 20px; }
.mystical-circle i:nth-child(2) { bottom: 20px; left: 20px; }
.mystical-circle i:nth-child(3) { bottom: 20px; right: 20px; }

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Footer */
.footer {
    background: var(--dark-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 15, 46, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 968px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-content h2 {
        font-size: 2.5rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .reading-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .cards-container {
        gap: 1rem;
    }
    
    .tarot-card {
        width: 120px;
        height: 180px;
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .reading-types {
        grid-template-columns: 1fr;
    }
    
    .cards-container {
        flex-direction: column;
        align-items: center;
    }
    
    .reading-controls .btn {
        margin: 0.5rem;
        display: block;
        width: 200px;
    }
}

/* Celtic Cross Layout */
.celtic-cross {
    display: grid;
    grid-template-areas: 
        ". top ."
        "left center right"
        ". bottom ."
        ". outcome .";
    gap: 1rem;
    justify-items: center;
    align-items: center;
    margin: 2rem auto;
    max-width: 600px;
}

.celtic-cross .tarot-card:nth-child(1) { grid-area: center; }
.celtic-cross .tarot-card:nth-child(2) { grid-area: center; transform: rotate(90deg); z-index: 2; }
.celtic-cross .tarot-card:nth-child(3) { grid-area: top; }
.celtic-cross .tarot-card:nth-child(4) { grid-area: bottom; }
.celtic-cross .tarot-card:nth-child(5) { grid-area: left; }
.celtic-cross .tarot-card:nth-child(6) { grid-area: right; }
.celtic-cross .tarot-card:nth-child(7) { grid-area: outcome; }

/* Fade in animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Card flip animation */
@keyframes cardFlip {
    0% { transform: rotateY(0); }
    50% { transform: rotateY(90deg); }
    100% { transform: rotateY(180deg); }
}

.card-flip {
    animation: cardFlip 0.6s ease-in-out;
}