/* Service Request Management System - Custom Styles */

:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --success-color: #06d6a0;
    --warning-color: #ffd166;
    --danger-color: #ef476f;
    --dark-color: #1a1a2e;
    --light-color: #f8f9fa;
    --sidebar-width: 260px;
    --header-height: 70px;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f2f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar Styles */
.navbar-custom {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 15px 0;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.navbar-custom .navbar-brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-custom .navbar-brand i {
    margin-right: 10px;
}

.navbar-custom .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 8px 16px;
    margin: 0 5px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.navbar-custom .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff !important;
}

.navbar-custom .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 120px 0 100px;
    color: #fff;
    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.05" d="M0,192L48,197.3C96,203,192,213,288,229.3C384,245,480,267,576,250.7C672,235,768,181,864,181.3C960,181,1056,235,1152,234.7C1248,235,1344,181,1392,154.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-section h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Feature Cards */
.feature-card {
    background: #fff;
    border-radius: 15px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.feature-card .icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
}

.feature-card .icon i {
    font-size: 2rem;
    color: #fff;
}

.feature-card h4 {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.feature-card p {
    color: #6c757d;
}

/* About Section */
.about-section {
    padding: 100px 0;
    background: #fff;
}

.about-section h2 {
    font-weight: 700;
    color: var(--dark-color);
}

.about-section .lead {
    color: #6c757d;
}

/* Login Cards */
.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.login-card h3 {
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 30px;
}

.login-card .form-control {
    padding: 12px 20px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    font-size: 1rem;
}

.login-card .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.15);
}

.login-card .btn-primary {
    padding: 12px 30px;
    border-radius: 10px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
}

.login-card .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(67, 97, 238, 0.4);
}

