/* Admin Polyclinique Kennedy - CSS */
/* Développé par W2K-Digital */

:root {
    --primary: #0077B6;
    --primary-dark: #005A8C;
    --secondary: #00B894;
    --danger: #E63946;
    --warning: #F4A261;
    --dark: #212529;
    --gray: #6C757D;
    --gray-light: #ADB5BD;
    --light: #F8F9FA;
    --white: #FFFFFF;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Open Sans', sans-serif;
    background: var(--light);
    color: var(--dark);
    min-height: 100vh;
}

/* =========================================
   LOGIN SCREEN
   ========================================= */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 20px;
}

.login-card {
    background: var(--white);
    padding: 48px 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.login-logo i {
    font-size: 36px;
    color: var(--white);
}

.login-card h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 8px;
}

.login-card > p {
    color: var(--gray);
    margin-bottom: 32px;
}

.pin-container {
    margin-bottom: 32px;
}

.pin-container label {
    display: block;
    font-size: 0.875rem;
    color: var(--gray);
    margin-bottom: 16px;
}

.pin-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.pin-input {
    width: 56px;
    height: 64px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s;
}

.pin-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,119,182,0.2);
}

.pin-input.error {
    border-color: var(--danger);
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.pin-error {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 12px;
    min-height: 20px;
}

.login-footer {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--light);
}

.login-footer p {
    font-size: 0.8125rem;
    color: var(--gray-light);
}

/* =========================================
   ADMIN PANEL
   ========================================= */

.admin-panel {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-header {
    background: var(--dark);
    color: var(--white);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

.header-left i {
    font-size: 24px;
    color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-link {
    color: var(--gray-light);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s;
}

.header-link:hover {
    color: var(--white);
}

.btn-logout {
    background: none;
    border: none;
    color: var(--gray-light);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.3s;
}

.btn-logout:hover {
    color: var(--danger);
}

/* Navigation */
.admin-nav {
    background: var(--white);
    padding: 0 24px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #E9ECEF;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    color: var(--gray);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.nav-item:hover {
    color: var(--primary);
}

.nav-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Main Content */
.admin-main {
    flex: 1;
    padding: 24px;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: var(--primary);
}

/* =========================================
   BUTTONS
   ========================================= */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.8125rem;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray);
    color: var(--white);
}

.btn-success {
    background: var(--secondary);
    color: var(--white);
}

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

/* =========================================
   CARDS GRID
   ========================================= */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-avatar {
    padding: 24px 24px 0;
    text-align: center;
}

.card-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
}

.badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: var(--secondary);
    color: var(--white);
}

.badge-warning {
    background: var(--warning);
    color: var(--white);
}

.card-body {
    padding: 20px;
}

.card-body h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    margin-bottom: 8px;
}

.card-date, .card-function {
    font-size: 0.8125rem;
    color: var(--gray);
    margin-bottom: 8px;
}

.card-date i {
    margin-right: 6px;
    color: var(--primary);
}

.card-rating {
    margin-bottom: 12px;
}

.card-rating i {
    color: #DEE2E6;
    font-size: 0.875rem;
}

.card-rating i.active {
    color: #FFD700;
}

.card-excerpt {
    font-size: 0.875rem;
    color: var(--gray);
    line-height: 1.6;
}

.card-actions {
    padding: 16px 20px;
    border-top: 1px solid #E9ECEF;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.loading, .empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.loading i, .empty i {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--gray-light);
}

/* =========================================
   MODALS
   ========================================= */

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

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-small {
    max-width: 400px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #E9ECEF;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--gray);
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #E9ECEF;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.text-muted {
    color: var(--gray);
    font-size: 0.875rem;
}

/* =========================================
   FORMS
   ========================================= */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 8px;
    color: var(--dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #DEE2E6;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,119,182,0.1);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Image Upload */
.image-upload {
    position: relative;
}

.image-upload input[type="file"] {
    display: none;
}

.image-preview {
    width: 100%;
    height: 160px;
    border: 2px dashed var(--gray-light);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    overflow: hidden;
}

.image-preview:hover {
    border-color: var(--primary);
    background: rgba(0,119,182,0.05);
}

.image-preview i {
    font-size: 32px;
    color: var(--gray-light);
    margin-bottom: 8px;
}

.image-preview span {
    font-size: 0.875rem;
    color: var(--gray);
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Rating Select */
.rating-select {
    display: flex;
    gap: 8px;
}

.rating-select .star {
    font-size: 24px;
    color: #DEE2E6;
    cursor: pointer;
    transition: color 0.2s;
}

.rating-select .star.active {
    color: #FFD700;
}

.rating-select .star:hover {
    transform: scale(1.2);
}

/* =========================================
   TOAST NOTIFICATIONS
   ========================================= */

#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

.toast-success {
    border-left: 4px solid var(--secondary);
}

.toast-success i {
    color: var(--secondary);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-error i {
    color: var(--danger);
}

.toast.fade-out {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 768px) {
    .admin-header {
        padding: 12px 16px;
    }
    
    .header-left span {
        display: none;
    }
    
    .admin-nav {
        padding: 0 16px;
        overflow-x: auto;
    }
    
    .nav-item {
        padding: 12px 16px;
        white-space: nowrap;
    }
    
    .nav-item span {
        display: none;
    }
    
    .admin-main {
        padding: 16px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .pin-input {
        width: 48px;
        height: 56px;
        font-size: 20px;
    }
    
    #toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
}
