@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;700;900&family=Playfair+Display:wght@400;700;900&display=swap');

:root {
    --primary-color: #050a14;
    --primary-light: #0d1626;
    --gold-color: #D4AF37;
    --gold-bright: #FFD700;
    --ivory-bg: #fdfaf5;
    --app-paper: #f9f7f0;
    --text-color: #050a14;
    --card-bg: #ffffff;
    --transition-3d: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Variables Mode Sombre */
[data-theme="dark"] {
    --primary-color: #000000;
    --primary-light: #121212;
    --gold-color: #D4AF37;
    --ivory-bg: #1a1a1a;
    --app-paper: #121212;
    --text-color: #e0e0e0;
    --card-bg: #1e1e1e;
}

body { 
    background-color: var(--ivory-bg); 
    color: var(--text-color);
    font-family: 'Montserrat', sans-serif; 
    margin: 0; padding: 0;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* ===== BARRE D'UTILITAIRES UNIFIÉE ===== */
.utility-bar {
    background: var(--primary-light);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding: 6px 0;
    min-height: 40px;
}

.utility-bar .container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.controls-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.05);
    padding: 3px;
    border-radius: 50px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    gap: 10px;
}

.lang-switcher { display: flex; gap: 4px; padding-right: 10px; border-right: 1px solid rgba(212, 175, 55, 0.2); }

.lang-btn {
    background: transparent; border: none; color: var(--gold-color) !important;
    border-radius: 50%; width: 26px; height: 26px; font-size: 0.6rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}

.lang-btn.active-lang { background: var(--gold-color); color: var(--primary-color) !important; }

.btn-install-app {
    background: var(--gold-color); color: var(--primary-color) !important;
    border: none; border-radius: 50px; padding: 4px 14px;
    font-size: 0.65rem; font-weight: 900; text-transform: uppercase;
    text-decoration: none;
}

.theme-toggle { background: transparent; border: none; color: var(--gold-color); font-size: 0.9rem; cursor: pointer; padding: 0 10px; }

/* ===== NAVIGATION ===== */
.navbar { background: var(--primary-color) !important; border-bottom: 3px solid var(--gold-color); min-height: 80px; }
.navbar-brand { color: var(--gold-color) !important; font-family: 'Playfair Display', serif; font-weight: 900; font-size: 1.1rem; }
.nav-link { color: rgba(255,255,255,0.85) !important; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; padding: 10px 12px !important; }
.nav-link.active { color: var(--gold-color) !important; }

/* ===== BOUTON DE PARTAGE PRESTIGIEUX ===== */
.btn-share {
    background: transparent;
    border: 2px solid var(--gold-color);
    color: var(--gold-color);
    border-radius: 50px;
    padding: 8px 25px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-decoration: none;
}