/* Google Sign-In Button */
.btn-google {
    background: #fff;
    color: #333;
    border: 2px solid #e9ecef;
    padding: 12px 30px;
    border-radius: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #ddd;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.btn-google img {
    width: 24px;
    height: 24px;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: linear-gradient(180deg, var(--dark-color) 0%, #16213e 100%);
    z-index: 1000;
    padding-top: 20px;
    overflow-y: auto;
}

.sidebar .brand {
    padding: 20px 25px;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.sidebar .brand i {
    margin-right: 10px;
    color: var(--accent-color);
}

.sidebar .user-info {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.sidebar .user-info img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid var(--accent-color);
}

.sidebar .user-info h6 {
    color: #fff;
    margin-top: 10px;
    margin-bottom: 5px;
    font-weight: 600;
}

.sidebar .user-info small {
    color: rgba(255, 255, 255, 0.6);
}

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

.sidebar .nav-menu li {
    margin: 5px 15px;
}

.sidebar .nav-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.sidebar .nav-menu a i {
    width: 25px;
    margin-right: 12px;
    font-size: 1.1rem;
}

.sidebar .nav-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar .nav-menu a.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: #fff;
}

.sidebar .nav-menu .menu-header {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 20px 10px;
    font-weight: 600;
}

/* Main Content */
/*.main-content {*/
/*    margin-left: var(--sidebar-width);*/
/*    padding: 30px;*/
    /* let main-content grow so footer stays at bottom */
/*    flex: 1 1 auto;*/
/*    position: relative;*/
/*    z-index: 1;*/
/*    padding-bottom: 100px;*/
    /* allow flex child to shrink/grow properly and enable internal scrolling */
/*    min-height: 0;*/
/*    overflow: auto;*/
/*}*/

/*.main-content .page-header {*/
/*    margin-bottom: 30px;*/
/*}*/

/*.main-content .page-header h2 {*/
/*    font-weight: 700;*/
/*    color: var(--dark-color);*/
/*    margin-bottom: 5px;*/
/*}*/

/*.main-content .page-header p {*/
/*    color: #6c757d;*/
/*}*/
/* FIX MODAL NOT OPENING IN ADMIN */
.main-content,
.dashboard-card {
    overflow: visible !important;
}

/* Ensure modal is above sidebar */
.modal {
    z-index: 1055 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
}

/* Center modal properly with sidebar layout */
.modal-dialog {
    margin: 1.75rem auto;
}


/* Dashboard Cards */
.dashboard-card {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    height: 100%;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.stat-card {
    display: flex;
    align-items: center;
}

.stat-card .icon {
    width: 70px;
    height: 70px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
}

.stat-card .icon i {
    font-size: 1.8rem;
    color: #fff;
}

.stat-card .icon.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
}

.stat-card .icon.bg-success {
    background: linear-gradient(135deg, #06d6a0 0%, #00b894 100%);
}

.stat-card .icon.bg-warning {
    background: linear-gradient(135deg, #ffd166 0%, #f9a826 100%);
}

.stat-card .icon.bg-danger {
    background: linear-gradient(135deg, #ef476f 0%, #d63384 100%);
}

.stat-card .icon.bg-info {
    background: linear-gradient(135deg, #4895ef 0%, #3a7bc8 100%);
}

.stat-card .stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--dark-color);
}

.stat-card .stat-info p {
    color: #6c757d;
    margin: 0;
}

/* Data Tables */
.table-card {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.table-card .card-header {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 20px 25px;
}

.table-card .card-header h5 {
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.table-card .table {
    margin: 0;
}

.table-card .table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--dark-color);
    border: none;
    padding: 15px 20px;
}

.table-card .table td {
    padding: 15px 20px;
    vertical-align: middle;
    border-color: #f0f2f5;
}

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

/* Status Badges */
.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.8rem;
}

.bg-orange {
    background-color: #fd7e14 !important;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

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

.timeline-item {
    position: relative;
    padding-bottom: 25px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px var(--primary-color);
}

.timeline-item.completed::before {
    background: var(--success-color);
    box-shadow: 0 0 0 3px var(--success-color);
}

.timeline-item.pending::before {
    background: var(--warning-color);
    box-shadow: 0 0 0 3px var(--warning-color);
}

.timeline-item .timeline-date {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.timeline-item .timeline-content {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 10px;
}

.timeline-item .timeline-content h6 {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.timeline-item .timeline-content p {
    margin: 0;
    color: #6c757d;
}

/* Forms */
.form-group label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.form-control,
.form-select {
    padding: 12px 16px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

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

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 500;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #06d6a0 0%, #00b894 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #ef476f 0%, #d63384 100%);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, #ffd166 0%, #f9a826 100%);
    border: none;
    color: #333;
}

.btn-info {
    background: linear-gradient(135deg, #4895ef 0%, #3a7bc8 100%);
    border: none;
}

/* Action Buttons */
.btn-action {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 2px;
}

/* Footer */
/* Footer base */
.footer {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #ffffff;
    padding: 60px 0 30px;
    position: relative;
    width: 100%;
}

/* Footer links */
.footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* SOCIAL ICONS */
.footer .social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    margin-right: 8px;
    transition: all 0.3s ease;
}

.footer .social-links a:hover {
    background: #4361ee;
    color: #fff;
}

/* ===============================
   FOOTER WITH SIDEBAR (KEY FIX)
================================ */
.footer-with-sidebar {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}

/* Mobile view: sidebar collapses */
@media (max-width: 991px) {
    .footer-with-sidebar {
        margin-left: 0;
        width: 100%;
    }
}


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

.alert-success {
    background: rgba(6, 214, 160, 0.15);
    color: #00855a;
}

.alert-danger {
    background: rgba(239, 71, 111, 0.15);
    color: #c92a52;
}

.alert-warning {
    background: rgba(255, 209, 102, 0.3);
    color: #856404;
}

.alert-info {
    background: rgba(72, 149, 239, 0.15);
    color: #0c5aa6;
}

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

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 20px 25px;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 15px 25px;
}

/* Image Preview */
.image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* Request Card */
.request-card {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    overflow: hidden;
}

.request-card .card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: #fff;
    padding: 20px 25px;
}

.request-card .card-body {
    padding: 25px;
}

/* Responsive */
@media (max-width: 991px) {
    .sidebar {
        width: 80px;
    }

    .sidebar .brand span,
    .sidebar .user-info h6,
    .sidebar .user-info small,
    .sidebar .nav-menu .menu-header,
    .sidebar .nav-menu a span {
        display: none;
    }

    .sidebar .brand {
        text-align: center;
    }

    .sidebar .user-info {
        text-align: center;
    }

    .sidebar .nav-menu a {
        justify-content: center;
    }

    .sidebar .nav-menu a i {
        margin-right: 0;
    }

    .main-content {
        margin-left: 80px;
    }
}

@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }

    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }
}

/* Ensure offcanvas toggle button is visible and not hidden behind navbar on small screens */
@media (max-width: 767.98px) {
    button[data-bs-toggle="offcanvas"] {
        z-index: 1105 !important;
        top: calc(var(--header-height) + 12px) !important;
        left: 12px !important;
    }

    /* Make sure offcanvas appears above everything */
    .offcanvas {
        z-index: 1110 !important;
    }
}

/* Constrain right-column sidebar cards on large screens so they don't stretch the page
   and become excessively long (each card can scroll internally). */
@media (min-width: 992px) {
    .main-content .col-lg-4 {
        /* Ensure the column can size relative to viewport */
        max-height: calc(100vh - 140px);
        /* allow internal overflow handling for stacked cards */
        overflow: hidden;
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .main-content .col-lg-4 .dashboard-card {
        /* Each card gets its own scroll area if content is long */
        max-height: calc((100vh - 180px) / 3);
        /* allow card to shrink and show internal scrollbar */
        overflow: auto;
    }

    /* If there are fewer cards, allow them to expand a bit */
    .main-content .col-lg-4 .dashboard-card:only-child,
    .main-content .col-lg-4 .dashboard-card:only-of-type {
        max-height: none;
    }
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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: 60px 20px;
}

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

.empty-state h5 {
    color: #6c757d;
    margin-bottom: 10px;
}

.empty-state p {
    color: #adb5bd;
}