/* =========================================
   Vehicle Rental SaaS - Main Stylesheet
   ========================================= */

:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #818cf8;
    --secondary: #0ea5e9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --dark: #1e293b;
    --light: #f8fafc;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --topbar-height: 65px;
    --border-color: #e2e8f0;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --hover-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-info: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: #f1f5f9;
    color: #334155;
    overflow-x: hidden;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 3px; }

/* =========================================
   Sidebar
   ========================================= */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 50%, #3730a3 100%);
    z-index: 1050;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

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

.sidebar-logo {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.2);
}

.sidebar-icon-logo {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.5rem;
    color: #a5b4fc;
}

.sidebar-title {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
}

.sidebar .text-muted {
    color: #a5b4fc !important;
    font-size: 0.75rem;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.sidebar-menu .menu-label {
    color: #818cf8;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 15px 20px 5px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: #c7d2fe;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    gap: 12px;
}

.sidebar-menu li a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-left-color: var(--primary-light);
}

.sidebar-menu li.active a {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-left-color: #818cf8;
    font-weight: 500;
}

.sidebar-menu li a i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
}

.sidebar.collapsed .sidebar-menu li a span,
.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .text-muted,
.sidebar.collapsed .menu-label {
    display: none;
}

/* =========================================
   Topbar
   ========================================= */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1040;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.sidebar.collapsed ~ .main-wrapper .topbar,
.sidebar.collapsed ~ .topbar {
    left: var(--sidebar-collapsed);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.page-title {
    font-weight: 600;
    color: var(--dark);
    font-size: 1.1rem;
}

.avatar-sm {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
    font-weight: 600;
}

.topbar-item .dropdown-toggle::after {
    display: none;
}

/* =========================================
   Main Content Area
   ========================================= */
.main-wrapper {
    margin-left: var(--sidebar-width);
    padding-top: var(--topbar-height);
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed ~ .main-wrapper {
    margin-left: var(--sidebar-collapsed);
}

.main-content {
    padding: 24px;
}

.main-footer {
    background: #fff;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    margin-top: 30px;
}

/* =========================================
   Cards & Widgets
   ========================================= */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}

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

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    font-weight: 600;
}

.stat-card {
    border-radius: 16px;
    padding: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

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

.stat-card::after {
    content: '';
    position: absolute;
    bottom: -20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    opacity: 0.85;
    font-weight: 400;
}

.bg-gradient-primary { background: var(--gradient-primary); }
.bg-gradient-success { background: var(--gradient-success); }
.bg-gradient-warning { background: var(--gradient-warning); }
.bg-gradient-danger { background: var(--gradient-danger); }
.bg-gradient-info { background: var(--gradient-info); }

/* =========================================
   Tables
   ========================================= */
.table-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.table-container .table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    border-bottom: 2px solid var(--border-color);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    padding: 14px 16px;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    font-size: 0.875rem;
    border-bottom: 1px solid #f1f5f9;
}

.table tbody tr:hover {
    background: #f8fafc;
}

/* Status Badges */
.badge-status {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 50px;
    letter-spacing: 0.3px;
}

