/**
 * Styles personnalisés pour la Plateforme Transitaires PAL
 * Couleurs : Bleu marine (PAL) et Vert (croissance)
 */

/* Variables CSS pour les couleurs du thème */
:root {
    --pal-blue: #1e3a8a;
    --pal-blue-light: #3b82f6;
    --pal-blue-dark: #1e40af;
    --pal-green: #059669;
    --pal-green-light: #10b981;
    --pal-green-dark: #047857;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
}

/* Classes utilitaires pour les couleurs */
.bg-pal-blue {
    background-color: var(--pal-blue) !important;
}

.bg-pal-blue-light {
    background-color: var(--pal-blue-light) !important;
}

.bg-pal-green {
    background-color: var(--pal-green) !important;
}

.text-pal-blue {
    color: var(--pal-blue) !important;
}

.text-pal-green {
    color: var(--pal-green) !important;
}

.border-pal-blue {
    border-color: var(--pal-blue) !important;
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--pal-green-light) !important;
}

/* Hero section */
.hero-section {
    background: linear-gradient(135deg, var(--pal-blue) 0%, var(--pal-blue-dark) 100%);
    min-height: 70vh;
    display: flex;
    align-items: center;
}

.hero-section .display-4 {
    line-height: 1.2;
}

/* Feature cards */
.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid var(--border-color) !important;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--pal-blue-light) !important;
}

.feature-icon i {
    font-size: 3rem !important;
}

/* Testimonial cards */
.testimonial-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Statistiques */
.stat-item h3 {
    margin-bottom: 10px;
}

/* Boutons personnalisés */
.btn-pal-blue {
    background-color: var(--pal-blue);
    border-color: var(--pal-blue);
    color: white;
}

.btn-pal-blue:hover {
    background-color: var(--pal-blue-dark);
    border-color: var(--pal-blue-dark);
    color: white;
}

.btn-pal-green {
    background-color: var(--pal-green);
    border-color: var(--pal-green);
    color: white;
}

.btn-pal-green:hover {
    background-color: var(--pal-green-dark);
    border-color: var(--pal-green-dark);
    color: white;
}

/* Contenu principal */
.main-content {
    min-height: calc(100vh - 200px);
}

/* Dashboard */
.dashboard-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.dashboard-stat {
    font-size: 2.5rem;
    font-weight: bold;
}

/* Formulaires */
.form-control:focus {
    border-color: var(--pal-blue-light);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
}

/* Tables */
.table-pal thead th {
    background-color: var(--pal-blue);
    color: white;
    border: none;
    font-weight: 600;
}

.table-pal tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

/* Alerts personnalisées */
.alert-pal-info {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: var(--pal-blue-light);
    color: var(--pal-blue-dark);
}

.alert-pal-success {
    background-color: rgba(5, 150, 105, 0.1);
    border-color: var(--pal-green);
    color: var(--pal-green-dark);
}

/* Badges */
.badge-pal-blue {
    background-color: var(--pal-blue);
}

.badge-pal-green {
    background-color: var(--pal-green);
}

/* Notifications */
.notification-dropdown {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    transition: background-color 0.2s ease;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item:last-child {
    border-bottom: none;
}

/* Breadcrumb */
.breadcrumb-pal {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

.breadcrumb-pal .breadcrumb-item + .breadcrumb-item::before {
    color: var(--pal-blue);
}

/* Cards spécialisées */
.card-header-pal {
    background-color: var(--pal-blue);
    color: white;
    font-weight: 600;
}

.card-stats {
    background: linear-gradient(135deg, var(--pal-blue) 0%, var(--pal-blue-light) 100%);
    color: white;
    border: none;
}

.card-stats .card-body {
    position: relative;
    overflow: hidden;
}

.card-stats .card-body::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

/* Sidebar */
.sidebar {
    background-color: #f8f9fa;
    border-right: 1px solid var(--border-color);
    min-height: 100vh;
}

.sidebar .nav-link {
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: var(--pal-blue);
    color: white;
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
    width: 20px;
    text-align: center;
}

/* Loading spinner */
.spinner-pal {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--pal-blue);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Footer */
footer {
    background-color: #1f2937 !important;
}

footer a {
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--pal-green-light) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-section {
        min-height: 60vh;
        text-align: center;
        padding: 2rem 0;
    }
    
    .hero-section .display-4 {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    .feature-icon i {
        font-size: 2.5rem !important;
    }
    
    .dashboard-stat {
        font-size: 2rem;
    }
    
    /* Navigation mobile améliorée */
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .navbar-brand img {
        height: 35px !important;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
    
    .dropdown-menu {
        border: none;
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
        margin-top: 0.5rem;
    }
    
    .dropdown-item {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Amélioration des boutons pour mobile */
    .btn {
        min-height: 48px;
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
    
    .btn-lg {
        min-height: 56px;
        font-size: 1.1rem;
        padding: 1rem 2rem;
    }
    
    /* Cards plus spacieuses sur mobile */
    .card {
        margin-bottom: 1.5rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    /* Tables responsive */
    .table-responsive {
        border-radius: 0.5rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
}

@media (max-width: 576px) {
    .hero-section .display-4 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .feature-card {
        margin-bottom: 1rem;
    }
    
    .stat-item h3 {
        font-size: 2rem;
    }
    
    /* Navigation ultra-mobile */
    .navbar-brand span {
        font-size: 1rem;
    }
    
    .hero-section .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.75rem;
    }
    
    .hero-section .d-flex {
        flex-direction: column;
    }
    
    /* Formulaires mobile-friendly */
    .form-control {
        min-height: 48px;
        font-size: 16px; /* Empêche le zoom sur iOS */
        padding: 0.75rem 1rem;
    }
    
    .form-label {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    /* Cartes en pleine largeur */
    .feature-card, .dashboard-card {
        margin-bottom: 1.5rem;
    }
    
    /* Espacement tactile amélioré */
    .list-group-item {
        padding: 1rem 1.25rem;
        font-size: 1rem;
    }
    
    /* Notifications optimisées */
    .notification-dropdown {
        max-height: 300px;
        width: 100vw;
        left: 0 !important;
        transform: none !important;
        margin-top: 0.5rem;
        border-radius: 0;
    }
}

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

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

/* Utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shadow-pal {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

.shadow-pal-lg {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #374151;
        border-color: #4b5563;
    }
    
    .table {
        --bs-table-bg: #374151;
        --bs-table-color: #f9fafb;
    }
}
