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

body {
    font-family: 'Google Sans', 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: #ffffff;
    color: #3c4043;
}

/* HEADER */
.header {
    background: #fff;
    border-bottom: 1px solid #e8eaed;
    padding: 8px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    box-shadow: 0 1px 3px rgba(60,64,67,0.3);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 400;
    color: #5f6368;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #26b5fc, #34a853);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    color: #5f6368;
    font-size: 24px;
    transition: background 0.2s;
}

.nav-btn:hover {
    background: #f1f3f4;
}

.current-date {
    font-size: 22px;
    font-weight: 400;
    color: #3c4043;
    margin: 0 20px;
    min-width: 200px;
    text-align: center;
}

.view-buttons {
    display: flex;
    gap: 4px;
    border: 1px solid #dadce0;
    border-radius: 6px;
    overflow: hidden;
}

.view-btn {
    background: #fff;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #5f6368;
    transition: all 0.2s;
    border-right: 1px solid #dadce0;
    min-width: 80px;
}

.view-btn:last-child {
    border-right: none;
}

.view-btn:hover {
    background: #f8f9fa;
}

.view-btn.active {
    background: #8a8a8a;
    color: white;
}

/* LAYOUT PRINCIPAL */
.main-container {
    display: flex;
    height: calc(100vh - 64px);
}

.sidebar {
    width: 256px;
    background: #fff;
    border-right: 1px solid #e8eaed;
    padding: 24px 0;
    overflow-y: auto;
}

.calendar-sources {
    padding: 0 24px;
}

.calendar-sources h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: #3c4043;
    font-weight: 500;
}

.source-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 2px 0;
    transition: background 0.2s;
}

.source-item:hover {
    background: #f8f9fa;
}

.source-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 2px solid;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.source-name {
    font-size: 14px;
    color: #3c4043;
}

/* SECTIONS SIDEBAR - NOUVEAUX STYLES À AJOUTER APRÈS .source-name */
.data-sources,
.documentation {
    padding: 0 24px;
    margin-top: 32px;
    border-top: 1px solid #e8eaed;
    padding-top: 24px;
}

.data-sources h3,
.documentation h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: #3c4043;
    font-weight: 500;
}

.download-links,
.doc-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.download-item,
.doc-item {
    display: flex;
    align-items: center;
    border-radius: 4px;
    padding: 6px 12px;
    margin: 1px 0;
    transition: background 0.2s;
}

.download-item:hover,
.doc-item:hover {
    background: #e8eaed;
}

.download-item a,
.doc-item a {
    text-decoration: none;
    color: #3c4043;
    font-size: 14px;
    width: 100%;
    display: block;
    transition: color 0.2s;
    line-height: 1.4;
    position: relative;
}

.download-item a .download-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.download-item a .download-title {
    font-weight: 500;
}

.download-item a .download-icon {
    color: #70757a;
    font-size: 16px;
    margin-left: 8px;
}

.download-item a small {
    display: block;
    font-size: 12px;
    color: #70757a;
    text-align: right;
    margin-left: auto;
    width: fit-content;
}

.download-item a:hover,
.doc-item a:hover {
    color: #000000;
}

.download-item a:hover .download-icon {
    color: #000000;
}

.doc-item a::before {
    content: "📄 ";
    margin-right: 8px;
}


.calendar-main {
    flex: 1;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* VUES */
.view {
    display: none;
    flex-direction: column;
    height: 100%;
}

.view.active {
    display: flex;
}

/* VUE MOIS */
.month-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid #e8eaed;
    background: #f8f9fa;
}

.month-weekday {
    padding: 12px 8px;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    color: #70757a;
    border-right: 1px solid #e8eaed;
}

.month-weekday:last-child {
    border-right: none;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    flex: 1;
}