.badge-available { background: #d1fae5; color: #065f46; }
.badge-rented { background: #dbeafe; color: #1e40af; }
.badge-maintenance { background: #fef3c7; color: #92400e; }
.badge-active { background: #d1fae5; color: #065f46; }
.badge-returned { background: #e0e7ff; color: #3730a3; }
.badge-overdue { background: #fee2e2; color: #991b1b; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-paid { background: #d1fae5; color: #065f46; }
.badge-suspended { background: #fee2e2; color: #991b1b; }

/* =========================================
   Forms
   ========================================= */
.form-control, .form-select {
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    padding: 10px 14px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.form-label {
    font-weight: 500;
    font-size: 0.8rem;
    color: #475569;
    margin-bottom: 4px;
}

.input-group-text {
    border-radius: 8px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    font-size: 0.875rem;
}

/* =========================================
   Buttons
   ========================================= */
.btn {
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 8px 18px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,70,229,0.4);
    background: var(--primary-dark);
}

.btn-success {
    background: var(--gradient-success);
    border: none;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* =========================================
   Auth Pages
   ========================================= */
.auth-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4f46e5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(129,140,248,0.15);
    top: -100px;
    right: -100px;
    animation: float 6s ease-in-out infinite;
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(99,102,241,0.1);
    bottom: -80px;
    left: -80px;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-30px); }
}

.auth-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 450px;
    padding: 40px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease;
}

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

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo i {
    font-size: 2.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-logo h3 {
    font-weight: 800;
    color: var(--dark);
    margin-top: 8px;
}

/* =========================================
   Landing Page
   ========================================= */
.landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    padding: 15px 0;
    transition: all 0.3s ease;
    background: transparent;
}

.landing-nav.scrolled {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.hero-section {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4f46e5 100%);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}

.hero-section::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(129,140,248,0.1);
    top: -150px;
    right: -100px;
    animation: float 8s ease-in-out infinite;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-title span {
    background: linear-gradient(90deg, #818cf8, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    color: #c7d2fe;
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.feature-card {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--hover-shadow);
    border-color: var(--primary-light);
}

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.5rem;
    color: #fff;
}

.pricing-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
}

.pricing-card.popular {
    border-color: var(--primary);
    transform: scale(1.05);
}

.pricing-card.popular::before {
    content: 'POPULAR';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-primary);
    color: #fff;
    padding: 4px 20px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.pricing-price {
    font-size: 3rem;
    font-weight: 800;
    color: var(--dark);
}

/* =========================================
   Print Receipt
   ========================================= */
.receipt-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border: 2px solid #333;
    font-size: 13px;
}

.receipt-header {
    text-align: center;
    border-bottom: 2px solid #333;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.receipt-header h4 {
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.receipt-header .service-hours {
    position: absolute;
    top: 10px;
    right: 15px;
    text-align: right;
    font-size: 11px;
    border: 1px solid #333;
    padding: 5px 10px;
}

.receipt-body .receipt-row {
    display: flex;
    border-bottom: 1px dotted #999;
    padding: 4px 0;
    gap: 10px;
}

.receipt-body .receipt-row label {
    font-weight: 600;
    min-width: 140px;
    white-space: nowrap;
}

.receipt-body .receipt-row span {
    flex: 1;
    border-bottom: 1px dotted #ccc;
}

.receipt-terms {
    margin-top: 15px;
    border-top: 2px solid #333;
    padding-top: 10px;
}

.receipt-terms h6 {
    font-weight: 800;
    text-decoration: underline;
    margin-bottom: 8px;
}

.receipt-terms ol {
    padding-left: 18px;
    font-size: 11px;
}

.receipt-terms ol li {
    margin-bottom: 3px;
}

.receipt-signature {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
}

.signature-box {
    width: 200px;
    text-align: center;
}

.signature-box .sig-line {
    border-bottom: 1px solid #333;
    height: 60px;
    margin-bottom: 5px;
}

/* =========================================
   Animations
   ========================================= */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in-up {
    animation: slideInUp 0.5s ease;
}

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

.scale-in {
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

[data-animate] {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

[data-animate].visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* =========================================
   Toast Notification
   ========================================= */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.custom-toast {
    min-width: 320px;
    padding: 16px 20px;
    border-radius: 12px;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    animation: slideInRight 0.4s ease, fadeOut 0.4s ease 3s forwards;
    margin-bottom: 10px;
}

.custom-toast.toast-success { background: var(--gradient-success); }
.custom-toast.toast-error { background: var(--gradient-danger); }
.custom-toast.toast-warning { background: var(--gradient-warning); }
.custom-toast.toast-info { background: var(--gradient-info); }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateX(100px); }
}

/* =========================================
   Signature Pad
   ========================================= */
.signature-pad-wrapper {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 10px;
    background: #fafafa;
}

.signature-pad-wrapper canvas {
    width: 100%;
    height: 150px;
    border-radius: 8px;
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .topbar {
        left: 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    .receipt-container {
        padding: 15px;
        font-size: 11px;
    }
}

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

.bg-soft-primary { background: rgba(79,70,229,0.1); }
.bg-soft-success { background: rgba(16,185,129,0.1); }
.bg-soft-warning { background: rgba(245,158,11,0.1); }
.bg-soft-danger { background: rgba(239,68,68,0.1); }
.bg-soft-info { background: rgba(6,182,212,0.1); }

.rounded-xl { border-radius: 12px; }
.rounded-2xl { border-radius: 16px; }

.cursor-pointer { cursor: pointer; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.section-padding { padding: 80px 0; }

@media print {
    .sidebar, .topbar, .main-footer, .no-print { display: none !important; }
    .main-wrapper { margin: 0; padding: 0; }
    .main-content { padding: 0; }
    .receipt-container { border: none; box-shadow: none; }
}
