/* ---------- Variables & Reset ---------- */
:root {
    --color-primary: #0077cc;
    --color-primary-dark: #005fa3;
    --color-secondary: #f0f8ff;
    --color-text: #333;
    --color-light: #fff;
    --shadow-light: 0 4px 10px rgba(0,0,0,0.05);
    --shadow-medium: 0 8px 20px rgba(0,0,0,0.1);
    --border-radius: 12px;
    
    --header-height: 85px;  
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--color-secondary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--color-text);
    line-height: 1.6;
}

body::before {
    content: '';
    display: block;
    height: var(--header-height);
}

/* ========================================
   HEADER STICKY
======================================== 
*/
header {
    background: var(--color-light);
    color: var(--color-text);
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid #eee;
    height: var(--header-height);  
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-content {
    width: 100%;
    max-width: 900px;  
    text-align: center;
}

header h1 {
    font-size: clamp(1.6rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--color-primary-dark);
}

.header-logo-link {
    text-decoration: none;
    color: inherit;  
}

.header-tagline {
    font-size: 0.9rem;
    color: #555;
    margin-top: 0.25rem;
}


/* ========================================
   FOOTER
======================================== 
*/
footer {
    background: #eef4f9;  
    color: #444;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    border-top: 1px solid #dce8f3;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;  
    gap: 1rem 1.5rem;  
    margin-bottom: 1.5rem;
}

.footer-links a {
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.footer-copyright {
    font-size: 0.85rem;
    color: #777;
}


/* ========================================
   STYLES DE L'APPLICATION
======================================== */

/* ---------- Contenu Principal (Mobile-First) ---------- */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;  
    width: 100%;
}

.calculator-app {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.calendar-wrapper {
    display: flex;
    flex-direction: column;  
    gap: 2rem;
    align-items: center;  
}

.calendar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 320px;  
}

.calendar-section h2 {
    color: var(--color-primary);
    font-size: 1.5rem;
}

.selected-date-display {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    background: var(--color-light);
    padding: 0.5rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    min-width: 180px;
    text-align: center;
    border: 1px solid #eee;
}

/* Style de base pour nos boutons (utilisé par Today et Insta) */
.btn-primary {
    background: var(--color-primary);
    color: var(--color-light);
    border: none;
    padding: 0.8rem 1.5rem;  
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none; /* Pour les <a> */
    display: inline-block; /* Pour les <a> */
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Style pour le bouton "Aujourd'hui" */
#today-btn {
    order: 3;
    width: 100%;  
    max-width: 320px;
}

/* ---------- Calendrier (Mobile-First) ---------- */
.calendar-container {
    background: var(--color-light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    padding: 1rem;  
    width: 100%;  
    animation: fadeIn 0.5s ease;
}

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

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.5rem;  
}

.calendar-header button {
    background: var(--color-primary);
    color: var(--color-light);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;  
}

.calendar-header button:hover {
    background: var(--color-primary-dark);
    transform: scale(1.1);
}

.calendar-header button:active {
    transform: scale(0.95);
}

.month-display {
    font-weight: bold;
    font-size: 1.1rem;
    flex: 1;  
    text-align: left;
    white-space: nowrap;
}

.year-select {
    font-family: inherit;
    font-weight: bold;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 0.3rem 0.2rem;
    background: #f9f9f9;
    max-width: 90px;  
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;  
}

.day-label {
    text-align: center;
    font-weight: 600;
    padding: 0.2rem 0;
    color: var(--color-primary);
    font-size: 0.8rem;  
}

.day {
    background: none;
    border: none;
    font-family: inherit;
    text-align: center;
    padding: 0.6rem 0;  
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;  
}
.day:not(.empty):hover {
    background: #d0e7ff;
    transform: scale(1.1);
}
.day.selected {
    background: var(--color-primary);
    color: var(--color-light);
    font-weight: bold;
    transform: scale(1.05);
}
.day.today {
    border: 2px solid var(--color-primary);
    font-weight: bold;
    padding: calc(0.6rem - 2px);  
}
.day.empty {
    background: transparent;
    cursor: default;
}

/* ---------- Résultat (Mobile-First) ---------- */
.result-container {
    text-align: center;
    background: var(--color-light);
    padding: 1.5rem 1rem;  
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    animation: fadeIn 0.5s ease;
    width: 100%;
}

.result-container h2 {
    color: var(--color-primary);
    margin-bottom: 1rem;
}

#result-details {
    font-size: 1.1rem;  
    font-weight: 500;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#result-details .result-summary {
    font-size: 1.3rem;  
    font-weight: 600;
    color: var(--color-primary-dark);
}
#result-details .result-total-days {
    font-size: 1.1rem;
    font-weight: 600;
}
#result-details .result-total-weeks {
    font-size: 1rem;
    color: #555;
}

