/* ============================================
   Soultz Reunions - Widgets (calendrier, carousel, recherche)
   ============================================ */

/* ==== Calendrier ==== */

.srw-calendar {
    max-width: 360px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.srw-calendar-header {
    margin-bottom: 12px;
}

.srw-calendar-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.srw-calendar-nav-row h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a6c7a;
    flex: 1;
    text-align: center;
}

.srw-cal-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #1a6c7a;
    border-radius: 6px;
    background: #fff;
    color: #1a6c7a;
    text-decoration: none;
    transition: all 0.2s ease;
}

.srw-cal-nav:hover {
    background: #1a6c7a;
    color: #fff;
}

.srw-calendar-year-form {
    text-align: center;
}

.srw-calendar-year-form select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font: inherit;
    font-size: 0.9rem;
}

.srw-calendar-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.srw-calendar-grid th {
    padding: 6px 4px;
    text-align: center;
    font-weight: 600;
    color: #666;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.srw-calendar-day {
    padding: 6px 4px;
    text-align: center;
    color: #333;
    cursor: default;
    position: relative;
}

.srw-calendar-day.srw-has-meeting {
    font-weight: 700;
    color: #1a6c7a;
    cursor: pointer;
}

.srw-calendar-day.srw-has-meeting::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #1a6c7a;
}

.srw-calendar-day.srw-has-meeting:hover {
    background: rgba(26, 108, 122, 0.1);
    border-radius: 4px;
}

.srw-calendar-empty {
    padding: 6px 4px;
}

.srw-calendar-legend {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e2e2;
    font-size: 0.8rem;
    color: #666;
    text-align: center;
}

.srw-legend-marker {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1a6c7a;
    margin-right: 4px;
    vertical-align: middle;
}

/* ==== Carousel (layout 2 colonnes) ==== */

.srw-carousel {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.srw-carousel-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.srw-carousel-info {
    min-width: 0;
}

.srw-carousel-date {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a6c7a;
    margin-bottom: 8px;
}

.srw-carousel-president {
    font-size: 1rem;
    color: #333;
    margin-bottom: 16px;
}

.srw-carousel-summary {
    margin: 16px 0;
}

.srw-summary-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #1a6c7a;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s ease;
    font-size: 0.95rem;
}

.srw-summary-link:hover {
    background: #12545f;
}

.srw-carousel-items {
    margin: 16px 0;
}

.srw-carousel-items h4 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a6c7a;
}

.srw-carousel-items ul {
    margin: 0;
    padding-left: 20px;
    font-size: 0.9rem;
    color: #555;
}

.srw-carousel-items li {
    margin-bottom: 4px;
}

.srw-carousel-notes {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e2e2;
}

.srw-carousel-notes h4 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a6c7a;
}

.srw-notes-content {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
}

.srw-notes-content p {
    margin: 0 0 8px;
}

/* ==== Panneau video a droite ==== */

.srw-carousel-video-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.srw-video-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.srw-video-tab {
    padding: 8px 12px;
    border: 1px solid #1a6c7a;
    border-radius: 6px 6px 0 0;
    background: #f8f9fa;
    color: #1a6c7a;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.srw-video-tab:hover {
    background: rgba(26, 108, 122, 0.1);
}

.srw-video-tab.srw-tab-active {
    background: #1a6c7a;
    color: #fff;
    border-bottom-color: #1a6c7a;
}

.srw-video-container {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1a6c7a 0%, #12545f 100%);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.srw-video-play-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 130px;
    padding: 18px 24px;
    border: none;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.9);
    color: #1a6c7a;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.srw-video-play-label {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.srw-video-play-btn:hover {
    background: #fff;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* ==== Modal video plein ecran ==== */

.srw-video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.srw-video-modal.is-open {
    display: flex;
}

.srw-video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1400px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.srw-video-modal-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.srw-video-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #000;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.srw-video-modal-close:hover {
    background: #ff0000;
    color: #fff;
}

/* ==== Navigation ==== */

.srw-carousel-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.srw-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border: 1px solid #1a6c7a;
    border-radius: 6px;
    background: #fff;
    color: #1a6c7a;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.srw-nav-btn:hover:not(.srw-nav-disabled) {
    background: #1a6c7a;
    color: #fff;
}

.srw-nav-btn.srw-nav-disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.srw-carousel-counter {
    font-size: 0.9rem;
    color: #666;
    min-width: 60px;
    text-align: center;
    padding: 8px;
}

