@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #10b981;
    --primary-hover: #059669;
    --secondary-color: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --bg-light: #f1f5f9;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --card-radius: 12px;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    overflow-x: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

a, img, button, .nav-link {
    -webkit-touch-callout: none !important;
    -webkit-user-drag: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 8px;
    padding: 10px 24px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.card {
    border: none;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    background-color: var(--white);
    margin-bottom: 1.5rem;
}

.sidebar {
    min-height: 100vh;
    background-color: var(--white);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
}

.sidebar .nav-link {
    color: var(--text-muted);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--primary-color);
}

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

.stat-card {
    padding: 1.5rem;
}

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

.bg-green-soft {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--primary-color);
}

#tour-profile {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}

.navbar {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
}

.rounded-lg {
    border-radius: var(--card-radius);
}

.table thead th {
    background-color: var(--bg-light);
    border-bottom: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 1rem;
}

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

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--primary-color);
    border: none;
}

.auth-card {
    max-width: 450px;
    width: 100%;
    margin: auto;
}

.auth-logo {
    max-height: 80px;
    width: auto;
    transition: all 0.3s ease;
}

.landing-hero {
    padding: 100px 0;
    background-color: var(--white);
}

.hero-title {
    font-weight: 800;
    font-size: 3.5rem;
    line-height: 1.2;
    color: var(--text-main);
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.text-primary-color {
    color: var(--primary-color);
}

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 1000;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    html {
        font-size: 85%;
    }

    .sidebar {
        display: none !important;
    }
    
    main {
        margin-left: 0 !important;
        padding-bottom: 80px !important;
        width: 100% !important;
    }

    h1, h2, h3, h4, h5, h6 {
        font-weight: 600 !important;
        letter-spacing: -0.02em;
    }

    h3 { font-size: 1.4rem !important; }
    h4 { font-size: 1.2rem !important; }
    h5 { font-size: 1rem !important; }
    h6 { font-size: 0.9rem !important; }
    p, span, div, td, th { font-size: 0.85rem !important; }
    small { font-size: 0.7rem !important; }
    
    .auth-logo {
        max-height: 55px !important;
    }
    
    .bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
    
    .bottom-nav a {
        text-decoration: none;
        color: var(--text-muted);
        font-size: 0.6rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        transition: all 0.2s;
        flex: 1;
    }
    
    .bottom-nav a.active {
        color: var(--primary-color);
    }
    
    .bottom-nav i {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }
    
    .navbar-toggler {
        display: none !important;
    }
    
    header.navbar h5 {
        font-size: 1rem;
        margin-left: 0 !important;
    }
    
    .card {
        padding: 1rem !important;
        margin-bottom: 0.75rem;
        border-radius: 12px !important;
    }

    .card h3 {
        font-size: 1.25rem !important;
    }

    .card h6 {
        font-size: 0.8rem !important;
    }

    #tour-profile {
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    #tour-profile i {
        font-size: 1.2rem !important;
    }

    .btn {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
    }

    .btn-primary, .btn-outline-primary {
        border-radius: 10px !important;
    }

    .dropdown-toggle::after {
        display: none !important;
    }
    .table thead {
        display: none;
    }
    
    .table tbody tr {
        display: block;
        margin-bottom: 1.5rem;
        padding: 1.25rem;
        background: var(--white);
        border: 1px solid var(--border-color);
        border-radius: 16px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    }
    
    .table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        text-align: right;
        padding: 0.75rem 0 !important;
        position: relative;
        border-bottom: 1px solid #f1f5f9;
    }
    
    .table tbody td:last-child {
        border-bottom: none;
    }
    
    .table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.8rem;
    }

    .form-check {
        padding-left: 2rem !important;
    }

    .form-check-input {
        margin-top: 0.125rem !important;
        width: 1.15rem;
        height: 1.15rem;
    }

    .table tbody td[data-label="Pilih"] {
        justify-content: flex-start !important;
        padding-top: 0 !important;
        padding-bottom: 1rem !important;
        border-bottom: 1px solid #f1f5f9 !important;
    }

    .table tbody td[data-label="Pilih"]::before {
        margin-right: 1.5rem;
    }

    .type-card {
        border: 2px solid #f1f5f9 !important;
        transition: all 0.2s ease;
    }

    .type-radio:checked + .type-card {
        border-color: var(--primary-color) !important;
        background-color: rgba(16, 185, 129, 0.05) !important;
    }

    .select-all-bar {
        background: #f8fafc;
        border: 1px solid var(--border-color);
        padding: 10px 16px;
        border-radius: 12px;
        cursor: pointer;
    }

    .table tbody td[data-label="Pilih"] {
        justify-content: space-between !important;
        border-bottom: 1px solid #f1f5f9 !important;
    }
}

