/**
 * WHL Library - Styles du Frontend (Zero-Load)
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

.whllib-wrapper, .whllib-login-wrapper, .whllib-account-wrapper {
    /* Valeurs de thème par défaut (Mode Sombre Premium) */
    --whl-primary: #4f46e5;
    --whl-primary-hover: #6366f1;
    --whl-bg: #0b0f19;
    --whl-text: #f3f4f6;
    --whl-text-muted: #9ca3af;
    --whl-border: rgba(255, 255, 255, 0.08);
    --whl-card-bg: #131b2e;
    --whl-folder-color: #f59e0b;
    --whl-radius: 12px;
    --whl-radius-inner: 8px;
    --whl-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --whl-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --whl-input-bg: #1e293b;
    --whl-alert-bg: rgba(245, 158, 11, 0.1);
    --whl-alert-border: rgba(245, 158, 11, 0.2);
    --whl-alert-text: #f59e0b;

    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--whl-text);
    margin: 20px 0;
    box-sizing: border-box;
}

/* Surcharge Thème Clair */
.whllib-wrapper[data-theme="light"], 
.whllib-login-wrapper[data-theme="light"], 
.whllib-account-wrapper[data-theme="light"] {
    --whl-bg: #f8fafc;
    --whl-text: #0f172a;
    --whl-text-muted: #64748b;
    --whl-border: #e2e8f0;
    --whl-card-bg: #ffffff;
    --whl-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -1px rgba(15, 23, 42, 0.03);
    --whl-shadow-hover: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
    --whl-input-bg: #ffffff;
    --whl-alert-bg: #fffbeb;
    --whl-alert-border: #fef3c7;
    --whl-alert-text: #b45309;
}

/* Surcharge Thème Sombre */
.whllib-wrapper[data-theme="dark"], 
.whllib-login-wrapper[data-theme="dark"], 
.whllib-account-wrapper[data-theme="dark"] {
    --whl-bg: #0b0f19;
    --whl-text: #f3f4f6;
    --whl-text-muted: #9ca3af;
    --whl-border: rgba(255, 255, 255, 0.08);
    --whl-card-bg: #131b2e;
    --whl-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --whl-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --whl-input-bg: #1e293b;
    --whl-alert-bg: rgba(245, 158, 11, 0.1);
    --whl-alert-border: rgba(245, 158, 11, 0.2);
    --whl-alert-text: #f59e0b;
}

.whllib-wrapper *, .whllib-login-wrapper *, .whllib-account-wrapper * {
    box-sizing: border-box;
}

/* Global Container Styles */
.whllib-wrapper {
    background-color: var(--whl-bg);
    border: 1px solid var(--whl-border);
    border-radius: var(--whl-radius);
    padding: 30px;
    box-shadow: var(--whl-shadow);
}

/* Alertes & Messages */
.whllib-alert {
    padding: 16px;
    border-radius: var(--whl-radius);
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    background-color: var(--whl-alert-bg);
    border: 1px solid var(--whl-alert-border);
    color: var(--whl-alert-text);
}

.whllib-btn {
    display: inline-block;
    background-color: var(--whl-primary);
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 8px 20px;
    border-radius: var(--whl-radius-inner);
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.15s ease;
    border: none;
    cursor: pointer;
}

.whllib-btn:hover {
    background-color: var(--whl-primary-hover);
    transform: translateY(-1px);
}

/* Header de la Bibliothèque */
.whllib-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    border-bottom: 1px solid var(--whl-border);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.whllib-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 !important;
    color: var(--whl-text);
}

.whllib-header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Commutateur Grille / Liste */
.whllib-view-switch {
    display: flex;
    background-color: var(--whl-input-bg);
    border: 1px solid var(--whl-border);
    border-radius: var(--whl-radius-inner);
    padding: 4px;
    gap: 2px;
}

.whllib-view-btn {
    background: none;
    border: none;
    color: var(--whl-text-muted);
    padding: 6px 12px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.whllib-view-btn:hover {
    color: var(--whl-text);
}

.whllib-view-btn.active {
    background-color: var(--whl-primary);
    color: #ffffff;
}

/* Champ Recherche */
.whllib-search-box {
    position: relative;
    width: 280px;
}

.whllib-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--whl-text-muted);
}