/* ==== Recherche ==== */

.srw-search {
    max-width: 600px;
    margin: 0 auto;
}

.srw-search-form {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
}

.srw-search-input,
.srw-search-type {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font: inherit;
}

.srw-search-input:focus,
.srw-search-type:focus {
    outline: none;
    border-color: #1a6c7a;
    box-shadow: 0 0 0 2px rgba(26, 108, 122, 0.1);
}

.srw-search-btn {
    padding: 10px 16px;
    border: 1px solid #1a6c7a;
    border-radius: 6px;
    background: #1a6c7a;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.srw-search-btn:hover {
    background: #12545f;
}

.srw-search-results {
    margin-top: 16px;
}

.srw-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    transition: box-shadow 0.2s ease;
}

.srw-result-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.srw-result-date {
    font-weight: 600;
    color: #1a6c7a;
    flex-shrink: 0;
}

.srw-result-president {
    flex: 1;
    color: #333;
}

.srw-result-video a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ff0000;
    color: #fff;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.srw-result-video a:hover {
    transform: scale(1.1);
}

.srw-notice {
    padding: 12px 16px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    color: #856404;
    text-align: center;
}

/* ==== Swipe mobile ==== */

.srw-carousel {
    touch-action: pan-y; /* Permet le scroll vertical, bloque l'horizontal pour le swipe */
}

.srw-swipe-hint {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    color: #666;
    opacity: 0;
    animation: srw-hint-fadein 0.5s ease forwards;
    pointer-events: none;
    white-space: nowrap;
}

.srw-swipe-hint.srw-swipe-hint-fade {
    animation: srw-hint-fadeout 0.5s ease forwards;
}

@keyframes srw-hint-fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes srw-hint-fadeout {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ==== Detail reunion (calendrier) ==== */

.srw-calendar-detail {
    margin-top: 16px;
    max-width: 360px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.srw-calendar-detail.srw-detail-visible {
    opacity: 1;
    max-height: 2000px;
}

.srw-calendar-day.srw-day-selected {
    background: rgba(26, 108, 122, 0.2);
    border-radius: 4px;
    font-weight: 700;
}

.srw-calendar-day.srw-day-selected::after {
    background: #fff;
}

.srw-calendar-detail-card {
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.srw-calendar-detail-card .srw-carousel-date {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a6c7a;
    margin-bottom: 8px;
}

.srw-calendar-detail-card .srw-carousel-president {
    font-size: 1rem;
    color: #333;
    margin-bottom: 12px;
}

.srw-calendar-detail-card .srw-carousel-summary {
    margin: 12px 0;
}

.srw-calendar-detail-card .srw-summary-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #1a6c7a;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s ease;
    font-size: 0.9rem;
}

.srw-calendar-detail-card .srw-summary-link:hover {
    background: #12545f;
}

.srw-calendar-detail-card .srw-carousel-items,
.srw-calendar-detail-card .srw-carousel-notes,
.srw-calendar-detail-card .srw-carousel-video-panel {
    margin: 12px 0;
}

.srw-calendar-detail-card .srw-carousel-items h4,
.srw-calendar-detail-card .srw-carousel-notes h4 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a6c7a;
}

.srw-calendar-detail-card .srw-carousel-items ul {
    margin: 0;
    padding-left: 20px;
    font-size: 0.9rem;
    color: #555;
}

.srw-calendar-detail-card .srw-notes-content {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
}

.srw-calendar-detail-card .srw-video-container {
    margin-top: 12px;
}

.srw-president-label {
    font-weight: 600;
    color: #1a6c7a;
}

.srw-item-type {
    display: inline-block;
    padding: 2px 6px;
    margin-right: 6px;
    background: rgba(26, 108, 122, 0.1);
    color: #1a6c7a;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ==== Responsive ==== */

@media (max-width: 900px) {
    .srw-carousel-layout {
        grid-template-columns: 1fr;
    }

    .srw-carousel-video-panel {
        order: -1; /* Video en haut sur mobile */
    }
}

@media (max-width: 600px) {
    .srw-search-form {
        grid-template-columns: 1fr;
    }

    .srw-carousel-layout {
        padding: 16px;
    }

    .srw-carousel-nav {
        gap: 6px;
    }

    .srw-nav-btn {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .srw-calendar-nav-row h3 {
        font-size: 1rem;
    }

    .srw-cal-nav {
        width: 28px;
        height: 28px;
    }
}
