/* custom.css - Styles personnalisés pour l'École d'Infirmières de Libreville */

:root {
    --primary-color: #1e40af;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    /* Responsive Font Sizes */
    --fs-hero-h1: clamp(1.75rem, 5vw, 3.5rem);
    --fs-hero-p: clamp(1rem, 3vw, 1.35rem);
    --fs-heading: clamp(1.25rem, 3vw, 1.75rem);
}

/* Styles généraux */
html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    background: #f3f4f6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.shadow {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

/* ===== Navbar Styles ===== */
.navbar-custom {
    background: linear-gradient(90deg, rgba(30, 64, 175, 0.95) 0%, rgba(37, 99, 235, 0.95) 100%) !important;
    border-bottom: 3px solid #667eea;
    backdrop-filter: blur(10px);
}

.navbar-custom .navbar-toggler {
    border: none;
    padding: 0.4rem 0.6rem;
    min-height: 44px;
}

.navbar-custom .navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

.navbar-custom .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.5rem 0.75rem !important;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-custom .nav-link:hover, 
.navbar-custom .nav-link.active {
    color: white !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.navbar-custom .nav-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

.dropdown-menu-custom {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 0.75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: none;
    min-width: 220px;
    animation: slideDown 0.2s ease-out;
}

.dropdown-menu-custom .dropdown-item {
    color: #1f2937;
    padding: 0.625rem 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 40px;
}

.dropdown-menu-custom .dropdown-item:hover {
    background-color: #f3f4f6;
    color: #1e40af;
    transform: translateX(4px);
}

.dropdown-menu-custom .dropdown-item:focus-visible {
    background-color: #f3f4f6;
    outline: 2px solid #1e40af;
    outline-offset: -2px;
}

.dropdown-menu-custom .dropdown-item i {
    min-width: 18px;
    text-align: center;
}

.dropdown-menu-custom .dropdown-divider {
    margin: 0.5rem 0;
    opacity: 0.2;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section héros */
.hero-section {
    min-height: 60vh;
    display: flex;
    align-items: center;
    position: relative;
    color: white;
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    padding: 2rem 1rem;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.hero-section .row {
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero-section h1 {
    font-size: var(--fs-hero-h1);
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    animation: fadeInDown 0.8s ease-out;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-section p {
    font-size: var(--fs-hero-p);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease-out 0.2s both;
    margin-bottom: 1.5rem;
}

.hero-section .d-flex {
    animation: fadeInUp 0.8s ease-out 0.4s both;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

/* Cartes de fonctionnalités */
.card {
    border: none;
    border-radius: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-1);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.card:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-body i {
    transition: transform 0.3s ease;
    font-size: 2rem;
}

.card:hover .card-body i {
    transform: scale(1.15) rotate(5deg);
}

/* Navigation */
.navbar {
    background: linear-gradient(90deg, rgba(30, 64, 175, 0.95) 0%, rgba(37, 99, 235, 0.95) 100%) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid var(--gradient-1);
    backdrop-filter: blur(10px);
    padding: 0.75rem 0 !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    color: white !important;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    padding: 0.25rem 0 !important;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-nav {
    gap: 0.25rem;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 0 0.25rem;
    padding: 0.5rem 0.75rem !important;
    white-space: nowrap;
}

.navbar-nav .nav-link:hover {
    color: white !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.navbar-nav .nav-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* Brand logo and text styling */
.brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease;
}

.brand-logo:hover {
    transform: scale(1.1);
}

.navbar-brand .brand-text {
    line-height: 1;
    display: flex;
    flex-direction: column;
    margin-left: 0.5rem;
}

.navbar-brand .brand-title {
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.navbar-brand .brand-sub {
    font-size: clamp(0.65rem, 1.5vw, 0.72rem);
    color: rgba(255, 255, 255, 0.9);
    margin-top: -2px;
}

/* Centered brand layout for navbar */
.brand-center .container {
    position: relative;
}

.brand-center .navbar-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 8px;
    z-index: 3;
}

.brand-center .navbar-toggler {
    z-index: 4;
}

.brand-center .navbar-collapse {
    margin-left: 0;
}

/* Boutons */
.btn {
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 44px;
    padding: 0.5rem 1rem;
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.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:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.btn-light:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

/* Formulaires */
.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    min-height: 44px;
    padding: 0.5rem 0.75rem;
}

.form-control:focus, .form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

/* Tableaux */
.table {
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: var(--dark-color);
}

/* Alertes */
.alert {
    border-radius: 1rem;
    border: none;
    border-left: 4px solid;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.alert-success {
    border-left-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.alert-danger {
    border-left-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

.alert-warning {
    border-left-color: var(--warning-color);
    background: rgba(245, 158, 11, 0.1);
}

.alert-info {
    border-left-color: var(--info-color);
    background: rgba(6, 182, 212, 0.1);
}

/* Badges */
.badge {
    font-size: 0.8em;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Statistiques */
.stats-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--info-color) 100%);
    color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.stats-card .stats-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stats-card .stats-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Dashboard */
.dashboard-card {
    height: 100%;
}

.dashboard-card .card-header {
    background-color: var(--light-color);
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* Présences */
.presence-present {
    background-color: #d4edda;
    color: #155724;
}

.presence-absent {
    background-color: #f8d7da;
    color: #721c24;
}

.presence-retard {
    background-color: #fff3cd;
    color: #856404;
}

.presence-justifie {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Reçus */
.receipt-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.receipt-header {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.receipt-title {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
}

.receipt-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.receipt-details {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
}

.receipt-amount {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--success-color);
    text-align: center;
    margin: 1rem 0;
}

/* Responsive */
/* ========================================
   MOBILE FIRST (Extra Small: < 576px)
   ======================================== */
@media (max-width: 575px) {
    :root {
        --fs-hero-h1: 1.75rem;
        --fs-hero-p: 1rem;
    }

    html {
        font-size: 14px;
    }

    .hero-section {
        min-height: 50vh;
        padding: 1.5rem 1rem;
        text-align: center;
    }

    .hero-section h1 {
        font-size: var(--fs-hero-h1);
        margin-bottom: 0.75rem;
    }

    .hero-section p {
        font-size: var(--fs-hero-p);
        margin-bottom: 1rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .navbar {
        padding: 0.5rem 0 !important;
    }

    .navbar-brand .brand-sub {
        display: none;
    }

    .navbar-brand {
        font-size: 0.95rem;
    }

    .receipt-info {
        flex-direction: column;
        gap: 1rem;
    }

    .receipt-container {
        padding: 1rem;
        max-width: 100%;
    }

    .container, .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .table {
        font-size: 0.875rem;
    }

    .table thead th {
        padding: 0.5rem !important;
    }

    .table tbody td {
        padding: 0.5rem !important;
    }
}

/* ========================================
   SMALL DEVICES (Small: 576px - 767px)
   ======================================== */
@media (min-width: 576px) and (max-width: 767px) {
    :root {
        --fs-hero-h1: 2.25rem;
        --fs-hero-p: 1.1rem;
    }

    html {
        font-size: 15px;
    }

    .hero-section {
        min-height: 55vh;
        padding: 2rem 1.5rem;
    }

    .card-body {
        padding: 1.25rem;
    }

    .btn-group-vertical .btn {
        width: 100%;
    }

    .receipt-info {
        flex-direction: column;
    }

    .table {
        font-size: 0.9rem;
    }
}

/* ========================================
   TABLET (Medium: 768px - 1023px)
   ======================================== */
@media (min-width: 768px) and (max-width: 1023px) {
    :root {
        --fs-hero-h1: 2.75rem;
        --fs-hero-p: 1.25rem;
    }

    html {
        font-size: 15px;
    }

    .hero-section {
        min-height: 60vh;
        padding: 2.5rem;
    }

    .card-body {
        padding: 1.5rem;
    }

    .navbar-brand .brand-sub {
        font-size: 0.65rem;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ========================================
   DESKTOP (Large: 1024px+)
   ======================================== */
@media (min-width: 1024px) {
    :root {
        --fs-hero-h1: 3.5rem;
        --fs-hero-p: 1.35rem;
    }

    html {
        font-size: 16px;
    }

    .hero-section {
        min-height: 70vh;
        padding: 3rem 2rem;
    }

    .card-body {
        padding: 2rem;
    }

    .card:hover {
        transform: translateY(-8px);
    }

    .receipt-info {
        flex-direction: row;
    }

    .receipt-info > div {
        flex: 1;
    }
}

/* ========================================
   EXTRA LARGE (Extra Large: 1440px+)
   ======================================== */
@media (min-width: 1440px) {
    .container-lg {
        max-width: 1200px;
    }

    .hero-section h1 {
        font-size: 4rem;
    }

    .card-body {
        padding: 2.5rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Print styles */
@media print {
    body {
        background: white !important;
        font-size: 12pt !important;
    }

    .no-print {
        display: none !important;
    }

    .navbar, .footer, .sidebar {
        display: none !important;
    }

    .receipt-container {
        box-shadow: none;
        padding: 1rem;
    }

    .btn {
        display: none !important;
    }

    .hero-section {
        min-height: auto;
        padding: 1rem;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Accessibility & High Contrast Mode */
@media (prefers-contrast: more) {
    .card {
        border: 2px solid var(--primary-color);
    }

    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .btn::before {
        display: none;
    }
}

/* ==========================================
   Menu Responsive Professionnel - Admin Dashboard
   ========================================== */

.admin-nav-menu {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    padding: 1rem 0;
}

.admin-nav-brand {
    color: white;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.admin-nav-toggler-icon {
    filter: brightness(1.3);
}

.admin-nav-link {
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

/* Menu items styling */
.admin-nav-menu .navbar-nav .nav-link {
    position: relative;
    font-size: 0.95rem;
    white-space: nowrap;
}

.admin-nav-menu .navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.admin-nav-menu .navbar-nav .nav-link:active {
    background-color: rgba(255, 255, 255, 0.25) !important;
}

/* Mode mobile/tablette */
@media (max-width: 991px) {
    .admin-nav-menu .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
        border-left: 3px solid transparent;
        margin: 0.25rem 0;
        border-radius: 0.5rem !important;
    }

    .admin-nav-menu .navbar-nav .nav-link:hover {
        border-left-color: white;
        background-color: rgba(255, 255, 255, 0.15) !important;
        transform: translateX(4px);
    }

    .admin-nav-menu .navbar-collapse {
        background-color: rgba(0, 0, 0, 0.1);
        border-radius: 0 0 1rem 1rem;
        margin-top: 0.5rem;
        padding: 1rem 0.5rem;
    }
}

/* Mode desktop */
@media (min-width: 992px) {
    .admin-nav-menu .navbar-nav .nav-link {
        border-radius: 2rem !important;
    }

    .admin-nav-menu .navbar-nav .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.2) !important;
    }
}

/* Form card spécifique pour les formulaires d'inscription */
.form-card {
    max-width: 900px;
    margin: 1.5rem auto;
    border-radius: 1rem;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.form-card .form-side {
    padding: 2rem;
    background: white;
}
.form-card .hero-side {
    background: linear-gradient(180deg, rgba(30,64,175,0.95), rgba(37,99,235,0.95));
    color: white;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}
.form-card .hero-side h3 {
    margin: 0;
    font-size: 1.6rem;
}
.form-card .hero-side p { opacity: 0.95; }
.form-card .btn-cta {
    background: linear-gradient(90deg, #06b6d4 0%, #3b82f6 100%);
    color: white;
    border: none;
}
.profile-avatar { border-radius: .75rem; max-width:120px; }

/* Styles pour la page d'inscription (titre + logo) */
.inscription-header { 
    gap: 0.5rem; 
    flex-direction: column; 
    align-items: center; 
    text-align: center;
}
.header-logo {
    width: 48px;
    max-width: 18%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}
.inscription-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
}
.inscription-sub { font-size: 0.95rem; }

@media (max-width: 768px) {
    .header-logo { width: 40px; max-width: 30%; }
    .inscription-title { font-size: 1.25rem; }
}

@media (max-width: 992px) {
    .form-card { grid-template-columns: 1fr; }
    .form-card .hero-side { text-align: center; }
}