.whllib-search-box input[type="text"] {
    width: 100%;
    padding: 10px 14px 10px 40px !important;
    border: 1px solid var(--whl-border) !important;
    border-radius: 30px !important;
    background-color: var(--whl-input-bg) !important;
    color: var(--whl-text) !important;
    font-size: 14px !important;
    outline: none !important;
    transition: all 0.2s ease;
    box-shadow: none !important;
}

.whllib-search-box input[type="text"]:focus {
    border-color: var(--whl-primary) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}

/* Fil d'Ariane */
.whllib-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--whl-text-muted);
    background-color: var(--whl-card-bg);
    padding: 10px 16px;
    border-radius: var(--whl-radius-inner);
    border: 1px solid var(--whl-border);
}

.whllib-breadcrumb-item {
    cursor: pointer;
    font-weight: 500;
    transition: color 0.15s ease;
}

.whllib-breadcrumb-item:hover {
    color: var(--whl-primary);
}

.whllib-breadcrumb-item.active {
    cursor: default;
    color: var(--whl-text);
    font-weight: 600;
}

.whllib-breadcrumb-separator {
    color: var(--whl-border);
}

/* Conteneur principal (Grille par défaut) */
.whllib-files-grid {
    min-height: 200px;
    transition: all 0.3s ease;
}

/* Mode Grille */
.whllib-wrapper[data-view-mode="grid"] .whllib-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.whllib-wrapper.whllib-layout-grid .whllib-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

/* Mode Liste */
.whllib-wrapper[data-view-mode="list"] .whllib-files-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.whllib-wrapper.whllib-layout-list .whllib-files-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Loader */
.whllib-loader {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 0;
    font-weight: 500;
    color: var(--whl-text-muted);
}

/* Éléments de la Bibliothèque */
.whllib-grid-item {
    background-color: var(--whl-card-bg);
    border: 1px solid var(--whl-border);
    border-radius: var(--whl-radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    box-shadow: var(--whl-shadow);
}

.whllib-grid-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--whl-shadow-hover);
    border-color: rgba(79, 70, 229, 0.3);
}

/* Masquer les éléments exclus par le filtre client */
.whllib-grid-item.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
    border: none;
}

/* Dossier style */
.whllib-grid-item.item-folder {
    align-items: center;
    text-align: center;
}

.whllib-item-icon {
    margin-bottom: 12px;
    flex-shrink: 0;
}

.whllib-icon-folder {
    width: 56px;
    height: 56px;
    fill: var(--whl-folder-color);
}

.whllib-icon-file {
    width: 46px;
    height: 46px;
    fill: var(--whl-primary);
}

.whllib-item-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px 0 !important;
    color: var(--whl-text);
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.whllib-item-meta {
    font-size: 12px;
    color: var(--whl-text-muted);
    margin-bottom: 10px;
}

.whllib-item-category-tag {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--whl-primary);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 11px;
    display: inline-block;
    margin-bottom: 12px;
}

.whllib-item-desc {
    font-size: 13px;
    color: var(--whl-text-muted);
    margin: 0 0 16px 0 !important;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.whllib-item-btn {
    margin-top: auto;
    width: 100%;
    text-align: center;
}

/* Surcharges Mode Liste */
.whllib-wrapper[data-view-mode="list"] .whllib-grid-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 24px;
    text-align: left;
}

.whllib-wrapper[data-view-mode="list"] .whllib-grid-item:hover {
    transform: translateX(4px);
}

.whllib-wrapper[data-view-mode="list"] .whllib-grid-item.item-folder {
    text-align: left;
    align-items: center;
}

.whllib-wrapper[data-view-mode="list"] .whllib-item-icon {
    margin-bottom: 0;
}

.whllib-wrapper[data-view-mode="list"] .whllib-icon-folder {
    width: 36px;
    height: 36px;
}

.whllib-wrapper[data-view-mode="list"] .whllib-icon-file {
    width: 30px;
    height: 30px;
}

.whllib-wrapper[data-view-mode="list"] .whllib-item-info-col {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
}

.whllib-wrapper[data-view-mode="list"] .whllib-item-title {
    font-size: 15px;
    margin: 0 !important;
}

