/**
 * MOBILITY BOOK - Styles CSS
 * 
 * @package MobilityBook
 * @version 1.0
 */

/* ============================================
   VARIABLES
   ============================================ */
:root {
    --primary-color: #0d6efd;
    --primary-dark: #0b5ed7;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --navbar-height: 56px;
    --mobile-nav-height: 60px;
}

/* ============================================
   BASE
   ============================================ */
html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--light-color);
}

/* Contenu principal avec navigation */
.main-content {
    padding-top: calc(var(--navbar-height) + 1rem);
    padding-bottom: calc(var(--mobile-nav-height) + 1rem);
    min-height: 100vh;
}

@media (min-width: 992px) {
    .main-content {
        padding-bottom: 1rem;
    }
}

/* Page sans navigation (login, etc.) */
.main-content-full {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar-brand {
    font-weight: 600;
}

/* Navigation mobile (bottom) */
.mobile-nav {
    border-top: 1px solid #dee2e6;
    padding: 0.5rem 0;
}

.mobile-nav .nav-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: var(--secondary-color);
}

.mobile-nav .nav-link.active {
    color: var(--primary-color);
}

.mobile-nav .nav-link i {
    font-size: 1.25rem;
}

/* Footer pour utilisateurs connectés (avec espace pour nav mobile) */
.footer-logged-in {
    margin-bottom: calc(var(--mobile-nav-height) + 10px);
}

@media (min-width: 992px) {
    .footer-logged-in {
        margin-bottom: 0;
    }
}

/* ============================================
   CARTES
   ============================================ */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1rem;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

/* Widget dashboard */
.widget-card {
    height: 100%;
}

.widget-card .card-body {
    display: flex;
    flex-direction: column;
}

.widget-icon {
    font-size: 2rem;
    opacity: 0.3;
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.widget-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.widget-label {
    color: var(--secondary-color);
    font-size: 0.875rem;
}

/* ============================================
   FORMULAIRES
   ============================================ */
.form-floating > label {
    color: var(--secondary-color);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* Champs grands pour mobile */
@media (max-width: 576px) {
    .form-control,
    .form-select,
    .btn {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
    
    .form-floating > .form-control,
    .form-floating > .form-select {
        height: calc(3.5rem + 2px);
        padding: 1rem 0.75rem;
    }
}

/* ============================================
   BOUTONS
   ============================================ */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

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

/* Bouton flottant (FAB) */
.fab {
    position: fixed;
    bottom: calc(var(--mobile-nav-height) + 1rem);
    right: 1rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 1000;
}

@media (min-width: 992px) {
    .fab {
        bottom: 2rem;
    }
}

/* ============================================
   LISTES
   ============================================ */
.list-item {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.list-item-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.list-item-subtitle {
    color: var(--secondary-color);
    font-size: 0.875rem;
}

.list-item-value {
    text-align: right;
    flex-shrink: 0;
}

.list-item-value-main {
    font-weight: 600;
    font-size: 1.125rem;
}

.list-item-value-sub {
    color: var(--secondary-color);
    font-size: 0.75rem;
}

/* List item avec bouton favori */
.list-item-wrapper {
    margin-bottom: 0.5rem;
}

.list-item-wrapper .list-item {
    margin-bottom: 0;
}

.list-item-wrapper .favorite-btn {
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 0.2s;
}

.list-item-wrapper .favorite-btn:hover {
    transform: scale(1.2);
}

.list-item-wrapper .favorite-btn:focus {
    box-shadow: none;
}

/* ============================================
   PAGE DE LOGIN
   ============================================ */
.login-container {
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo i {
    font-size: 4rem;
    color: var(--primary-color);
}

.login-logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

.login-logo .tagline {
    color: var(--secondary-color);
    font-size: 0.875rem;
}

/* ============================================
   BADGES & LABELS
   ============================================ */
.badge-energy {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.badge-essence { background-color: #ffc107; color: #212529; }
.badge-diesel { background-color: #6c757d; color: white; }
.badge-electrique { background-color: #198754; color: white; }
.badge-e85 { background-color: #0dcaf0; color: #212529; }
.badge-hybride { background-color: #6f42c1; color: white; }

/* ============================================
   GRAPHIQUES
   ============================================ */
.chart-container {
    position: relative;
    height: 200px;
}

@media (min-width: 768px) {
    .chart-container {
        height: 250px;
    }
}

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

.cursor-pointer {
    cursor: pointer;
}

.opacity-50 {
    opacity: 0.5;
}

/* Espacements spéciaux pour mobile */
@media (max-width: 576px) {
    .px-mobile-0 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

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

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

/* ============================================
   PRINT
   ============================================ */
@media print {
    .navbar,
    .mobile-nav,
    .fab,
    .btn {
        display: none !important;
    }
    
    .main-content {
        padding: 0 !important;
    }
}
