@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Tajawal:wght@400;500;700;800&display=swap');

:root {
    /* Palette "Cosmic Mystique" */
    --bg-deep: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --primary: #8b5cf6;
    --primary-glow: #a78bfa;
    --accent: #06b6d4;
    --gold: #fbbf24;
    --danger: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    /* Gradients */
    --gradient-main: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --gradient-gold: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    --gradient-glass: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);

    /* Effects */
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.3);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --radius-lg: 24px;
    --radius-md: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #020617;
    /* Noir spatial plus profond */
    min-height: 100vh;
    color: var(--text-main);
    overflow-x: hidden;
    word-break: break-word;
    /* Ensure long words break */
    line-height: 1.6;
}

/* --- Astrological Background Elements --- */
.cosmic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(circle at center, #0f172a 0%, #020617 100%);
}

/* Étoiles scintillantes */
.stars {
    position: absolute;
    width: 200%;
    height: 200%;
    background-image:
        radial-gradient(1px 1px at 20px 30px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 40px 70px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 50px 160px, #ddd, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 90px 40px, #fff, rgba(0, 0, 0, 0));
    background-size: 200px 200px;
    animation: starsTwinkle 10s linear infinite;
    opacity: 0.3;
}

/* Roue du zodiaque animée */
.zodiac-wheel {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(800px, 100vw);
    /* Make it responsive, but not larger than 800px */
    height: min(800px, 100vw);
    /* Make it responsive, but not larger than 800px */
    border: 1px dashed rgba(139, 92, 246, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: rotateZodiac 120s linear infinite;
}

.zodiac-wheel::before {
    content: '♈ ♉ ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    color: rgba(139, 92, 246, 0.1);
    letter-spacing: 45px;
    width: 100%;
    text-align: center;
}

/* Planètes flottantes */
.planet {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.15;
    animation: floatPlanet 20s ease-in-out infinite alternate;
}

.p-purple {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -10%;
    left: -10%;
}

.p-cyan {
    width: 300px;
    height: 300px;
    background: var(--accent);
    bottom: 10%;
    right: -5%;
    animation-delay: -5s;
}

@keyframes starsTwinkle {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-100px);
    }
}

@keyframes rotateZodiac {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes floatPlanet {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(50px, 40px) scale(1.1);
    }
}

/* Typography Enhancements for Arabic */
input[dir="rtl"],
.subtitle-wolof,
.feature-wolof,
.result-name,
.arabic-text {
    font-family: 'Tajawal', 'Poppins', sans-serif;
}

/* --- Navigation Modernisée --- */
nav {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1.2rem 2rem;
    border-bottom: var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
    text-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.1);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-main);
    box-shadow: 0 0 10px var(--primary);
}

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 6px;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 30px;
    height: 3px;
    background: var(--text-main);
    border-radius: 3px;
    transition: 0.3s;
}

/* --- Layout & Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* --- Header Section --- */
.header {
    text-align: center;
    margin-bottom: 5rem;
    position: relative;
}

.header h1 {
    font-size: 4.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -2px;
    animation: fadeInDown 1s ease-out;
}

.subtitle {
    font-size: 1.4rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-weight: 300;
    letter-spacing: 1px;
}

.subtitle-wolof {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-style: italic;
}

/* --- Feature Cards (Glassmorphism) --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--bg-card);
    border: var(--glass-border);
    backdrop-filter: blur(12px);
    padding: 3rem 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent);
    z-index: 0;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.3);
    border-color: rgba(139, 92, 246, 0.3);
}

.feature-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
    animation: float 6s ease-in-out infinite;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.feature-wolof {
    color: var(--primary-glow);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    display: block;
}

.feature-description {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.feature-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    background: var(--gradient-main);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    position: relative;
    z-index: 2;
}

.feature-btn:hover {
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.6);
    transform: scale(1.05);
}

/* --- Forms & Inputs (Ultra Modern) --- */
.calculation-container,
.contact-container,
.compatibility-container,
.astro-container {
    background: var(--bg-card);
    border: var(--glass-border);
    backdrop-filter: blur(16px);
    padding: 3rem;
    border-radius: var(--radius-lg);
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* --- Contact Specific Enhancements --- */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.contact-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2.5rem 1.5rem;
    border-radius: var(--radius-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
}

.contact-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--primary);
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.contact-card-icon {
    margin-bottom: 1.5rem;
    color: var(--primary-glow);
}

label {
    display: block;
    color: var(--text-main);
    margin-bottom: 0.8rem;
    font-weight: 500;
    font-size: 1.1rem;
}

input[type="text"],
input[type="date"] {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: white;
    padding: 1.2rem;
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    transition: all 0.3s;
    outline: none;
}

input[type="text"]:focus,
input[type="date"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
    background: rgba(15, 23, 42, 0.9);
}