.cursor-pointer { cursor: pointer; }
.type-radio { display: none; }
.type-card { border: 2px solid #f1f5f9; border-radius: 12px; }
.type-radio:checked + .type-card { border-color: var(--primary-color); background-color: rgba(16, 185, 129, 0.05); }

/* Skeleton Loading Animation */
@keyframes shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}

.skeleton {
    background: #f6f7f8;
    background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-repeat: no-repeat;
    background-size: 800px 104px;
    display: inline-block;
    position: relative;
    animation: shimmer 1.5s infinite linear;
    border-radius: 4px;
}

#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    padding: 2rem;
}

.skeleton-header { height: 60px; width: 100%; margin-bottom: 2rem; border-radius: 12px; }
.skeleton-sidebar { width: 250px; height: 100%; margin-right: 2rem; border-radius: 12px; }
.skeleton-content { flex-grow: 1; height: 100%; border-radius: 12px; }
.skeleton-row { height: 40px; width: 100%; margin-bottom: 1rem; border-radius: 8px; }
.skeleton-circle { width: 50px; height: 50px; border-radius: 50%; margin-right: 1rem; }
.skeleton-line { height: 15px; width: 100%; margin-bottom: 8px; border-radius: 4px; }

/* Custom Driver.js Styling */
.driver-popover {
    font-family: 'Poppins', sans-serif !important;
    border-radius: 20px !important;
    padding: 20px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
    border: none !important;
}

.driver-popover-title {
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    color: var(--text-main) !important;
    margin-bottom: 8px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.driver-popover-description {
    font-size: 0.9rem !important;
    color: var(--text-muted) !important;
    line-height: 1.6 !important;
}

.driver-popover-footer {
    margin-top: 15px !important;
}

.driver-popover-btn {
    font-family: 'Poppins', sans-serif !important;
    border-radius: 10px !important;
    padding: 6px 15px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    text-shadow: none !important;
}

.driver-popover-btn-next {
    background-color: var(--primary-color) !important;
    color: white !important;
    border: 1px solid var(--primary-color) !important;
}

.driver-popover-btn-next:hover {
    background-color: var(--primary-hover) !important;
}

.driver-popover-progress-text {
    font-size: 0.8rem !important;
    color: var(--text-muted) !important;
}

.driver-popover svg {
    width: 16px !important;
    height: 16px !important;
    display: inline-block !important;
}

/* Face Capture Styling */
.face-capture-wrapper {
    text-align: center;
    margin-bottom: 1.5rem;
}
.face-capture-container {
    width: 140px;
    height: 140px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #f1f1f1;
    position: relative;
    background: #000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
.face-capture-container.active {
    border-color: #28a745;
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.4);
}
.face-capture-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.face-capture-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 60%, rgba(0,0,0,0.2));
    pointer-events: none;
}
.scanning-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #28a745;
    box-shadow: 0 0 10px #28a745;
    animation: scan 2s linear infinite;
    z-index: 10;
    display: none;
}
@keyframes scan {
    0% { top: 0; }
    100% { top: 100%; }
}
.face-capture-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
    font-weight: 500;
}
#face-canvas {
    display: none;
}

.driver-popover-arrow {
    display: none !important;
}