.month-day {
    border-right: 1px solid #e8eaed;
    border-bottom: 1px solid #e8eaed;
    padding: 8px;
    min-height: 120px;
    background: white;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.month-day:hover {
    background: #f8f9fa;
}

.month-day:nth-child(7n) {
    border-right: none;
}

.month-day.other-month {
    background: #fafafa;
    color: #dadce0;
}

.month-day.today {
    background: #e8f0fe;
}

.day-number {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
    color: #3c4043;
}

.month-day.other-month .day-number {
    color: #dadce0;
}

.day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.event-item {
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: opacity 0.2s;
    background: #26b5fc;
}

.event-item:hover {
    opacity: 0.8;
}

/* VUE SEMAINE */
.week-header {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    border-bottom: 1px solid #e8eaed;
    background: #f8f9fa;
}

.week-time {
    padding: 12px 8px;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    color: #70757a;
}

.week-day {
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    border-right: 1px solid #e8eaed;
    transition: background 0.2s;
}

.week-day:hover {
    background: #f1f3f4;
}

.week-day.today {
    background: #e8f0fe;
    font-weight: 600;
}

.week-grid {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    grid-template-rows: repeat(24, 1fr);
    flex: 1;
    overflow: hidden;
}

.week-slot {
    padding: 4px;
    min-height: 30px;
    position: relative;
    border-right: 1px solid #e8eaed;
    border-bottom: 1px solid #e8eaed;
}

.week-slot:first-child {
    background: #fafafa;
    text-align: center;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #70757a;
}

.week-event-block {
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 0.8em;
    color: white;
    text-align: left;
    overflow: hidden;
    border: none;
    line-height: 1.2;
    z-index: 5;
    cursor: pointer;
    transition: opacity 0.2s;
}

.week-event-block:hover {
    opacity: 0.9;
}

/* VUE JOUR */
.day-header {
    background: #f8f9fa;
    padding: 16px 24px;
    border-bottom: 1px solid #e8eaed;
    text-align: center;
}

.day-title {
    font-size: 24px;
    font-weight: 500;
    color: #3c4043;
}

.day-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.day-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 18px;
    font-weight: 500;
    color: #3c4043;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8eaed;
}

.day-event {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    border-left: 4px solid #26b5fc;
}

.day-event.astro {
    border-left-color: #1e0278;
}

.day-weather-header,
.day-astro-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 16px;
}

.day-weather-icon,
.day-astro-icon {
    font-size: 24px;
}

.day-weather-details,
.day-astro-details {
    margin-left: 36px;
}

.day-weather-main {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}

.day-temp-main {
    font-size: 24px;
    font-weight: 600;
    color: #26b5fc;
}

.day-feels-like {
    font-size: 14px;
    color: #70757a;
}

.day-weather-grid,
.day-astro-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}

.day-detail-item {
    font-size: 14px;
    color: #5f6368;
    padding: 4px 0;
}

/* MODAL */
.event-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.event-details-content {
    background: white;
    border-radius: 8px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #5f6368;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #f1f3f4;
}

.modal-title {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 16px;
    color: #3c4043;
    padding-right: 40px;
}

.event-detail-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid #26b5fc;
}

.event-detail-item.astro {
    border-left-color: #1e0278;
}

.event-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.weather-icon,
.astro-icon {
    font-size: 32px;
    line-height: 1;
}

.event-detail-title {
    font-size: 18px;
    font-weight: 500;
    color: #3c4043;
}

.event-detail-content {
    margin-left: 44px;
}

.weather-main,
.astro-main {
    margin-bottom: 16px;
}

.temperature,
.phase-info {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.temp-value,
.phase-value {
    font-size: 28px;
    font-weight: 600;
    color: #26b5fc;
}

.phase-value {
    color: #1e0278;
    font-size: 18px;
}

.feels-like {
    font-size: 14px;
    color: #70757a;
}

.weather-details,
.astro-details {
    display: grid;
    gap: 8px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #5f6368;
    padding: 4px 0;
}

.event-detail-description {
    font-size: 14px;
    color: #5f6368;
    margin-top: 8px;
}

/* ÉTAT VIDE */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #70757a;
}