.calc-button {
    width: 100%;
    padding: 1.2rem;
    margin-top: 2rem;
    background: var(--gradient-main);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.calc-button:hover {
    filter: brightness(1.1);
    box-shadow: var(--shadow-glow);
}

/* --- Results Sections (Magical Feel) --- */
.result-section,
.compatibility-result-section,
.astro-result-section {
    margin-top: 3rem;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-card,
.magic-number-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    position: relative;
}

.result-card h3 {
    color: var(--primary-glow);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.result-name {
    font-size: 3rem;
    color: white;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.value-number,
.magic-number {
    display: inline-block;
    font-size: 5rem;
    font-weight: 800;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.4));
    font-family: 'Poppins', sans-serif;
}

/* --- Alerts & Warnings --- */
.warning-box,
.info-box,
.error-section {
    background: rgba(255, 170, 0, 0.05);
    border: 1px solid rgba(255, 170, 0, 0.2);
    color: #fdba74;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-box {
    background: rgba(6, 182, 212, 0.05);
    border-color: rgba(6, 182, 212, 0.2);
    color: #67e8f9;
}

.error-section {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    justify-content: center;
}

/* --- Auth Modal (Moved from HTML) --- */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.auth-modal.active {
    display: flex;
}

.auth-content {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid #8b5cf6;
    padding: 40px;
    border-radius: 25px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.4);
}

.close-auth {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
}

.auth-input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border-radius: 25px;
    border: 1px solid #8b5cf6;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    text-align: center;
}

.btn-google {
    background: white;
    color: #444;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    width: 100%;
}

/* --- Compatibility Specifics --- */
.person-section {
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.interpretation-card {
    padding: 2rem;
    border-radius: var(--radius-md);
    margin: 2rem 0;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* --- Astrology Specifics --- */
.sign-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sign-icon {
    font-size: 5rem;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.3));
}

.element-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.trait-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border-left: 3px solid var(--primary);
}

.compat-group {
    margin-bottom: 1.5rem;
}

.compat-group h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    opacity: 0.9;
}

.compat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

/* --- Home Auth Status Bar --- */
.home-auth-container {
    max-width: 600px;
    margin: -3rem auto 3rem;
    text-align: center;
    padding: 10px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    animation: fadeIn 1s ease;
}

.home-auth-btn {
    background: var(--gradient-gold) !important;
    /* Couleur jaune/or comme le menu */
    color: #000 !important;
    /* Texte noir pour le contraste sur fond jaune */
    font-weight: 700;
    padding: 5px 15px;
    font-size: 0.8rem;
    margin: 0;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
    white-space: nowrap;
    /* Prevent text from wrapping */
}

/* --- Footer --- */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-muted);
    margin-top: auto;
    position: relative;
    z-index: 10;
    /* Assure que le footer est au-dessus du background */
}

footer a {
    position: relative;
    z-index: 9999 !important;
    /* Ensure footer links are always clickable */
    pointer-events: auto !important;
    /* Force la possibilité de cliquer */
}

/* Ensure contact-link is clickable */
.contact-link {
    position: relative;
    /* Needed for z-index to work */
    z-index: 9999 !important;
    /* Ensure contact links are always clickable */
    pointer-events: auto !important;
}

.back-button {
    display: table;
    margin: 2rem auto 0;
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    transition: all 0.3s;
}

.back-button:hover {
    background: white;
    color: var(--bg-deep);
}

/* --- Animations --- */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {

    /* Rendre le fond cosmique beaucoup plus discret sur mobile */
    .stars {
        opacity: 0.1;
    }

    .zodiac-wheel {
        opacity: 0.05;
    }

    .planet {
        opacity: 0.05;
    }

    .header h1 {
        font-size: 3rem;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(15, 23, 42, 0.95);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        transform: translateY(-150%);
        transition: transform 0.4s ease;
        z-index: 1001;
        /* Doit être au-dessus du reste du contenu mobile */
    }

    .nav-menu.active {
        transform: translateY(0);
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
    }

    /* Afficher le survol sur mobile avec :active et :focus-visible */
    .nav-link:active,
    .nav-link:focus-visible {
        color: white;
        background: rgba(255, 255, 255, 0.05);
        box-shadow: 0 0 15px rgba(139, 92, 246, 0.1);
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .sign-header {
        flex-direction: column;
        text-align: center;
    }

    .container {
        padding: 2rem 1rem;
    }

    /* Adjust font sizes for smaller screens */
    .nav-brand {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .subtitle-wolof {
        font-size: 1rem;
    }

    .feature-card h3 {
        font-size: 1.3rem;
    }

    .feature-wolof {
        font-size: 1rem;
    }

    .feature-description {
        font-size: 0.85rem;
    }

    .feature-card {
        padding: 2rem 1.5rem;
        /* Reduce padding for smaller screens */
    }

    .calculation-container,
    .contact-container,
    .compatibility-container,
    .astro-container {
        padding: 2rem 1.5rem;
        /* Reduce padding for mobile */
    }

    .contact-grid {
        grid-template-columns: 1fr;
        /* Ensure contact cards stack on mobile */
    }

    .result-name {
        font-size: 2rem;
        /* Reduce font size for results */
    }

    .value-number,
    .magic-number {
        font-size: 3.5rem;
        /* Reduce font size for result numbers */
    }

    .zodiac-wheel::before {
        font-size: 1rem;
        /* Reduce font size for zodiac symbols */
        letter-spacing: 20px;
        /* Reduce letter spacing for zodiac symbols */
    }

    .auth-content {
        padding: 30px;
        /* Reduce padding for auth modal */
    }
}