﻿/* ========== MODALE ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(107, 78, 157, 0.4) 100%);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    width: 90%;
    max-width: 420px;
    overflow: hidden;
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from { 
        transform: translateY(50px) scale(0.9); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0) scale(1); 
        opacity: 1; 
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-yellow) 0%, #f5c400 100%);
    padding: var(--spacing-xl) var(--spacing-xl);
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 180px;
    height: 180px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: -40px;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.modal-header .title {
    color: var(--primary-black);
    font-size: var(--font-size-xxl);
    font-weight: var(--font-weight-bold);
    margin: 0;
    position: relative;
    z-index: 1;
    letter-spacing: -0.5px;
}

.modal-body {
    padding: var(--spacing-xxl) var(--spacing-xl);
    background: var(--white);
}

/* ========== FORMULAIRE ========== */
.form-group {
    margin-bottom: var(--spacing-xl);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-dark);
    font-size: var(--font-size-sm);
    letter-spacing: 0.3px;
}

.input-field {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    border: 2px solid var(--gray-medium);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--gray-light);
}

.input-field:hover {
    border-color: var(--primary-yellow);
    background-color: var(--white);
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-yellow);
    background-color: var(--white);
    box-shadow: 0 0 0 4px rgba(252, 207, 5, 0.15);
    transform: translateY(-2px);
}

.input-field::placeholder {
    color: #999;
    font-style: italic;
}

/* ========== BOUTONS ========== */
.btn {
    padding: var(--spacing-md) var(--spacing-xl);
    border: none;
    border-radius: var(--radius-pill);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-yellow) 0%, #f5c400 100%);
    color: var(--primary-black);
    box-shadow: 0 4px 15px rgba(252, 207, 5, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #f5c400 0%, var(--yellow-hover) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(252, 207, 5, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(252, 207, 5, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--primary-purple) 0%, #583d7f 100%);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(107, 78, 157, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #583d7f 0%, var(--purple-hover) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(107, 78, 157, 0.4);
}

.btn-block {
    width: 100%;
    display: block;
    padding: var(--spacing-lg) var(--spacing-xl);
    font-size: var(--font-size-lg);
}

/* ========== ALERTES ========== */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error {
    background: linear-gradient(135deg, #fff5f5 0%, #fee 100%);
    color: var(--error-color);
    border-left: 4px solid var(--error-color);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.15);
}

.alert-error::before {
    content: '⚠';
    font-size: var(--font-size-xl);
    line-height: 1;
}

/* ========== TITRES ========== */
.title {
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
}

.title-page {
    font-size: var(--font-size-xxl);
    color: var(--primary-black);
    margin: 0 0 var(--spacing-lg) 0;
}

.title-section {
    font-size: var(--font-size-xl);
    color: var(--primary-purple);
    margin-bottom: var(--spacing-md);
}

/* ========== CARTES ========== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-xl);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-yellow);
}

.card-header {
    padding-bottom: var(--spacing-md);
    border-bottom: 3px solid var(--primary-yellow);
    margin-bottom: var(--spacing-md);
}

/* ========== BANDEAU JAUNE (style site) ========== */
.banner-yellow {
    background: linear-gradient(135deg, var(--primary-yellow) 0%, #f5c400 100%);
    padding: var(--spacing-xl) var(--spacing-xl);
    position: relative;
    overflow: hidden;
}

.banner-yellow::after {
    content: '';
    position: absolute;
    bottom: -30px;
    right: -30px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

/* ========== PAGE CONTENT ========== */
.page-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xxl);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.page-title {
    font-size: 2rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-black);
    margin: 0 0 var(--spacing-xl) 0;
}

/* ========== STRUCTURE COMMUNE DES VUES ========== */

/* En-tête de page avec barre jaune et titre */
.page-header {
    margin-bottom: var(--spacing-xl);
}

.page-header-bar {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: var(--spacing-lg);
}

/* Barre jaune décorative à gauche (style td1) */
.page-bar-left {
    width: 70px;
    min-width: 70px;
    height: 8px;
    background: var(--primary-yellow);
    border: 2px solid var(--primary-yellow);
}

