/* assets/css/style.css */

@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&display=swap');

:root {
    --pastel-blue: #BBDEFB;
    --pastel-green: #C8E6C9;
    --pastel-cream: #FFF59D;
    --pastel-pink: #F48FB1;
    --pastel-purple: #CE93D8;
    --dark-grey: #212121;
    --primary-btn: #42A5F5;
    --primary-btn-hover: #1E88E5;
    --sidebar-width: 240px;
    --sidebar-bg: rgba(255, 255, 255, 0.95);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #8f88f1 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Ubuntu', sans-serif;
    background: linear-gradient(135deg, #faf398 0%, #85f3f7 100%);
    background-attachment: fixed;
    color: var(--dark-grey);
    min-height: 100vh;
}



/* Prevent modal flickering and jumping */
body.modal-open {
    overflow: hidden;
    padding-right: 0 !important;
}

.modal {
    overflow-y: auto;
}

body {
    overflow-y: scroll !important;
}



h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--dark-grey);
}

/* ========== SIDEBAR NAVIGATION ========== */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    transform: translateX(-100%);
    /* Start hidden by default */
}

.sidebar.active {
    transform: translateX(0);
}

/* Sidebar Logo Section */
.sidebar-logo {
    padding: 4.5rem 1rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.sidebar-logo img {
    width: 60px;
    height: 60px;
    margin-bottom: 0.25rem;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.sidebar-logo img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.2));
}

.sidebar-logo h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #667eea;
    margin: 0;
}

/* Sidebar Profile Section */
.sidebar-profile {
    background: var(--gradient-primary);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.profile-avatar:hover {
    transform: scale(1.05);
}

.profile-info {
    text-align: left;
    overflow: hidden;
}

.profile-info h4 {
    color: white;
    font-size: 0.95rem;
    margin-bottom: 0;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.role-badge {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-super-admin {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.3);
}

.role-admin {
    background: rgba(244, 67, 54, 0.9);
    color: white;
}

.role-staff {
    background: rgba(33, 150, 243, 0.9);
    color: white;
}

.role-user {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(56, 239, 125, 0.3);
}

/* Guest Welcome */
.sidebar-guest {
    padding: 2rem 1.5rem;
}

.guest-welcome {
    background: var(--gradient-accent);
    padding: 2rem 1.5rem;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 2rem;
}

.guest-welcome h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.guest-welcome p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.75rem;
    color: #555;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 500;
    margin: 0.1rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.nav-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
    transform: translateX(5px);
}

.nav-item:hover svg {
    transform: scale(1.1);
}

.nav-item.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.nav-item.active svg {
    color: white;
}

.nav-item-primary {
    background: var(--gradient-primary);
    color: white !important;
    font-weight: 600;
}

.nav-item-primary:hover {
    transform: translateX(5px) scale(1.02);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* Sidebar Footer & User Menu */
.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.user-badge-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.user-badge-container:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.user-badge-container:active {
    transform: scale(0.98);
}

.username-text {
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
}

.chevron-icon {
    transition: transform 0.3s ease;
    color: white;
    opacity: 0.8;
}

.user-menu-wrapper.active .chevron-icon {
    transform: rotate(180deg);
}

.user-submenu {
    position: absolute;
    bottom: 100%;
    left: 0.75rem;
    right: 0.75rem;
    background: #2d3436;
    /* Dark slate background */
    border-radius: 12px;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.25);
    padding: 0.35rem;
    margin-bottom: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1010;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-submenu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none !important;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.submenu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.submenu-item.text-danger {
    color: #ff7675 !important;
}

.submenu-item.text-danger:hover {
    background: rgba(214, 48, 49, 0.2);
    color: #ff7675 !important;
}

.submenu-item svg {
    opacity: 0.8;
}

.submenu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.25rem 0.4rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    position: fixed;
    top: 1rem;
    left: 1.5rem;
    z-index: 1001;
    width: 50px;
    height: 50px;
    background: white;
    border: none;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 3px;
    background: #667eea;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========== MAIN CONTENT ========== */

.main-content {
    margin-left: 0;
    min-height: 100vh;
    padding: 1rem 5rem;
    /* 2rem top/bottom, 5rem left/right */
    padding-top: 1rem;
    transition: margin-left 0.3s ease;
}

.main-content.sidebar-collapsed {
    margin-left: 0;
}

/* ========== CARDS ========== */

.card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

/* ========== BUTTONS ========== */

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-weight: 600;
    color: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-weight: 600;
    color: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(56, 239, 125, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 239, 125, 0.4);
}

.btn-outline-secondary {
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 20px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

/* ========== FORMS ========== */

.form-control,
.form-select {
    border-radius: 12px;
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    padding: 8px 12px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
    background-color: #ffffff;
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

/* ========== HERO SECTION ========== */

.hero-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    padding: 40px 0;
    /* Reduced from 100px to 40px for top/bottom */
    border-radius: 30px;
    margin-bottom: 3rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.hero-section h1 {
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-section .lead {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* ========== TABLES ========== */

.table {
    border-radius: 12px;
    overflow: hidden;
}

.table th {
    font-weight: 600;
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    border: none;
    padding: 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-color: rgba(0, 0, 0, 0.05);
}

.table-hover tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* ========== BADGES ========== */

.badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.85rem;
}

/* ========== FOOTER ========== */

.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    margin-top: 3rem;
    border-radius: 30px 30px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

/* ========== RESPONSIVE DESIGN ========== */

@media (min-width: 1025px) {

    .sidebar.active~.main-content {
        margin-left: var(--sidebar-width);
    }

    .main-content {
        padding-top: 1.5rem;
    }

    .sidebar-overlay {
        display: none;
    }
}

@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
        padding-top: 5rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0;
        border-radius: 20px;
    }

    .main-content {
        padding: 1rem;
    }

    .card {
        border-radius: 15px;
    }

    .sidebar-profile {
        padding: 1.5rem 1rem;
    }

    .profile-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .profile-info h4 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .mobile-menu-toggle {
        width: 45px;
        height: 45px;
        top: 1rem;
        left: 1rem;
    }

    .btn-primary,
    .btn-success {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* Webcam Section Styles */
.webcam-section {
    max-width: 450px;
    margin: 20px auto;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fafafa;
    box-shadow: 0 4px 8px rgb(0 0 0 / 0.1);
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.video-wrapper {
    position: relative;
    border: 2px solid #007bff;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    width: 100%;
    max-width: 300px;
    height: 400px;
    /* Passport size ratio 3:4 */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    margin-left: auto;
    margin-right: auto;
}

#webcamVideo,
#capturedPhoto {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    position: absolute;
    top: 0;
    left: 0;
}

.webcam-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.webcam-controls button {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 6px rgb(0 123 255 / 0.4);
}

.webcam-controls button:disabled {
    background: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
}

.webcam-controls button:not(:disabled):hover {
    background-color: #0056b3;
}

#capturedPhotoContainer {
    margin-top: 4px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
}

.captured-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    position: absolute;
    top: 0;
    left: 0;
}

.capture-status {
    margin-top: 8px;
    font-weight: 600;
    color: #28a745;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Circular User Avatar in Navbar/Sidebar */
.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 24px;
    font-weight: bold;
    margin: 0 auto 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Floating Dashboard Button */
.fab-dashboard {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    transition: all 0.3s ease;
    text-decoration: none;
}

.fab-dashboard:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    color: white;
}

.fab-dashboard svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

@media (max-width: 768px) {
    .fab-dashboard {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}