/* JCAT Custom Styles - Based on DCS Design */

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

/* Navbar Styles */
.navbar {
    background-color: #1a1c23;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    height: 56px;
}

.navbar-brand {
    color: white !important;
    font-weight: 600;
}

.navbar-title {
    color: white;
    font-weight: 500;
}

.sidebar-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Sidebar Core Styles */
.sidebar {
    height: calc(100vh - 56px);
    background-color: #1a1c23;
    color: #8b93a7;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s ease;
    position: fixed;
    top: 56px;
    left: 0;
    width: 320px;
    padding: 20px 0;
    z-index: 1000;
}

/* Sidebar Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #1e2126;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #4a4d52;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #62666d;
}

/* Sidebar Navigation */
.sidebar-link {
    color: #8b93a7;
    text-decoration: none;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 2px 10px;
    position: relative;
}

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

.sidebar-link.active {
    background-color: #3699ff;
    color: #fff;
}

.sidebar-link i {
    min-width: 24px;
    margin-right: 10px;
    font-size: 18px;
}

.sidebar-link .arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
    font-size: 14px;
}

.sidebar-link.has-submenu[aria-expanded="true"] .arrow {
    transform: rotate(180deg);
}

/* Submenu Styles */
.submenu {
    background-color: rgba(0, 0, 0, 0.15);
    margin: 0 5px;
    border-radius: 4px;
    padding: 5px 0;
}

/* Faster collapse animation for smoother transitions */
.sidebar .collapsing {
    transition: height 0.2s ease-in-out;
    overflow: hidden;
}

.sidebar .collapse {
    transition: none;
}

.submenu-item {
    padding-left: 45px !important;
    font-size: 0.95em;
}

.submenu .submenu-item {
    padding-left: 60px !important;
}

.sidebar-link.has-submenu[aria-expanded="true"] {
    background-color: rgba(54, 153, 255, 0.05);
}

.submenu .sidebar-link.active {
    background-color: rgba(54, 153, 255, 0.1);
    color: #3699ff;
}

.sidebar-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 10px 15px;
}

/* Sidebar Collapsed State (Desktop) */
.sidebar.collapsed {
    transform: translateX(-320px);
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
}

/* Main Content Area */
.main-content {
    margin-left: 320px;
    margin-top: 56px;
    padding: 20px;
    min-height: calc(100vh - 56px);
    transition: margin-left 0.3s ease;
}

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

/* Stats Cards */
.stats-card {
    border-radius: 10px;
    border: none;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

/* Color Utilities */
.text-orange {
    color: #fd7e14 !important;
}

.bg-orange-soft {
    background-color: rgba(253, 126, 20, 0.1);
}

.text-blue {
    color: #0d6efd !important;
}

.bg-blue-soft {
    background-color: rgba(13, 110, 253, 0.1);
}

.text-green {
    color: #198754 !important;
}

.bg-green-soft {
    background-color: rgba(25, 135, 84, 0.1);
}

.text-purple {
    color: #6f42c1 !important;
}

.bg-purple-soft {
    background-color: rgba(111, 66, 193, 0.1);
}

/* Chart Containers */
.chart-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

/* Status Legend */
.status-legend {
    padding-top: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.status-dot.complete {
    background-color: #4caf50;
}

.status-dot.in-progress {
    background-color: #ffd54f;
}

.status-dot.open {
    background-color: #e0e0e0;
}

.status-dot.cancelled {
    background-color: #dc3545;
}

/* Table Styles */
.table-compact th,
.table-compact td {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.table th,
.table td {
    text-align: left !important;
}

/* Card Styles */
.card {
    border-radius: 10px;
    border: none;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

/* Badge Styles */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn i {
    margin-right: 5px;
}

.btn-primary-custom {
    background-color: #0078d4;
    border-color: #0078d4;
    color: white;
}

.btn-primary-custom:hover {
    background-color: #106ebe;
    border-color: #106ebe;
    color: white;
}

.btn-secondary-custom {
    background-color: white;
    border: 1px solid #ced4da;
    color: #495057;
}

.btn-secondary-custom:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
}

/* Form Styles */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #3699ff;
    box-shadow: 0 0 0 0.2rem rgba(54, 153, 255, 0.25);
}

.invalid-feedback {
    color: #dc3545;
    font-size: 0.875rem;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

/* Footer Styles */
.footer {
    margin-top: auto;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* Toggle Button */
#sidebarToggle {
    background: transparent;
    border: none;
    padding: 0.5rem;
    color: white;
    font-size: 20px;
}

#sidebarToggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    max-width: 400px;
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.login-header {
    background-color: #1a1c23;
    color: white;
    border-radius: 15px 15px 0 0;
    padding: 2rem;
    text-align: center;
}

.login-body {
    padding: 2rem;
}

/* Responsive Adjustments */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-320px);
    }

    .sidebar.show {
        transform: translateX(0);
    }

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

    body.sidebar-open {
        overflow: hidden;
    }
}

@media (max-width: 768px) {
    .navbar-title h5 {
        font-size: 1rem;
    }

    .stats-card {
        margin-bottom: 1rem;
    }
}

/* Content Card Styles */
.content-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.content-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.content-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: #1a1c23;
}

.search-box {
    position: relative;
    display: inline-block;
}

.search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 16px;
    pointer-events: none;
    z-index: 10;
}

.search-box .form-control {
    padding-left: 35px;
    padding-right: 12px;
    min-width: 200px;
}

/* Utility Classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

/* Alert Styles */
.alert {
    border-radius: 8px;
    border: none;
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}