.whllib-wrapper[data-view-mode="list"] .whllib-item-desc {
    font-size: 13px;
    margin: 4px 0 0 0 !important;
    display: block;
    -webkit-line-clamp: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.whllib-wrapper[data-view-mode="list"] .whllib-item-meta-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--whl-text-muted);
}

.whllib-wrapper[data-view-mode="list"] .whllib-item-category-tag {
    margin-bottom: 0;
}

.whllib-wrapper[data-view-mode="list"] .whllib-item-action-col {
    flex-shrink: 0;
}

.whllib-wrapper[data-view-mode="list"] .whllib-item-btn {
    margin-top: 0;
    width: auto;
}

/* Aucun résultat */
.whllib-no-results {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 50px 0;
    color: var(--whl-text-muted);
    font-weight: 500;
}

.whllib-no-results-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

/* ==========================================
   FORMULAIRES : CONNEXION, COMPTE ET MDP
   ========================================== */

.whllib-virtual-page-wrapper {
    background-color: var(--whl-bg);
    padding: 60px 0;
    min-height: calc(100vh - 200px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.whllib-login-wrapper, .whllib-account-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 0 20px;
}

.whllib-login-card, .whllib-account-card {
    background-color: var(--whl-card-bg);
    border: 1px solid var(--whl-border);
    border-radius: var(--whl-radius);
    padding: 35px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--whl-shadow);
}

.whllib-account-card {
    max-width: 680px;
}

.whllib-login-card h3, .whllib-account-card h3 {
    margin: 0 0 25px 0 !important;
    font-size: 22px;
    font-weight: 700;
    color: var(--whl-text);
    border-bottom: 1px solid var(--whl-border);
    padding-bottom: 15px;
}

.whllib-login-error, .whllib-account-errors {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 12px 16px;
    border-radius: var(--whl-radius-inner);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.whllib-account-errors ul {
    margin: 0;
    padding-left: 20px;
}

.whllib-account-success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #10b981;
    padding: 12px 16px;
    border-radius: var(--whl-radius-inner);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.whllib-form-group {
    margin-bottom: 20px;
    width: 100%;
}

.whllib-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--whl-text);
    margin-bottom: 8px;
}

.whllib-form-group input[type="text"],
.whllib-form-group input[type="password"],
.whllib-form-group input[type="email"] {
    width: 100% !important;
    padding: 12px 16px !important;
    border: 1px solid var(--whl-border) !important;
    border-radius: var(--whl-radius-inner) !important;
    background-color: var(--whl-input-bg) !important;
    color: var(--whl-text) !important;
    font-size: 14px !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
}

.whllib-form-group input:focus {
    border-color: var(--whl-primary) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}

.whllib-form-group-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.whllib-form-group-checkbox label {
    font-size: 13px;
    font-weight: 500;
    color: var(--whl-text-muted);
    cursor: pointer;
    margin: 0 !important;
}

.whllib-form-group-checkbox input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--whl-primary);
}

.whllib-login-btn, .whllib-account-btn {
    width: 100%;
    background-color: var(--whl-primary);
    color: #ffffff;
    border: none;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--whl-radius-inner);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.whllib-login-btn:hover, .whllib-account-btn:hover {
    background-color: var(--whl-primary-hover);
    transform: translateY(-1px);
}

.whllib-login-links {
    margin-top: 15px;
    text-align: center;
}