/* Zone du titre avec bordures */
.page-title-wrapper {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-top: 2px solid var(--primary-yellow);
    border-bottom: 2px solid var(--primary-yellow);
    display: flex;
    align-items: center;
}

.page-title-wrapper h1 {
    margin: 0;
    font-size: var(--font-size-xxl);
    font-weight: var(--font-weight-bold);
    color: var(--primary-black);
}

/* Barre jaune décorative à droite (style td1) */
.page-bar-right {
    width: 70px;
    min-width: 70px;
    height: 8px;
    background: var(--primary-yellow);
    border: 2px solid var(--primary-yellow);
}

/* Container rectangulaire avec coins arrondis pour le contenu */
.page-container {
    background: var(--white);
    border: 1px solid var(--gray-medium);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    min-height: 400px;
}

/* Variante compacte du header */
.page-header-compact .page-bar-left,
.page-header-compact .page-bar-right {
    width: 50px;
    min-width: 50px;
}

.page-header-compact .page-title-wrapper h1 {
    font-size: var(--font-size-xl);
}

/* ========== PAGE TITLE BAR (Structure avec barre jaune) ========== */
.page-title-bar {
    margin-bottom: 16px;
}

.page-title-table {
    width: 100%;
    border-collapse: collapse;
    height: 20px;
}

.page-title-table td {
    padding: 0;
    position: relative;
    height: 20px;
}

/* TD1 : Rectangle jaune plein (comme dans le header) */
.page-td1 {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    background: var(--primary-yellow);
}

/* TD2 : Triangle diagonal (moitié jaune) */
.page-td2 {
    width: 15px;
    min-width: 15px;
    max-width: 15px;
    background: linear-gradient(to bottom right, var(--primary-yellow) 0%, var(--primary-yellow) 50%, transparent 50%, transparent 100%);
}

/* TD3 : Zone du titre sans bordure */
.page-td3 {
    width: auto;
    background: var(--white);
    padding: 0 var(--spacing-lg);
    vertical-align: middle;
}

.page-td3 h1 {
    margin: 0;
    font-size: 16px;
    line-height: 20px;
    font-weight: var(--font-weight-bold);
    color: var(--primary-black);
}

/* ========== TITRE JAUNE POUR SECTIONS ========== */
.tdTitreJaune {
    background: var(--primary-yellow);
    padding: 3px 8px;
    font-weight: var(--font-weight-bold);
    font-size: 13px;
    color: var(--primary-black);
    margin: 0;
    display: inline-block;
    line-height: 1.2;
}

/* ========== SECTION TITRE (wrapper du titre jaune) ========== */
.page-container > table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    padding: 0;
}

.page-container > table > tbody > tr > td {
    padding: 0;
    margin: 0;
    vertical-align: top;
}

.page-container > table > tbody > tr:first-child > td > table {
    margin: 0;
    padding: 0;
    border-collapse: collapse;
}

.page-container > table > tbody > tr:first-child > td > table td {
    padding: 0;
    margin: 0;
}

/* ========== FORMULAIRE DE RECHERCHE ========== */
.search-form {
    margin-top: 10px;
    border-collapse: collapse;
    width: auto;
}

.search-form td {
    padding: 5px 0;
    vertical-align: middle;
}

.search-form .form-label {
    font-weight: var(--font-weight-semibold);
    font-size: 13px;
    color: var(--gray-dark);
    padding-right: 12px;
    white-space: nowrap;
    width: 120px;
    text-align: right;
}

.search-form .form-input {
    width: 300px;
}

.search-form .input-field {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--gray-medium);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font-family);
    transition: all 0.3s ease;
    background-color: var(--white);
    height: 28px;
    box-sizing: border-box;
}

.search-form .input-field:focus {
    outline: none;
    border-color: var(--primary-yellow);
    box-shadow: 0 0 0 2px rgba(252, 207, 5, 0.15);
}

/* Radio buttons */
.search-form .radio-group {
    display: flex;
    gap: 16px;
}

