/* ============================================
   MedCab Pro - Styles Principaux
   ============================================ */

:root {
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --primary-light: #6ea8fe;
    --secondary: #6c757d;
    --success: #198754;
    --info: #0dcaf0;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f8f9fa;
    --dark: #212529;
    --white: #ffffff;
    
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-info: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);
    --gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    
    --border-radius: 0.5rem;
    --border-radius-lg: 1rem;
    --border-radius-xl: 1.5rem;
    
    --font-primary: 'Inter', sans-serif;
    --font-heading: 'Poppins', sans-serif;
    
    --sidebar-width: 280px;
    --header-height: 70px;
}

/* ============================================
   Base Styles
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--dark);
    background-color: #f5f7fb;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
}

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

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Navbar Public
   ============================================ */

.navbar {
    padding: 0.75rem 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: var(--shadow);
}

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

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon i {
    color: white !important;
    font-size: 1.2rem;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    color: var(--dark) !important;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* ============================================
   Hero Section
   ============================================ */

.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,133.3C672,139,768,181,864,181.3C960,181,1056,139,1152,122.7C1248,107,1344,117,1392,122.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-position: bottom;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
}

.hero-image {
    position: relative;
    z-index: 2;
}

.hero-image img {
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   Cards
   ============================================ */

.card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.card-icon {
    width: 70px;
    height: 70px;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.card-icon.primary { background: rgba(13, 110, 253, 0.1); color: var(--primary); }
.card-icon.success { background: rgba(25, 135, 84, 0.1); color: var(--success); }
.card-icon.info { background: rgba(13, 202, 240, 0.1); color: var(--info); }
.card-icon.warning { background: rgba(255, 193, 7, 0.1); color: var(--warning); }
.card-icon.danger { background: rgba(220, 53, 69, 0.1); color: var(--danger); }

/* Service Card */
.service-card {
    padding: 2rem;
    text-align: center;
    background: white;
    border-radius: var(--border-radius-lg);
}

.service-card:hover {
    background: var(--gradient-primary);
}

.service-card:hover * {
    color: white !important;
}

.service-card:hover .card-icon {
    background: rgba(255, 255, 255, 0.2);
}

/* Doctor Card */
.doctor-card {
    overflow: hidden;
}

.doctor-card .card-img-top {
    height: 280px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.doctor-card:hover .card-img-top {
    transform: scale(1.05);
}

.doctor-card .card-body {
    padding: 1.5rem;
}

.doctor-specialty {
    color: var(--primary);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Stat Card */
.stat-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1rem;
}

.stat-icon.bg-primary-light { background: rgba(13, 110, 253, 0.1); color: var(--primary); }
.stat-icon.bg-success-light { background: rgba(25, 135, 84, 0.1); color: var(--success); }
.stat-icon.bg-warning-light { background: rgba(255, 193, 7, 0.1); color: var(--warning); }
.stat-icon.bg-info-light { background: rgba(13, 202, 240, 0.1); color: var(--info); }
.stat-icon.bg-danger-light { background: rgba(220, 53, 69, 0.1); color: var(--danger); }

.stat-content h3 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: var(--secondary);
    margin: 0;
    font-size: 0.9rem;
}

/* ============================================
   Section Styles
   ============================================ */

.section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
}

.section-subtitle {
    color: var(--secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.section-header {
    margin-bottom: 3rem;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
}

.btn-gradient {
    background: var(--gradient-primary);
    border: none;
    color: white;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white;
}

/* ============================================
   Forms
   ============================================ */

.form-control,
.form-select {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
    font-size: 0.95rem;
}

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

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.input-group-text {
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

/* ============================================
   Footer
   ============================================ */

.footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: #adb5bd;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.footer-contact li {
    color: #adb5bd;
}

/* ============================================
   Dashboard Layout
   ============================================ */

.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e3a5f 0%, #0d1b2a 100%);
    height: 100vh;
    max-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.sidebar-brand .logo-icon {
    width: 40px;
    height: 40px;
    margin-right: 0.75rem;
}

.sidebar-menu {
    padding: 1rem 0;
}

.sidebar-menu .menu-header {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1rem 1.5rem 0.5rem;
}

.sidebar-menu .menu-item {
    display: block;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-menu .menu-item i {
    width: 24px;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.sidebar-menu .menu-item:hover,
.sidebar-menu .menu-item.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary);
}

.sidebar-menu .menu-item.active {
    background: rgba(13, 110, 253, 0.2);
}

/* Scrollbar personnalisée pour la sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: all 0.3s ease;
}

/* Top Header */
.top-header {
    height: var(--header-height);
    background: white;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-search {
    position: relative;
    width: 300px;
}

.header-search input {
    padding-left: 2.5rem;
    border-radius: 50px;
    border: 1px solid #e9ecef;
    background: #f8f9fa;
}

.header-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.notification-dropdown .dropdown-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    background: transparent;
    border: none;
}

.user-dropdown .dropdown-toggle::after {
    display: none;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e9ecef;
}

.user-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-info {
    text-align: left;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark);
}

.user-role {
    font-size: 0.75rem;
    color: var(--secondary);
}

/* Page Content */
.page-content {
    padding: 1.5rem;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item a {
    color: var(--secondary);
}

.breadcrumb-item.active {
    color: var(--primary);
}

/* ============================================
   Calendar Styles
   ============================================ */

.fc {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1rem;
}

.fc .fc-toolbar-title {
    font-size: 1.25rem;
    font-weight: 600;
}

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

.fc .fc-button-primary:not(:disabled):active,
.fc .fc-button-primary:not(:disabled).fc-button-active {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.fc-event {
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 0.85rem;
    cursor: pointer;
}

.fc-timegrid-event {
    border-left-width: 3px !important;
}

/* ============================================
   Tables
   ============================================ */

.table-container {
    background: white;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: #f8f9fa;
}

/* ============================================
   Status Badges
   ============================================ */

.badge {
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    font-size: 0.8rem;
    border-radius: 50px;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge.bg-pending { background: rgba(255, 193, 7, 0.15) !important; color: #997404; }
.badge.bg-confirmed { background: rgba(25, 135, 84, 0.15) !important; color: #146c43; }
.badge.bg-cancelled { background: rgba(220, 53, 69, 0.15) !important; color: #b02a37; }
.badge.bg-completed { background: rgba(13, 202, 240, 0.15) !important; color: #087990; }
.badge.bg-absent { background: rgba(108, 117, 125, 0.15) !important; color: #495057; }

/* ============================================
   Login / Register
   ============================================ */

.auth-page {
    min-height: 100vh;
    display: flex;
}

.auth-sidebar {
    width: 45%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
}

.auth-sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/><circle cx="50" cy="50" r="30" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></svg>');
    opacity: 0.5;
}

.auth-sidebar-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: white;
}

.auth-form {
    width: 100%;
    max-width: 420px;
}

.auth-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--secondary);
    margin-bottom: 2rem;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .auth-sidebar {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        min-height: auto;
        padding: 5rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .section {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .header-search {
        display: none;
    }
}

/* ============================================
   Utilities
   ============================================ */

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary { background: var(--gradient-primary) !important; }
.bg-gradient-success { background: var(--gradient-success) !important; }
.bg-gradient-info { background: var(--gradient-info) !important; }

.rounded-xl { border-radius: var(--border-radius-xl) !important; }

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    width: 100px;
    height: 100px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--secondary);
    margin: 0 auto 1.5rem;
}

/* Waiting Room */
.waiting-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
}

.waiting-item:hover {
    box-shadow: var(--shadow);
}

.waiting-item.called {
    border-left-color: var(--success);
    background: rgba(25, 135, 84, 0.05);
}

/* Appointment Timeline */
.appointment-timeline {
    position: relative;
    padding-left: 2rem;
}

.appointment-timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.65rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--primary);
}

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

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Print Styles */
@media print {
    .sidebar,
    .top-header,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .page-content {
        padding: 0;
    }
}