.whllib-forgot-link {
    font-size: 13px;
    color: var(--whl-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.whllib-forgot-link:hover {
    color: var(--whl-primary-hover);
    text-decoration: underline;
}

.whllib-row {
    display: flex;
    gap: 20px;
}

@media (max-width: 600px) {
    .whllib-row {
        flex-direction: column;
        gap: 0;
    }
    
    .whllib-wrapper[data-view-mode="list"] .whllib-grid-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .whllib-wrapper[data-view-mode="list"] .whllib-item-meta-col {
        align-items: flex-start;
    }
    
    .whllib-wrapper[data-view-mode="list"] .whllib-item-btn {
        width: 100%;
    }
}

/* Sections preferences notifications */
.whllib-notifications-section {
    border-top: 1px solid var(--whl-border);
    margin-top: 25px;
    padding-top: 20px;
    margin-bottom: 25px;
}

.whllib-notifications-section h4 {
    margin: 0 0 8px 0 !important;
    font-size: 16px;
    font-weight: 700;
    color: var(--whl-text);
}

.whllib-help-text {
    font-size: 13px;
    color: var(--whl-text-muted);
    margin: 0 0 16px 0 !important;
    line-height: 1.4;
}

.whllib-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.whllib-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.whllib-checkbox-item input[type="checkbox"] {
    accent-color: var(--whl-primary);
    cursor: pointer;
}

.whllib-checkbox-item label {
    font-size: 13px;
    font-weight: 500;
    color: var(--whl-text);
    cursor: pointer;
    margin: 0 !important;
}

/* ==========================================
   AGENDA SECTION (ÉVÉNEMENTS À VENIR)
   ========================================== */
.whllib-agenda-section-wrapper {
    margin-bottom: 30px;
}

.whllib-agenda-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px 0 !important;
    color: var(--whl-text);
}

.whllib-agenda-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.whllib-event-card {
    background-color: var(--whl-card-bg);
    border: 1px solid var(--whl-border);
    border-radius: var(--whl-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whllib-event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.whllib-event-image {
    height: 160px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.whllib-event-image:hover {
    opacity: 0.9;
}

.whllib-event-image-placeholder {
    height: 160px;
    background-color: rgba(79, 70, 229, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.whllib-event-image-placeholder span {
    font-size: 40px;
    opacity: 0.6;
}

.whllib-event-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.whllib-event-date {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--whl-primary);
    margin-bottom: 6px;
    letter-spacing: 0.05em;
}

.whllib-event-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px 0 !important;
    color: var(--whl-text);
    line-height: 1.3;
}

.whllib-event-description {
    font-size: 13px;
    color: var(--whl-text-muted);
    line-height: 1.5;
    margin: 0 !important;
}

.whllib-event-description p {
    margin: 0 0 10px 0 !important;
}
.whllib-event-description p:last-child {
    margin-bottom: 0 !important;
}

.whllib-event-more-link {
    color: var(--whl-primary);
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
    cursor: pointer;
}

.whllib-event-more-link:hover {
    text-decoration: underline;
}

/* Event Detail Modal Overlay */
.whllib-event-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.whllib-event-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.whllib-event-modal-container {
    background-color: var(--whl-card-bg);
    border: 1px solid var(--whl-border);
    border-radius: var(--whl-radius);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.whllib-event-modal-overlay.active .whllib-event-modal-container {
    transform: scale(1);
}

.whllib-event-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.whllib-event-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.whllib-modal-event-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.whllib-modal-event-details {
    padding: 24px;
}

.whllib-modal-event-date {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--whl-primary);
    margin-bottom: 8px;
    display: block;
    letter-spacing: 0.05em;
}

.whllib-event-time {
    font-size: 11px;
    font-weight: 400;
    color: var(--whl-primary);
    margin-bottom: 12px;
    display: block;
    line-height: 1.4;
}

.whllib-modal-event-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px 0 !important;
    color: var(--whl-text);
    line-height: 1.3;
}

.whllib-modal-event-description {
    font-size: 14px;
    color: var(--whl-text-muted);
    line-height: 1.6;
}

.whllib-modal-event-description p {
    margin: 0 0 14px 0 !important;
}

.whllib-modal-event-description p:last-child {
    margin-bottom: 0 !important;
}

/* ==========================================
   AJAX AGENDA CONTROLS & VIEWS
   ========================================== */
.whllib-agenda-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
}

.whllib-agenda-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}


.whllib-agenda-month-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--whl-input-bg);
    border: 1px solid var(--whl-border);
    border-radius: var(--whl-radius-inner);
    padding: 4px 10px;
}

.whllib-agenda-nav-btn {
    background: none;
    border: none;
    color: var(--whl-text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 0 5px;
    transition: color 0.2s ease;
}

.whllib-agenda-nav-btn:hover {
    color: var(--whl-text);
}

.whllib-agenda-current-month {
    font-weight: 600;
    font-size: 14px;
    color: var(--whl-text);
    min-width: 120px;
    text-align: center;
}

/* ==========================================
   MONTHLY PLANNING CALENDAR GRID
   ========================================== */
.whllib-calendar-wrapper {
    border: 1px solid var(--whl-border);
    border-radius: var(--whl-radius);
    overflow: hidden;
    background-color: var(--whl-card-bg);
    margin-bottom: 20px;
}

.whllib-calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background-color: var(--whl-input-bg);
    border-bottom: 1px solid var(--whl-border);
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    color: var(--whl-text-muted);
    padding: 10px 0;
}

