/* Styles de base */
:root {
    --primary-color: #1e40af;
    --primary-hover: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-bg: rgba(30, 64, 175, 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}

/* Layout principal */
.admin-layout {
    display: flex !important;
    flex-direction: row !important;
    min-height: 100vh;
    width: 100%;
    position: relative;
    overflow-x: hidden;
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f8fafc;
    margin-left: 0;
    width: calc(100% - 280px);
    min-width: 0;
    overflow-x: hidden;
}

/* Header */
.header {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Content */
.content {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding: 32px;
}

/* Loading screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Login page */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-content: center;
    justify-items: center;
    padding: 20px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.login-container {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 20px 50px rgba(2, 8, 20, 0.15);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    padding: 48px 44px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
}

.login-logo i {
    color: #3b82f6;
    font-size: 40px;
    margin-bottom: 8px;
}

.login-logo span {
    font-size: 22px;
    letter-spacing: 0.2px;
}

.login-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.login-header p {
    color: #64748b;
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-group input {
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.95);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12), 0 2px 6px rgba(2, 8, 20, 0.08);
}

.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-container input {
    flex: 1;
    padding-right: 40px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: color 0.2s ease;
    font-size: 16px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
}

.password-toggle:hover {
    color: #3b82f6;
}

.password-toggle:focus {
    outline: none;
    color: #3b82f6;
}

.password-toggle i {
    font-size: 16px;
    color: inherit;
    display: block;
}

/* Boutons avec couleur primaire */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(30, 64, 175, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.2);
}

.btn-secondary {
    background: var(--primary-bg);
    color: var(--primary-color);
    border: 1px solid rgba(30, 64, 175, 0.2);
}

.btn-secondary:hover {
    background: rgba(30, 64, 175, 0.15);
    border-color: var(--primary-color);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    border: 1px solid #fecaca;
}

/* Responsive - Tablettes */
@media (max-width: 1024px) and (min-width: 769px) {
    .admin-layout {
        flex-direction: row;
    }
    
    .sidebar {
        width: 220px;
        min-width: 220px;
    }
    
    .main-content {
        width: calc(100% - 220px);
    }
}

/* Responsive - Tablettes petites */
@media (max-width: 768px) and (min-width: 481px) {
    .admin-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 180px;
        min-width: 180px;
    }
    
    .main-content {
        width: calc(100% - 180px);
    }
    
    .login-container {
        padding: 24px;
        margin: 20px;
    }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
    .admin-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .login-container {
        padding: 20px;
        margin: 10px;
    }
}

/* ===== NOTIFICATIONS ===== */
.notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
}

.notification-toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    max-width: 400px;
    min-width: 300px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: auto;
    border-left: 4px solid #2563eb;
}

.notification-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-toast.notification-success {
    border-left-color: #10b981;
}

.notification-toast.notification-warning {
    border-left-color: #f59e0b;
}

.notification-toast.notification-error {
    border-left-color: #ef4444;
}

.notification-toast.notification-message {
    border-left-color: #8b5cf6;
}

.notification-content {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
}

.notification-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.notification-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: #374151;
}

.notification-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.notification-close:hover {
    background: #f3f4f6;
    color: #6b7280;
}

/* Badge de notification dans la sidebar */
.notification-badge {
    background: #ef4444;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    position: absolute;
    top: -5px;
    right: -5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Position relative pour les éléments de navigation avec badge */
.nav-item {
    position: relative;
}

/* Badge de messages non lus pour les tickets */
.ticket-unread-badge {
    background: #ef4444;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    position: absolute;
    top: 8px;
    right: 8px;
    animation: pulse 2s infinite;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
    border: 2px solid white;
    z-index: 10;
}

/* Position relative pour les tickets avec badge */
.ticket-item {
    position: relative;
}

/* ===== PAGE D'ERREUR 404 ===== */
.error-404-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.error-404-content {
    text-align: center;
    max-width: 600px;
    width: 100%;
    background: white;
    border-radius: 20px;
    padding: 60px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.error-404-illustration {
    margin-bottom: 40px;
    position: relative;
}

.error-404-icon {
    font-size: 80px;
    color: #f59e0b;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.error-404-number {
    font-size: 120px;
    font-weight: 900;
    color: #1e40af;
    line-height: 1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(30, 64, 175, 0.1);
}

.error-404-text {
    margin-bottom: 40px;
}

.error-404-title {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
    line-height: 1.2;
}

.error-404-description {
    font-size: 18px;
    color: #64748b;
    margin-bottom: 12px;
    line-height: 1.6;
}

.error-404-suggestion {
    font-size: 16px;
    color: #94a3b8;
    line-height: 1.5;
}

.error-404-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.error-404-btn {
    min-width: 180px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.error-404-btn i {
    font-size: 18px;
}

.error-404-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.error-404-help {
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.error-404-help-text {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
    line-height: 1.5;
}

/* Animation pour l'icône */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Responsive pour la page 404 */
@media (max-width: 768px) {
    .error-404-content {
        padding: 40px 20px;
        margin: 20px;
    }
    
    .error-404-number {
        font-size: 80px;
    }
    
    .error-404-title {
        font-size: 24px;
    }
    
    .error-404-description {
        font-size: 16px;
    }
    
    .error-404-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .error-404-btn {
        width: 100%;
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .error-404-container {
        padding: 10px;
    }
    
    .error-404-content {
        padding: 30px 15px;
    }
    
    .error-404-number {
        font-size: 60px;
    }
    
    .error-404-icon {
        font-size: 60px;
    }
    
    .error-404-title {
        font-size: 20px;
    }
    
    .error-404-description {
        font-size: 14px;
    }
}
