/* ===== GLOBAL STYLES ===== */
:root {
    --sidebar-width: 250px;
    --primary-color: #0d6efd;
    --dark-bg: #212529;
    --light-gray: #f8f9fa;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--light-gray);
}

/* ===== SIDEBAR NAVIGATION ===== */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    background-color: var(--dark-bg);
}

.sidebar .nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
    color: #ffffff;
    background-color: rgba(13, 110, 253, 0.2);
    border-left-color: var(--primary-color);
}

.sidebar .nav-link i {
    font-size: 1.1rem;
}

/* ===== MAIN CONTENT AREA ===== */
main {
    padding-top: 1rem;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

/* ===== CARDS & TILES ===== */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.voyage-card {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.voyage-card .card-img-top {
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 100%;
}

.voyage-card .badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
}

/* Status badge colors */
.badge.status-réservé {
    background-color: #6c757d;
}

.badge.status-confirmé {
    background-color: #0d6efd;
}

.badge.status-en-cours {
    background-color: #ffc107;
}

.badge.status-terminé {
    background-color: #198754;
}

/* ===== TABLES ===== */
.table-responsive {
    border-radius: 0.5rem;
    background: white;
    padding: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.table thead {
    background-color: var(--light-gray);
}

/* ===== CALENDAR STYLES ===== */
#calendar {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.fc-event {
    cursor: pointer;
}

.fc-event-voyage {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.fc-event-paiement {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
}

/* ===== MODALS ===== */
.modal-content {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    background-color: var(--primary-color);
    color: white;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

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

/* ===== BUTTONS ===== */
.btn {
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.15);
}

/* ===== KPI CARDS ===== */
.bg-primary,
.bg-success,
.bg-warning,
.bg-info {
    border: none;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.bg-warning {
    color: #000 !important;
}

.bg-warning h3,
.bg-warning h6 {
    color: #000 !important;
}

/* ===== CHARTS ===== */
canvas {
    max-height: 300px;
}

/* ===== EMAIL PREVIEW ===== */
#emailPreview {
    background-color: var(--light-gray);
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1.5rem;
    min-height: 300px;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .sidebar {
        position: relative;
        height: auto;
    }

    .sidebar .nav {
        flex-direction: row;
        overflow-x: auto;
    }

    .sidebar .nav-link {
        white-space: nowrap;
        padding: 0.75rem 1rem;
    }

    main {
        margin-left: 0;
    }

    .voyage-card .card-img-top {
        height: 150px;
    }

    .table-responsive {
        font-size: 0.875rem;
    }
}

/* ===== UTILITIES ===== */
.cursor-pointer {
    cursor: pointer;
}

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

.border-bottom {
    border-bottom: 2px solid #e9ecef !important;
}

/* ===== LOADING SPINNER ===== */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ===== CLIENT CARDS ===== */
.client-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.client-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.client-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: white;
    margin: 0 auto 1rem;
    text-transform: uppercase;
    object-fit: cover;
}

.client-avatar.bg-avatar-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.client-avatar.bg-avatar-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.client-avatar.bg-avatar-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.client-avatar.bg-avatar-4 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.client-avatar.bg-avatar-5 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.client-avatar.bg-avatar-6 { background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); }
.client-avatar.bg-avatar-7 { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.client-avatar.bg-avatar-8 { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }

.client-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.client-card .card-text {
    font-size: 0.875rem;
    color: #6c757d;
}

/* ===== CLIENT DETAIL VIEW ===== */
#clientDetailView .client-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

#clientDetailView .client-header-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    text-transform: uppercase;
    border: 4px solid white;
    object-fit: cover;
}

.client-detail-section {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
}

.client-voyage-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.client-voyage-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.client-voyage-card .card-img-top {
    height: 150px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 100%;
}

/* ===== FLOATING ACTION BUTTONS ===== */
.fab-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.fab-main {
    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;
    transition: all 0.3s ease;
    border: none;
}

.fab-main:hover {
    transform: rotate(45deg) scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.fab-main.active {
    transform: rotate(45deg);
}

.fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.fab-menu.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.fab-option {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    border: none;
}

.fab-option:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* ===== PRINT STYLES ===== */
@media print {
    .sidebar,
    .btn,
    .border-bottom {
        display: none !important;
    }

    main {
        margin-left: 0 !important;
    }

    .card {
        break-inside: avoid;
    }
}
