/**
 * KEMUDIKU - Custom Styles
 */

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #10b981;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --gradient-secondary: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Base */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--light-color);
    color: #334155;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

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

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

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

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.card-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.25rem;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Forms */
.form-control,
.form-select {
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    padding: 0.625rem 1rem;
    transition: all 0.2s;
}

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

.form-label {
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.375rem;
}

.input-group-text {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px 0 0 8px;
}

.input-group .form-control {
    border-left: none;
    border-radius: 0 8px 8px 0;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: #475569;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 0.875rem 1rem;
    border-bottom-width: 2px;
}

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

.table-hover tbody tr:hover {
    background-color: rgba(79, 70, 229, 0.04);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.375em 0.75em;
    border-radius: 6px;
}

.bg-success-subtle {
    background-color: rgba(16, 185, 129, 0.1);
}

.bg-warning-subtle {
    background-color: rgba(251, 191, 36, 0.1);
}

.bg-danger-subtle {
    background-color: rgba(239, 68, 68, 0.1);
}

.bg-primary-subtle {
    background-color: rgba(79, 70, 229, 0.1);
}

/* Driver Card */
.driver-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
}

.driver-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.driver-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

.rating-badge {
    background: var(--gradient-secondary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.skill-tag {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Pagination */
.pagination {
    gap: 0.25rem;
}

.page-link {
    border-radius: 8px;
    border: none;
    color: #64748b;
    padding: 0.5rem 0.875rem;
    transition: all 0.2s;
}

.page-link:hover {
    background: var(--primary-color);
    color: white;
}

.page-item.active .page-link {
    background: var(--primary-color);
    color: white;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 10px;
}

/* Progress */
.progress {
    border-radius: 10px;
    background-color: #e2e8f0;
}

.progress-bar {
    border-radius: 10px;
}

/* Dropdown */
.dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background-color: rgba(79, 70, 229, 0.08);
}

/* Modal */
.modal-content {
    border: none;
    border-radius: 16px;
}

.modal-header {
    border-bottom: 1px solid #e2e8f0;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
}

/* Navbar */
.navbar {
    padding: 0.75rem 0;
}

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

.nav-link {
    font-weight: 500;
    color: #64748b;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.08);
}

/* Hero Section */
.hero-section {
    background: var(--gradient-primary);
    min-height: 80vh;
    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 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive & Mobile Shell */
@media (max-width: 768px) {
    .stat-card {
        padding: 1rem;
    }

    .driver-card .card-img-top {
        height: 160px;
    }

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

    .pb-mobile-nav {
        padding-bottom: 80px !important;
    }

    /* Hide Desktop Nav elements in Mobile */
    .navbar-collapse {
        background: white;
        padding: 1rem;
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        margin-top: 10px;
    }
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.2s ease;
    flex: 1;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

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

/* PWA Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: 80px;
    left: 15px;
    right: 15px;
    background: white;
    padding: 1rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1100;
    border: 1px solid rgba(79, 70, 229, 0.1);
}

.smaller {
    font-size: 0.75rem;
}

/* Sticky Mobile CTA */
@media (max-width: 768px) {
    .sticky-mobile-cta {
        position: fixed;
        bottom: 65px;
        left: 0;
        right: 0;
        padding: 1rem;
        background: white;
        border-top: 1px solid #eee;
        z-index: 900;
    }
}

/* SOS Panic Button */
.sos-btn-float {
    position: fixed;
    right: 25px;
    bottom: 90px;
    width: 60px;
    height: 60px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
    z-index: 1050;
    cursor: pointer;
    border: 4px solid white;
    font-weight: 800;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pulse-red 2s infinite;
}

.sos-btn-float:hover {
    transform: scale(1.1);
    background: #dc2626;
}

@keyframes pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.active-sos {
    animation: blink-red 0.5s infinite !important;
}

@keyframes blink-red {
    50% {
        opacity: 0.5;
        background: black;
    }
}

/* Adjust SOS position for mobile nav */
@media (max-width: 768px) {
    .sos-btn-float {
        bottom: 140px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 0.75rem;
    }
}

/* Utility Classes */
.filter-white {
    filter: brightness(0) invert(1);
}