.btn-share:hover {
    background: var(--gold-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

/* ===== MODE APPLI NATIVE ===== */
@media (display-mode: standalone), (display-mode: fullscreen) {
    .hide-in-app { display: none !important; }
    body { background-color: var(--app-paper) !important; padding-bottom: 75px !important; padding-top: 60px !important; }
    .utility-bar, footer, .navbar-toggler, .navbar-nav { display: none !important; }
    .navbar { position: fixed !important; top: 0; width: 100%; height: 60px !important; min-height: 60px !important; justify-content: center !important; z-index: 10000; }
    .app-bottom-nav {
        display: flex !important; position: fixed !important; bottom: 0; left: 0; width: 100%;
        background: var(--card-bg) !important; border-top: 1px solid rgba(212, 175, 55, 0.2) !important;
        height: 70px; z-index: 10000; justify-content: space-around; align-items: center;
        padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -5px 25px rgba(0,0,0,0.1);
    }
    .tab-item { color: #8e8e93 !important; text-decoration: none !important; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.6rem !important; font-weight: 700; }
    .tab-item i { font-size: 1.3rem; transition: 0.2s; }
    .tab-item.active { color: var(--gold-color) !important; }
}

/* Cartes & Éléments */
.info-card { background: var(--card-bg); border-radius: 20px; padding: 2.5rem 1.5rem; border: 1px solid rgba(212, 175, 55, 0.1); height: 100%; box-shadow: 0 10px 30px rgba(0,0,0,0.03); transition: 0.3s; color: var(--text-color); }
.registration-container, .bg-white.p-4.p-md-5.rounded.shadow-sm.border { background: var(--card-bg) !important; border-radius: 25px; border: 1px solid rgba(212, 175, 55, 0.2) !important; color: var(--text-color); }
.form-control { background: var(--ivory-bg); border-color: rgba(212, 175, 55, 0.1); color: var(--text-color); }
.carousel-item img { height: 600px; object-fit: contain; background: #000; }
@media (max-width: 768px) { .carousel-item img { height: 350px; } }
footer { background: var(--primary-color) !important; padding: 4rem 0; border-top: 4px solid var(--gold-color); color: white; }
footer a { color: rgba(212, 175, 55, 0.65) !important; text-decoration: none; transition: color 0.25s ease; }
footer a:hover { color: var(--gold-color) !important; text-decoration: underline; }
.social-icons a { font-size: 1.5rem; margin: 0 12px; color: var(--gold-color) !important; }
.app-bottom-nav { display: none; }

/* ===== BOUTON INSTALL — visible en navigateur, caché dans la PWA ===== */
#btnInstall { display: block; }
@media (display-mode: standalone), (display-mode: fullscreen) {
    #btnInstall { display: none !important; }
}

/* ===== CURSEUR CROIX CHRÉTIENNE DORÉE ===== */
html, body { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Crect x='13' y='2' width='6' height='28' fill='%23D4AF37'/%3E%3Crect x='2' y='9' width='28' height='6' fill='%23D4AF37'/%3E%3C/svg%3E") 16 16, crosshair; }
a, button, [role="button"], select, label, .btn-calendar, .btn-share, .btn-install-app { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Crect x='13' y='2' width='6' height='28' fill='%23D4AF37'/%3E%3Crect x='2' y='9' width='28' height='6' fill='%23D4AF37'/%3E%3C/svg%3E") 16 16, pointer; }
input, textarea { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Crect x='13' y='2' width='6' height='28' fill='%23D4AF37'/%3E%3Crect x='2' y='9' width='28' height='6' fill='%23D4AF37'/%3E%3C/svg%3E") 16 16, text; }

/* ===== SECTION TITLE ===== */
.section-title {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 2.5rem;
    position: relative;
    padding-bottom: 1rem;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--gold-color);
    border-radius: 2px;
}
[data-theme="dark"] .section-title { color: var(--text-color); }

/* ===== EFFET 3D CARTES D'ACCUEIL ===== */
.info-card {
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.12s ease, box-shadow 0.3s ease !important;
}
.info-card .fas, .info-card .far {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s ease;
    transform: translateZ(0px);
    display: block;
    font-size: 2.4rem;
    margin-bottom: 0.8rem;
    color: var(--gold-color);
}
.info-card:hover .fas, .info-card:hover .far {
    transform: translateZ(45px) translateY(-10px) scale(1.15);
    filter: drop-shadow(0 12px 20px rgba(212, 175, 55, 0.55));
    color: var(--gold-bright) !important;
}
.info-card:hover {
    box-shadow: 0 35px 65px rgba(0,0,0,0.18), 0 0 0 1px rgba(212, 175, 55, 0.25) !important;
}

/* ===== EVENT CARD ===== */
.event-card {
    background: var(--card-bg);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 2rem;
}
.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 45px rgba(0,0,0,0.12);
}
.event-card .card-img-top {
    height: 280px;
    object-fit: cover;
}
.event-card .card-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.4rem;
}
[data-theme="dark"] .event-card .card-title { color: var(--text-color); }

/* ===== BOUTON CALENDRIER ===== */
.btn-calendar {
    background: var(--primary-color);
    color: var(--gold-color) !important;
    border: 2px solid var(--gold-color);
    border-radius: 50px;
    padding: 10px 24px;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-calendar:hover {
    background: var(--gold-color);
    color: var(--primary-color) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.35);
}

/* ===== BOUTON INSCRIPTION ===== */
.btn-gold-action {
    background: var(--gold-color);
    color: var(--primary-color) !important;
    border: none;
    border-radius: 50px;
    padding: 14px 42px;
    font-weight: 900;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}
.btn-gold-action:hover {
    background: var(--gold-bright);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.4);
}
.text-gold { color: var(--gold-color) !important; }

/* ===== NAVBAR HEIGHT STABLE ===== */
.navbar { min-height: 85px !important; }
.utility-bar { min-height: 42px !important; }

/* ===== SPLASH SCREEN (mode app uniquement) ===== */
#splash-screen {
    position: fixed; inset: 0;
    background: radial-gradient(ellipse at 50% 38%, #0d1a30 0%, #050a14 70%);
    z-index: 9999999; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
/* Halo doré derrière la croix */
#splash-screen::before {
    content: '';
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -60%);
    width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle, rgba(212,175,55,0.12) 0%, transparent 70%);
    animation: splashHalo 2s ease-in-out infinite alternate;
}

/* --- Grande croix centrale --- */
.splash-cross {
    font-size: 5.5rem; color: #D4AF37; line-height: 1;
    opacity: 0; margin-bottom: 22px;
    animation: splashCrossIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards,
               splashGlow 2s ease-in-out 1s infinite alternate;
}
/* --- Ligne dorée --- */
.splash-line {
    width: 0; height: 1.5px; margin-bottom: 20px;
    background: linear-gradient(90deg, transparent, #D4AF37, transparent);
    animation: splashLineGrow 0.65s ease 0.95s forwards;
}
/* --- Texte titre --- */
.splash-title {
    font-family: 'Playfair Display', serif; color: #D4AF37;
    font-size: 1.3rem; font-weight: 900; letter-spacing: 0.5px;
    opacity: 0; margin-bottom: 7px;
    animation: splashFadeUp 0.5s ease 1.2s forwards;
}
/* --- Sous-titre --- */
.splash-subtitle {
    color: rgba(212,175,55,0.5); font-size: 0.62rem;
    font-weight: 800; text-transform: uppercase; letter-spacing: 4px;
    opacity: 0; margin-bottom: 32px;
    animation: splashFadeUp 0.5s ease 1.4s forwards;
}
/* --- Points de chargement --- */
.splash-dots {
    display: flex; gap: 10px;
    opacity: 0; animation: splashFadeUp 0.4s ease 1.6s forwards;
}
.splash-dots span {
    width: 7px; height: 7px; border-radius: 50%;
    background: rgba(212,175,55,0.2);
    animation: dotPulse 1.3s ease-in-out infinite;
}
.splash-dots span:nth-child(2) { animation-delay: 0.22s; }
.splash-dots span:nth-child(3) { animation-delay: 0.44s; }

@keyframes splashCrossIn { 0%{opacity:0;transform:scale(0.2) rotate(-15deg);} 100%{opacity:1;transform:scale(1) rotate(0);} }
@keyframes splashGlow    { from{filter:drop-shadow(0 0 8px rgba(212,175,55,0.3));} to{filter:drop-shadow(0 0 32px rgba(212,175,55,0.9));} }
@keyframes splashHalo    { from{opacity:0.5;transform:translate(-50%,-60%) scale(1);} to{opacity:1;transform:translate(-50%,-60%) scale(1.2);} }
@keyframes splashLineGrow{ from{width:0;} to{width:170px;} }
@keyframes splashFadeUp  { from{opacity:0;transform:translateY(12px);} to{opacity:1;transform:translateY(0);} }
@keyframes dotPulse      { 0%,100%{background:rgba(212,175,55,0.15);transform:scale(0.8);} 50%{background:#D4AF37;transform:scale(1.2);} }

/* ===== BANNIÈRE PROCHAINE MESSE ===== */
.next-mass-banner {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-bottom: 2px solid rgba(212,175,55,0.4);
    padding: 14px 0;
}
.next-mass-inner {
    display: flex; align-items: center; gap: 16px;
}
.next-mass-cross {
    color: var(--gold-color); font-size: 1.5rem; min-width: 32px; text-align: center;
    animation: crossPulse 2.5s ease-in-out infinite;
}
@keyframes crossPulse { 0%,100%{opacity:1;transform:scale(1);} 50%{opacity:0.6;transform:scale(0.9);} }
.next-mass-info { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.next-mass-label { color: rgba(212,175,55,0.65); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 800; }
.next-mass-date { color: #fff; font-weight: 700; font-size: 0.95rem; font-family: 'Playfair Display', serif; }
.next-mass-countdown { color: var(--gold-color); font-size: 0.8rem; font-weight: 700; }
.next-mass-bell {
    background: rgba(212,175,55,0.12); border: 1.5px solid rgba(212,175,55,0.35);
    color: var(--gold-color); border-radius: 50%; width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; transition: all 0.3s ease; flex-shrink: 0;
}
.next-mass-bell:hover, .next-mass-bell.notif-active {
    background: var(--gold-color); color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(212,175,55,0.2);
}
.next-mass-bell.notif-active i { animation: bellRing 0.5s ease; }
@keyframes bellRing { 0%,100%{transform:rotate(0);} 25%{transform:rotate(-20deg);} 75%{transform:rotate(20deg);} }

/* ===== INDICATEUR HORS-LIGNE ===== */
#offline-banner {
    position: fixed; top: 0; left: 0; right: 0; z-index: 99998;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d1b4e 100%);
    border-bottom: 2px solid rgba(212, 175, 55, 0.4);
    color: #fff; text-align: center;
    padding: 10px 16px; font-size: 0.78rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    animation: slideDown 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
}
#offline-banner .offline-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #e74c3c; display: inline-block; flex-shrink: 0;
    animation: offlinePulse 1.5s ease-in-out infinite;
}
@keyframes offlinePulse { 0%,100%{opacity:1;transform:scale(1);} 50%{opacity:0.4;transform:scale(0.7);} }
@keyframes slideDown { from{transform:translateY(-100%);opacity:0;} to{transform:translateY(0);opacity:1;} }
@keyframes slideUp   { from{transform:translateY(100%);opacity:0;} to{transform:translateY(0);opacity:1;} }

/* En mode app : bannière en bas au-dessus de la nav */
@media (display-mode: standalone), (display-mode: fullscreen) {
    #offline-banner {
        top: auto; bottom: calc(70px + env(safe-area-inset-bottom));
        border-bottom: none; border-top: 2px solid rgba(212, 175, 55, 0.4);
        animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* ===== FLUIDITÉ PWA — fondu à l'ouverture (sur main, pas body pour ne pas cacher le splash) ===== */
@keyframes pageFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (display-mode: standalone), (display-mode: fullscreen) {
    main, .container > *:not(#splash-screen) { animation: pageFadeIn 0.3s ease; }
}


/* ===== INDICATEUR SWIPE (app mode) ===== */
.swipe-hint {
    display: none;
    position: fixed; bottom: 85px; left: 50%; transform: translateX(-50%);
    background: rgba(212,175,55,0.15); border: 1px solid rgba(212,175,55,0.3);
    color: var(--gold-color); border-radius: 50px; padding: 6px 16px;
    font-size: 0.7rem; font-weight: 700; z-index: 100;
    animation: hintFade 3s ease forwards;
}
@keyframes hintFade { 0%{opacity:0;} 20%{opacity:1;} 80%{opacity:1;} 100%{opacity:0;} }
@media (display-mode: standalone), (display-mode: fullscreen) { .swipe-hint { display: block; } }
