/* Custom styles for MEC FADEC NJAMBUR Helpdesk */

/* === Charte graphique globale === */
:root {
    --color-primary: #ff914d;
    --color-blanc: #ffffff;
    --color-noir: #000000;
}

html, body {
    font-family: 'League Spartan', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
    color: var(--color-noir);
    background-color: var(--color-blanc);
}

/* Utilitaires polices */
.font-spartan { font-family: 'League Spartan', ui-sans-serif, system-ui, sans-serif; }
.font-bukhari { font-family: 'Bukhari Script', cursive; }

/* Titres plus affirmés */
h1, h2, h3 { font-family: 'League Spartan', ui-sans-serif, system-ui, sans-serif; color: var(--color-noir); }
h1 { font-weight: 800; }
h2 { font-weight: 700; }
h3 { font-weight: 600; }

/* Bouton primaire générique (appliqué largement) */
.btn-primary,
button[type="submit"],
a.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem; /* rounded-xl */
    padding: 0.75rem 1.5rem; /* px-6 py-3 */
    color: #ffffff;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary) 0%, #ff7a2e 50%, #ff6a00 100%);
    box-shadow: 0 10px 25px rgba(255,145,77,0.25);
    transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}
.btn-primary:hover,
button[type="submit"]:hover,
a.btn-primary:hover { transform: translateY(-1px) scale(1.01); filter: brightness(0.98); }

/* Champs de formulaire par défaut (inputs, selects, textareas) */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"],
select,
textarea,
.form-input-base {
    width: 100%;
    border-radius: 0.75rem; /* rounded-xl */
    border: 1px solid #e5e7eb; /* gray-200 */
    background-color: #ffffff;
    padding: 0.75rem 1rem; /* px-4 py-3 */
    color: #111827; /* gray-900 */
    transition: box-shadow .2s ease, border-color .2s ease;
    outline: none;
}
input:focus,
select:focus,
textarea:focus,
.form-input-base:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255,145,77,0.3);
}

/* Cartes génériques */
.card { background-color: #ffffff; border-radius: 1rem; box-shadow: 0 10px 25px rgba(0,0,0,0.05); }

/* Smooth scrolling for in-page anchors */
html {
    scroll-behavior: smooth;
}

/* Anchor offset so sections aren't hidden under the header */
#features {
    scroll-margin-top: 6rem; /* ~96px */
}

/* Line clamp utility */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animation classes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Custom button styles */
.btn-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

/* Status indicators */
.status-indicator {
    position: relative;
}

.status-indicator::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Priority colors */
.priority-critical { color: #dc2626; }
.priority-high { color: #ea580c; }
.priority-medium { color: #d97706; }
.priority-low { color: #16a34a; }

/* Custom form styles */
.form-floating {
    position: relative;
}

.form-floating input,
.form-floating textarea {
    padding-top: 1.5rem;
}

.form-floating label {
    position: absolute;
    top: 0.5rem;
    left: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
    transition: all 0.2s ease;
    pointer-events: none;
}

.form-floating input:focus + label,
.form-floating input:not(:placeholder-shown) + label,
.form-floating textarea:focus + label,
.form-floating textarea:not(:placeholder-shown) + label {
    top: -0.5rem;
    left: 0.75rem;
    font-size: 0.75rem;
    color: #3b82f6;
    background-color: white;
    padding: 0 0.25rem;
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Notification styles */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    max-width: 400px;
    animation: slideInRight 0.3s ease-out;
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .dark-mode {
        background-color: #1f2937;
        color: #f9fafb;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-after: always;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .mobile-stack {
        flex-direction: column;
        gap: 1rem;
    }
    
    .mobile-full {
        width: 100%;
    }
}

/* Custom focus styles */
.focus-ring:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Table responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Custom badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-sm {
    padding: 0.125rem 0.5rem;
    font-size: 0.625rem;
}

.badge-lg {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Utility classes */
.text-shadow {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.backdrop-blur {
    backdrop-filter: blur(8px);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Custom gradients - MEC FADEC NJAMBUR Colors */
.gradient-primary {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.gradient-secondary {
    background: linear-gradient(135deg, #000000 0%, #374151 100%);
}

.gradient-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.gradient-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.gradient-danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* New modern design styles */
.hero-gradient {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 50%, #dc2626 100%);
}

.login-gradient, .otp-gradient {
    background: linear-gradient(135deg, #ff914d 0%, #ff7a2e 50%, #ff6a00 100%);
}

.floating-animation {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

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

.glass-effect {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.input-focus:focus {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(249, 115, 22, 0.15);
}

.otp-input {
    letter-spacing: 0.5em;
    font-weight: bold;
    text-align: center;
    font-size: 2rem;
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.otp-input:focus {
    border-color: #ff914d;
    box-shadow: 0 0 0 3px rgba(255, 145, 77, 0.15);
    transform: translateY(-2px);
}

.otp-input.error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Enhanced button styles */
.btn-modern {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    transition: all 0.3s ease;
    transform: translateY(0);
}

.btn-modern:hover {
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(249, 115, 22, 0.3);
}

/* Card hover effects enhanced */
.card-modern {
    transition: all 0.5s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-modern:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border-color: rgba(249, 115, 22, 0.3);
}

/* Text effects */
.text-gradient {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Loading states */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Responsive improvements */
@media (max-width: 768px) {
    .hero-gradient, .login-gradient, .otp-gradient {
        background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    }
    
    .floating-animation {
        animation-duration: 4s;
    }
    
    .glass-effect {
        backdrop-filter: blur(10px);
    }
}

/* Password input component styles */
.password-input-container {
    position: relative;
}

.password-toggle-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: #6b7280;
    transition: color 0.2s ease;
    z-index: 10;
}

.password-toggle-btn:hover {
    color: #374151;
}

.password-toggle-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 0.25rem;
}

.password-toggle-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Animation pour le changement d'icône */
.password-toggle-btn svg {
    transition: opacity 0.2s ease;
}

.password-toggle-btn svg.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Style pour les champs de mot de passe avec bouton */
input[type="password"] + .password-toggle-btn,
input[type="text"] + .password-toggle-btn {
    right: 0.75rem;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .password-toggle-btn {
        right: 0.5rem;
    }
    
    .password-toggle-btn svg {
        width: 1rem;
        height: 1rem;
    }
}