.search-form .radio-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.search-form input[type="radio"] {
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary-black);
}

.search-form .radio-label {
    font-size: 13px;
    color: var(--gray-dark);
    cursor: pointer;
    margin: 0;
}

/* Checkbox */
.search-form .checkbox-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.search-form input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary-black);
}

.search-form .checkbox-label {
    font-size: 13px;
    color: var(--gray-dark);
    cursor: pointer;
    margin: 0;
}

/* ========== TABLEAU DE RÉSULTATS ========== */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
    font-size: 13px;
    border-radius: 8px;
    overflow: hidden;
}

.results-table thead {
    background: var(--primary-yellow);
}

.results-table th {
    padding: 10px 12px;
    text-align: center;
    font-weight: var(--font-weight-bold);
    border: 1px solid #ddd;
    color: var(--primary-black);
}

.results-table th:first-child {
    border-top-left-radius: 8px;
}

.results-table th:last-child {
    border-top-right-radius: 8px;
}

.results-table td {
    padding: 8px 12px;
    border: 1px solid #ddd;
}

.results-table tbody tr {
    background: white;
    transition: background-color 0.2s ease;
}

.results-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.results-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background-color: #f5f5f5 !important;
}

/* ========== PAGINATION ========== */
.pagination {
    margin-top: 20px;
    text-align: center;
    padding: 15px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    padding: 8px 12px;
    min-width: 40px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    font-size: 13px;
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    color: var(--primary-black);
}

.pagination-btn:hover:not(:disabled):not(.active) {
    background: #f5f5f5;
    border-color: var(--primary-yellow);
}

.pagination-btn.active {
    background: var(--primary-yellow);
    border-color: var(--primary-yellow);
    font-weight: var(--font-weight-bold);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f9f9f9;
}

.pagination-ellipsis {
    padding: 8px 4px;
    color: var(--gray-dark);
    font-weight: var(--font-weight-bold);
}

/* ========== BOUTON ACTION (style menu avec effet 3D) ========== */
.boutonAction {
    padding: 8px 20px;
    background: var(--primary-yellow);
    border: 2px solid var(--primary-yellow);
    border-radius: 50px;
    color: var(--primary-black);
    font-size: 14px;
    font-weight: var(--font-weight-bold);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
    display: inline-block;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.boutonAction:hover {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(107, 78, 157, 0.4), 0 3px 6px rgba(0, 0, 0, 0.12);
}

.boutonAction:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* ========== CONTENEUR FORMULAIRE + BOUTONS ========== */
.form-buttons-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.form-section {
    flex: 0 0 auto;
    padding-left: 90px;
}

.buttons-section {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 50px;
    margin-right: 75px;
}

/* ========== PIED DE PAGE EMPLOYE ========== */
.footer-employee {
    background: var(--gray-light);
    padding: var(--spacing-xl) var(--spacing-xl);
    border-top: 1px solid var(--gray-medium);
    position: relative;
    z-index: 1;
}

.footer-employee .footer-content {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.footer-employee .logout-form {
    margin: 0;
}

.footer-employee .logout-link {
    color: var(--primary-purple);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.footer-employee .logout-link:hover {
    color: var(--primary-yellow);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: var(--spacing-md);
    }

    .modal-body {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .modal-header {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .modal-header .title {
        font-size: var(--font-size-xl);
    }

    /* Responsive pour la structure de page */
    .page-bar-left,
    .page-bar-right {
        width: 40px !important;
        min-width: 40px !important;
    }

    .page-title-wrapper h1 {
        font-size: var(--font-size-lg);
    }

    .page-container {
        padding: var(--spacing-lg);
    }

    .search-form .form-label {
        width: 100px;
    }

    .search-form .form-input {
        width: 200px;
    }

    .results-table {
        font-size: 11px;
    }

    .results-table th,
    .results-table td {
        padding: 6px 8px;
    }

    .pagination-btn {
        padding: 6px 12px;
        font-size: 11px;
        margin: 0 2px;
    }

    .pagination-info {
        font-size: 11px;
        padding: 6px 12px;
    }
}