.whllib-calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(100px, auto);
}

.whllib-calendar-day-cell {
    border-right: 1px solid var(--whl-border);
    border-bottom: 1px solid var(--whl-border);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 100px;
    position: relative;
    transition: background-color 0.2s ease;
}

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

.whllib-calendar-day-cell:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.whllib-wrapper[data-theme="light"] .whllib-calendar-day-cell:hover {
    background-color: rgba(0, 0, 0, 0.01);
}

.whllib-calendar-day-cell.adjacent-month {
    opacity: 0.4;
    background-color: rgba(0, 0, 0, 0.1);
}

.whllib-wrapper[data-theme="light"] .whllib-calendar-day-cell.adjacent-month {
    background-color: rgba(0, 0, 0, 0.02);
}

.whllib-calendar-day-cell.today {
    background-color: rgba(79, 70, 229, 0.08);
}

.whllib-calendar-day-cell.today .day-number {
    background-color: var(--whl-primary);
    color: #ffffff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.day-number {
    font-size: 12px;
    color: var(--whl-text-muted);
    font-weight: 500;
    align-self: flex-start;
}

.day-events-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    overflow: hidden;
}

.whllib-calendar-event {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 6px 8px;
    background-color: var(--whl-input-bg);
    border: 1px solid var(--whl-border);
    border-radius: var(--whl-radius-inner);
    cursor: pointer;
    font-size: 11px;
    line-height: 1.3;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.whllib-calendar-event:hover {
    border-color: var(--whl-primary);
    transform: translateY(-1px);
}

.whllib-event-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #f59e0b; /* Orange indicator */
    flex-shrink: 0;
    margin-top: 3px;
}

.whllib-event-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    color: var(--whl-text);
    font-weight: 500;
    max-height: 5.2em;
    line-height: 1.3;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    display: -webkit-box;
}

.whllib-event-time {
    display: block;
    margin-top: 2px;
    color: var(--whl-text-muted);
    font-size: 10px;
    line-height: 1.3;
}

/* ==========================================
   DOCUMENTS SORTING & PAGINATION (PICO.CSS STYLE)
   ========================================== */
.whllib-sort-box select {
    background-color: var(--whl-input-bg) !important;
    border: 1px solid var(--whl-border) !important;
    border-radius: var(--whl-radius-inner) !important;
    color: var(--whl-text) !important;
    padding: 8px 30px 8px 12px !important;
    font-size: 14px !important;
    outline: none !important;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 16px !important;
}

.whllib-pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    width: 100%;
}

.whllib-pagination-container nav ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 5px;
    align-items: center;
}

.whllib-pagination-container nav ul li a,
.whllib-pagination-container nav ul li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 6px;
    border-radius: var(--whl-radius-inner);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: var(--whl-text-muted);
    border: 1px solid var(--whl-border);
    background-color: var(--whl-input-bg);
    transition: all 0.2s ease;
    cursor: pointer;
}

.whllib-pagination-container nav ul li a:hover {
    color: var(--whl-text);
    border-color: var(--whl-primary);
}

.whllib-pagination-container nav ul li a.active {
    background-color: var(--whl-primary);
    color: #ffffff;
    border-color: var(--whl-primary);
}

.whllib-pagination-container nav ul li span.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.whllib-infinite-sentinel {
    text-align: center;
    padding: 20px 0;
    color: var(--whl-text-muted);
    font-size: 14px;
    font-weight: 500;
}

/* responsive calendar */
@media (max-width: 768px) {
    .whllib-calendar-header-cell {
        font-size: 11px;
    }
    .whllib-calendar-day-cell {
        min-height: 70px;
    }
    .whllib-event-title {
        display: none;
    }
    .whllib-calendar-event {
        justify-content: center;
        padding: 4px;
    }
}