/* ---------- Contenu SEO (index.html) ---------- */
.content-seo {
    background: var(--color-light);
    padding: 1.5rem;  
    margin-top: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    width: 100%;
}
.content-seo h2, .content-seo h3 {
    color: var(--color-primary);
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}
.content-seo p, .content-seo li {
    margin-bottom: 1rem;
    font-size: 1rem;
}
.content-seo ol, .content-seo ul {
    margin-left: 1.5rem;  
}
.content-seo strong {
    color: var(--color-primary-dark);
}


/* ========================================
   NOUVEAUX STYLES (Pages Contenu + Bouton)
======================================== */

/* Style pour les pages de contenu (mentions, etc.) */
.content-page {
    background: var(--color-light);
    padding: 1.5rem;
    margin-top: 0;  
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    width: 100%;
    max-width: 900px;  
}

.content-page h1 {
    color: var(--color-primary-dark);
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.content-page h2 {
    color: var(--color-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.content-page p, .content-page li {
    margin-bottom: 1rem;
    font-size: 1.05rem;
}
.content-page ul {
    margin-left: 1.5rem;
}
.content-page a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}
.content-page a:hover {
    text-decoration: underline;
}

.content-page a.btn-primary {
    color: var(--color-light);
}

/* NOUVEAU : Style pour bouton avec icône */
.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem; /* Espace entre icône et texte */
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}


/* ================================================================
  MEDIA QUERY : Styles pour écrans larges (Desktop)
================================================================
*/
@media (min-width: 680px) {

    body::before {
        height: var(--header-height);
    }
    
    header {
        padding: 1rem 2rem;  
    }

    main {
        padding: 2rem;  
    }

    .calendar-wrapper {
        flex-direction: row;  
        align-items: flex-start;  
        justify-content: center;
    }

    .calendar-section {
        width: auto;  
    }

    /* Style bouton "Aujourd'hui" sur desktop */
    #today-btn {
        width: auto;  
        max-width: none;
    }

    .calendar-container {
        padding: 1.5rem;  
        width: 310px;  
    }

    .calendar-grid {
        gap: 5px;  
    }

    .day-label {
        font-size: 0.9rem;
    }

    .day {
        padding: 0.8rem 0;  
        font-size: 1rem;
    }
    .day.today {
        padding: calc(0.8rem - 2px);
    }

    .result-container {
        padding: 1.5rem 2rem;
    }
    #result-details {
        font-size: 1.2rem;
    }
    #result-details .result-summary {
        font-size: 1.5rem;
    }
    #result-details .result-total-days {
        font-size: 1.2rem;
    }
    #result-details .result-total-weeks {
        font-size: 1.1rem;
    }

    .content-seo, .content-page {
        padding: 2rem;
        margin-top: 2rem;
    }
    .content-page {
        margin-top: 0;
    }
    .content-seo p, .content-seo li,
    .content-page p, .content-page li {
        font-size: 1.05rem;
    }
    .content-seo ol, .content-seo ul,
    .content-page ul {
        margin-left: 2rem;
    }
}

@media (min-width: 940px) {  
    .header-content {
        margin: 0 auto;
    }
}