.no-events {
    text-align: center;
    color: #70757a;
    padding: 40px 20px;
    font-size: 16px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid #e8eaed;
    }
    
    .header {
        padding: 8px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nav-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .current-date {
        font-size: 18px;
        margin: 0 8px;
        min-width: 150px;
    }
    
    .view-btn {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 60px;
    }
    
    .month-day {
        min-height: 80px;
        padding: 4px;
    }
    
    .day-number {
        font-size: 12px;
    }
    
    .event-item {
        font-size: 10px;
        padding: 1px 4px;
    }
    
    .week-grid {
        grid-template-columns: 40px repeat(7, 1fr);
        grid-template-rows: repeat(24, 20px);
    }
    
    .week-time {
        font-size: 10px;
        padding: 4px 2px;
    }
    
    .week-day {
        font-size: 12px;
        padding: 8px 4px;
    }
    
    .week-event-block {
        font-size: 0.7em;
        padding: 2px 4px;
    }
    
    .day-content {
        padding: 16px;
    }
    
    .section-title {
        font-size: 16px;
    }
    
    .day-temp-main {
        font-size: 20px;
    }
    
    .event-details-content {
        width: 95%;
        padding: 16px;
        margin: 20px;
    }
    
    .modal-title {
        font-size: 18px;
    }
    
    .temp-value {
        font-size: 24px;
    }
    
    .weather-icon,
    .astro-icon {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .header {
        height: auto;
        min-height: 64px;
        padding: 8px 12px;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .current-date {
        font-size: 16px;
        margin: 0 4px;
        min-width: 120px;
    }
    
    .nav-btn {
        font-size: 20px;
        padding: 6px;
    }
    
    .view-btn {
        font-size: 11px;
        padding: 6px 8px;
        min-width: 50px;
    }
    
    .month-day {
        min-height: 60px;
        padding: 2px;
    }
    
    .day-number {
        font-size: 11px;
        margin-bottom: 2px;
    }
    
    .event-item {
        font-size: 9px;
        padding: 1px 2px;
        margin-bottom: 1px;
    }
    
    .week-grid {
        grid-template-columns: 30px repeat(7, 1fr);
        grid-template-rows: repeat(24, 18px);
    }
    
    .week-time {
        font-size: 8px;
        padding: 2px 1px;
    }
    
    .week-day {
        font-size: 10px;
        padding: 4px 2px;
    }
    
    .day-content {
        padding: 12px;
    }
    
    .day-section {
        margin-bottom: 16px;
    }
    
    .section-title {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .day-event {
        padding: 8px;
        margin-bottom: 6px;
    }
    
    .day-weather-header,
    .day-astro-header {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .day-weather-icon,
    .day-astro-icon {
        font-size: 18px;
    }
    
    .day-temp-main {
        font-size: 18px;
    }
    
    .day-feels-like,
    .day-detail-item {
        font-size: 12px;
    }
    
    .day-weather-grid,
    .day-astro-details {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

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

.day-event,
.event-item,
.week-event-block {
    animation: fadeIn 0.3s ease-out;
}

.event-details-modal {
    animation: fadeIn 0.2s ease-out;
}

/* ACCESSIBILITÉ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* FOCUS STATES */
.nav-btn:focus,
.view-btn:focus,
.source-item:focus,
.month-day:focus,
.week-day:focus,
.event-item:focus,
.week-event-block:focus,
.modal-close:focus {
    outline: 2px solid #26b5fc;
    outline-offset: 2px;
}

/* IMPRESSION */
@media print {
    .header,
    .sidebar,
    .view-buttons,
    .nav-controls,
    .event-details-modal {
        display: none !important;
    }
    
    .main-container {
        height: auto;
    }
    
    .calendar-main {
        width: 100%;
    }
    
    .month-grid,
    .week-grid,
    .day-content {
        break-inside: avoid;
    }
    
    .month-day,
    .day-event {
        break-inside: avoid;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .event-item,
    .week-event-block,
    .day-event {
        background: #f0f0f0 !important;
        color: black !important;
        border: 1px solid #ccc !important;
    }

    /* Styles pour les observations naturalistes */

/* Événements Faune */
.event-faune {
  background-color: #a3007d;
  color: white;
  padding: 8px;
  border-radius: 4px;
  margin-bottom: 4px;
  font-size: 12px;
  line-height: 1.3;
}

.event-faune-summary {
  background-color: #a3007d;
  color: white;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 10px;
  margin: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Événements Flore */
.event-flore {
  background-color: #aceb00;
  color: #333;
  padding: 8px;
  border-radius: 4px;
  margin-bottom: 4px;
  font-size: 12px;
  line-height: 1.3;
}

.event-flore-summary {
  background-color: #aceb00;
  color: #333;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 10px;
  margin: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Styles pour les modales de détails */
.modal-content-faune,
.modal-content-flore {
  max-width: 500px;
  margin: 0 auto;
}

.modal-content-faune h3 {
  color: #a3007d;
  border-bottom: 2px solid #a3007d;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.modal-content-flore h3 {
  color: #8cb800;
  border-bottom: 2px solid #aceb00;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.detail-row {
  margin-bottom: 8px;
  padding: 5px 0;
  border-bottom: 1px solid #eee;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row strong {
  display: inline-block;
  min-width: 150px;
  color: #666;
}

/* Adaptations responsive */
@media (max-width: 768px) {
  .event-faune,
  .event-flore {
    font-size: 11px;
    padding: 6px;
  }
  
  .event-faune-summary,
  .event-flore-summary {
    font-size: 9px;
    padding: 3px 6px;
  }
  
  .detail-row strong {
    min-width: 120px;
    font-size: 13px;
  }
}

/* Hover effects */
.event-faune:hover,
.event-faune-summary:hover {
  background-color: #8a0067;
  cursor: pointer;
}

.event-flore:hover,
.event-flore-summary:hover {
  background-color: #98d300;
  cursor: pointer;
}
}