/* ==========================================
   RESPONSIVE - STYLES PARTAGÉS (Public)
   ========================================== */

/* ==========================================
   MODALES & POPUPS
   ========================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.95), rgba(15, 23, 42, 0.95));
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary);
}

.modal-header h2 {
    color: var(--primary);
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-light);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(217, 119, 6, 0.3);
    background: rgba(31, 41, 55, 0.8);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.form-actions .btn {
    flex: 1;
    min-width: 150px;
}

/* ==========================================
   TABLES (Pour le site public si besoin)
   ========================================== */

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(31, 41, 55, 0.3);
}

.table thead {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.2), rgba(13, 148, 136, 0.1));
    border-bottom: 2px solid var(--primary);
}

.table th {
    padding: 1rem;
    text-align: left;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-light);
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: rgba(217, 119, 6, 0.05);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.table-action-btn {
    padding: 0.5rem 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    font-weight: 600;
}

.btn-edit {
    background: var(--accent-light);
    color: var(--bg-darker);
}

.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 148, 136, 0.3);
}

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

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.3);
}

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

.btn-view:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(217, 119, 6, 0.3);
}

/* ==========================================
   ALERTS & MESSAGES
   ========================================== */

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    animation: slideDown 0.3s ease-out;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--error);
    color: var(--error);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: var(--warning);
    color: var(--warning);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: rgb(59, 130, 246);
    color: rgb(59, 130, 246);
}


/* ==========================================
   PAGINATION
   ========================================== */

.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

.pagination a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination .active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}


/* ==========================================
   RESPONSIVE MOBILE - PUBLIC (Modals/Tables)
   ========================================== */

@media (max-width: 768px) {
    .table-container {
        font-size: 0.85rem;
    }

    .table th,
    .table td {
        padding: 0.7rem;
    }

    .table-actions {
        flex-direction: column;
    }

    .table-action-btn {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        min-width: auto;
    }

    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }

    .modal-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal-close {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .table {
        font-size: 0.8rem;
    }

    .table th,
    .table td {
        padding: 0.5rem;
    }

    .modal-content {
        max-width: 100%;
        padding: 1rem;
        margin: 1rem;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        /* Correction iOS pour empêcher le zoom sur les formulaires */
        font-size: 16px; 
    }

    .btn {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================
   LOADING SPINNER
   ========================================== */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(217, 119, 6, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

/* ==========================================
   SCROLLBAR
   ========================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(31, 41, 55, 0.3);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Firefox */
* {
    scrollbar-color: var(--primary) rgba(31, 41, 55, 0.3);
    scrollbar-width: thin;
}
