/* Variables CSS */
:root {
    --primary-color: #2563eb;
    --secondary-color: #f59e0b;
    --success-color: #059669;
    --danger-color: #dc2626;
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Layout principal avec sidebar */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    align-items: start;
}

.main-content {
    min-width: 0; /* Empêche le débordement */
}

.sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Espaces publicitaires */
.ad-space {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
    padding: 1rem;
}

.ad-placeholder {
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    border-radius: 8px;
    font-weight: 500;
}

.ad-header .ad-placeholder {
    width: 728px;
    height: 90px;
    padding: 2rem;
}

.ad-middle .ad-placeholder {
    width: 300px;
    height: 250px;
}

.ad-footer .ad-placeholder {
    width: 728px;
    height: 90px;
    padding: 2rem;
}

/* Section de contrôles */
.controls {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin: 2rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 600;
    color: var(--text-primary);
}

select {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.2s;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.view-toggle button {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.view-toggle button.active {
    background: var(--primary-color);
    color: white;
}

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

.bridge-toggle input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--primary-color);
}

/* Compteur prochain jour férié */
.next-holiday {
    margin: 2rem 0;
}

.countdown-card {
    background: linear-gradient(135deg, var(--success-color), #047857);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.countdown-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.holiday-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.countdown {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

#days-count {
    color: var(--secondary-color);
}

/* Boutons */
.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: #f0f9ff;
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: #d97706;
    transform: translateY(-1px);
}

/* Section des jours fériés */
.holidays-section {
    margin: 2rem 0;
}

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

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
}

.export-buttons {
    display: flex;
    gap: 1rem;
}

/* Vue liste des jours fériés */
.holidays-list {
    display: grid;
    gap: 1rem;
}

.holiday-item {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.holiday-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.holiday-item.bridge {
    border-left: 4px solid var(--secondary-color);
    background: linear-gradient(to right, #fef3c7, white);
}

.holiday-date {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    min-width: 80px;
}

.date-day {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
}

.date-month {
    font-size: 0.875rem;
    opacity: 0.9;
}

.holiday-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.holiday-type {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.holiday-day {
    font-weight: 600;
    color: var(--primary-color);
}

/* Vue calendrier */
.holidays-calendar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.month-calendar {
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.month-calendar:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.month-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 1.125rem;
}

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

.day-header {
    background: #f8fafc;
    padding: 0.5rem 0.25rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    font-size: 0.875rem;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 36px;
}

.calendar-day:hover {
    background: #f3f4f6;
}

.calendar-day.today {
    background: var(--primary-color);
    color: white;
    font-weight: 700;
}

.calendar-day.holiday {
    background: #fee2e2;
    color: var(--danger-color);
    font-weight: 600;
}

.calendar-day.holiday.today {
    background: var(--danger-color);
    color: white;
}

.calendar-day.bridge {
    background: #fef3c7;
    color: var(--secondary-color);
    font-weight: 600;
}

.calendar-day.bridge.today {
    background: var(--secondary-color);
    color: white;
}

.calendar-day.holiday.bridge {
    background: linear-gradient(45deg, #fee2e2 50%, #fef3c7 50%);
}

.calendar-day.other-month {
    color: var(--text-secondary);
    opacity: 0.3;
    background: #f9fafb;
}

/* Légende du calendrier */
.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
    padding: 1rem;
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* Section Booking.com Affiliation */
.booking-affiliate {
    margin: 0 0 2rem 0;
    padding: 0;
}

.booking-card {
    background: linear-gradient(135deg, #003580 0%, #0057b8 100%);
    border-radius: 16px;
    padding: 1.25rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.booking-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.booking-header {
    text-align: center;
    margin-bottom: 2rem;
}

.booking-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.booking-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

.booking-content {
    display: block;
}

.booking-benefits {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    backdrop-filter: blur(10px);
    font-size: 0.875rem;
}

.benefit-icon {
    font-size: 1.25rem;
}

.booking-cta {
    text-align: center;
}

.booking-offer {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.offer-badge {
    background: #ff6b35;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.offer-text {
    font-size: 1rem;
}

.booking-btn {
    display: inline-block;
    background: #ff6b35;
    color: white;
    padding: 0.875rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
    margin-bottom: 1rem;
    width: 100%;
    text-align: center;
}

.booking-btn:hover {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(255, 107, 53, 0.6);
    color: white;
}

.booking-destinations {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.destination-chip {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.875rem;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.destination-chip:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    color: white;
}

.booking-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0.8;
}

/* Espace publicitaire sidebar */
.ad-sidebar {
    margin-top: 2rem;
}

.ad-sidebar .ad-placeholder {
    height: 250px;
    width: 100%;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.875rem;
    border-radius: 8px;
}

/* Responsive pour tablette et mobile */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .sidebar {
        position: static;
        order: -1; /* Affiche la sidebar en haut sur mobile */
        max-height: none;
    }
    
    .booking-card {
        padding: 1.5rem;
    }
    
    .booking-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        align-items: center;
    }
    
    .booking-benefits {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .booking-card {
        padding: 1.25rem;
    }
    
    .booking-header h2 {
        font-size: 1.25rem;
    }
    
    .booking-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .booking-benefits {
        grid-template-columns: 1fr;
        margin-bottom: 1rem;
    }
    
    .booking-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* Section ponts */
.bridges-section {
    margin: 3rem 0;
}

.bridges-list {
    display: grid;
    gap: 1rem;
}

.bridge-item {
    background: linear-gradient(to right, #fef3c7, white);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--secondary-color);
    box-shadow: var(--shadow);
}

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

.bridge-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.bridge-duration {
    background: var(--secondary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.bridge-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.bridge-dates {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.bridge-period {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
}

/* Section vacances scolaires */
.school-holidays {
    margin: 3rem 0;
}

#school-holidays-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.school-period {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border-left: 4px solid #8b5cf6;
}

.school-period h4 {
    color: #8b5cf6;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.school-dates {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Footer */
footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #4b5563;
    padding-top: 1rem;
    text-align: center;
    color: #9ca3af;
}

/* Utilitaires */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .controls {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .export-buttons {
        justify-content: center;
    }
    
    .holiday-item {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1rem;
    }
    
    .ad-header .ad-placeholder,
    .ad-footer .ad-placeholder {
        width: 100%;
        max-width: 320px;
        height: 100px;
    }
    
    .holidays-calendar {
        grid-template-columns: 1fr;
    }
    
    .bridge-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .bridge-dates {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .view-toggle {
        flex-direction: column;
    }
    
    .countdown {
        font-size: 1.5rem;
    }
    
    .holiday-date {
        min-width: auto;
        padding: 0.75rem;
    }
}

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

.holiday-item,
.bridge-item,
.school-period {
    animation: fadeIn 0.5s ease-out;
}

/* Impression */
@media print {
    .controls,
    .ad-space,
    .export-buttons,
    .btn-primary,
    .btn-secondary {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .holiday-item,
    .bridge-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
} 