/**
 * Conduct - Matching Original Style
 * Dark navbar, white background, green accents
 */

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

:root {
    /* Original Green Accent Colors */
    --accent: #43cd7f;
    --accent-bright: #4bff99;
    --accent-dark: #2fa866;

    /* Dark Theme Elements */
    --navbar-bg: #212529;
    --sidebar-bg: #212529;
    --sidebar-width: 250px;

    /* Light Background */
    --bg-color: #FFFFFF;
    --bg-secondary: #F3F4F6;

    /* Text Colors */
    --text-color: #4B5563;
    --text-dark: #111827;
    --text-light: #9CA3AF;
    --text-muted: #6B7280;

    /* Grays */
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Semantic */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Layout */
    --navbar-height: 56px;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.925rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-bright);
}

/* Navbar - Dark Style */
.navbar {
    background-color: var(--navbar-bg) !important;
    height: var(--navbar-height);
    padding: 0 1rem;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.1rem;
    color: #FFFFFF !important;
}

.navbar-brand .mdi {
    color: var(--accent);
}

.navbar .nav-link {
    color: var(--accent) !important;
    padding: 0.5rem 1rem !important;
    transition: color 0.15s ease;
}

.navbar .nav-link:hover {
    color: var(--accent-bright) !important;
}

.navbar .dropdown-toggle::after {
    color: var(--accent);
}

.navbar-toggler {
    border: none;
    color: #EEE;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* Search Bar in Navbar */
#search_bar, .form-control-dark {
    background-color: var(--navbar-bg);
    border: 0;
    color: #FFFFFF;
}

#search_bar::placeholder {
    color: var(--gray-500);
}

/* Main Content Area */
.main-content {
    margin-top: var(--navbar-height);
    min-height: calc(100vh - var(--navbar-height));
    padding: 1.5rem;
    background-color: var(--bg-color);
}

/* Guest/Login Layout */
.guest-content {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navbar-bg) 0%, #000000 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-card {
    background: var(--bg-color);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.login-header h1 .mdi {
    color: var(--accent);
}

.login-header p {
    color: var(--text-muted);
    margin: 0;
}

/* Cards */
.card {
    background: var(--bg-color);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.card-header {
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    padding: 0.875rem 1.25rem;
    color: var(--text-dark);
}

.card-body {
    padding: 1.25rem;
}

/* Module Cards - Dashboard */
.module-card {
    border: 2px solid var(--gray-200);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-color);
}

.module-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.module-card .card-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.module-card .card-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.module-card .mdi-48px {
    font-size: 48px;
    color: var(--accent);
}

/* Statistics Boxes */
.statistics .box {
    background: var(--bg-color);
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.statistics .box p {
    font-weight: bold;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.statistics .box span {
    font-size: 2em;
    color: var(--text-dark);
}

.statistics .good {
    color: #56d456;
}

.statistics .bad {
    color: #FFAAAA;
}

/* Forms */
.form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.375rem;
}

.form-control, .form-select {
    background: var(--bg-color);
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: var(--text-dark);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(67, 205, 127, 0.2);
    outline: none;
}

.form-control::placeholder {
    color: var(--gray-400);
}

input {
    border: 0;
    padding: 5px;
    width: 100%;
    background-color: #EEEEEE;
}

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.15s ease;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: #FFFFFF;
}

.btn-primary:hover {
    background: var(--accent-dark);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-outline-primary {
    border: 1px solid var(--accent);
    color: var(--accent);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--accent);
    color: #FFFFFF;
}

.btn-outline-secondary {
    border: 1px solid var(--gray-300);
    color: var(--text-color);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--gray-100);
    color: var(--text-dark);
}

.btn-outline-danger {
    border: 1px solid var(--danger);
    color: var(--danger);
    background: transparent;
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: #FFFFFF;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Button Bar - Original Style */
.button, .button_bar > a {
    padding: 5px;
    background-color: #d1d1d1;
    color: #222222;
    font-weight: normal;
    font-size: 0.75em;
    cursor: pointer;
    text-decoration: none;
}

.button_bar > a {
    padding: 10px;
    background-color: var(--accent-bright);
    color: #222222;
}

.button:hover {
    background-color: #DFDFDF;
}

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

.table thead th {
    background: var(--gray-100);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
    color: var(--text-color);
}

.table tbody tr:hover {
    background: var(--gray-100);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

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

.badge.bg-primary { background: rgba(67, 205, 127, 0.15) !important; color: var(--accent-dark) !important; }
.badge.bg-success { background: rgba(16, 185, 129, 0.15) !important; color: var(--success) !important; }
.badge.bg-warning { background: rgba(245, 158, 11, 0.15) !important; color: #b45309 !important; }
.badge.bg-danger { background: rgba(239, 68, 68, 0.15) !important; color: var(--danger) !important; }
.badge.bg-info { background: rgba(59, 130, 246, 0.15) !important; color: var(--info) !important; }
.badge.bg-secondary { background: var(--gray-100) !important; color: var(--gray-600) !important; }

/* Alerts */
.alert {
    border: none;
    border-radius: 6px;
    padding: 1rem 1.25rem;
}

/* Dropdowns */
.dropdown-menu {
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    box-shadow: var(--shadow-md);
    padding: 0.5rem;
    background: var(--bg-color);
}

.dropdown-item {
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    color: var(--text-color);
}

.dropdown-item:hover {
    background: var(--gray-100);
    color: var(--text-dark);
}

.dropdown-divider {
    border-color: var(--gray-200);
    margin: 0.5rem 0;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.modal-header {
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.25rem;
}

.modal-title {
    font-weight: 600;
    color: var(--text-dark);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: 0.875rem 1.25rem;
}

/* Dialog Container - Original Style */
.dialog_container {
    display: none;
    z-index: 90;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.dialog_container > div {
    z-index: 100;
    position: relative;
    top: 100px;
    margin: auto;
    max-width: 1200px;
    background-color: rgba(255,255,255,0.95);
    padding: 20px;
}

.dialog_container > div > div:first-of-type {
    font-weight: bold;
    font-size: 1.3em;
    text-transform: capitalize;
    padding-bottom: 10px;
    overflow: auto;
}

/* List Groups */
.list-group-item {
    border-color: var(--gray-200);
    color: var(--text-color);
    padding: 0.75rem 1.25rem;
}

.list-group-item.active {
    background: var(--accent);
    border-color: var(--accent);
}

.list-group-item-action:hover {
    background: var(--gray-100);
    color: var(--text-dark);
}

/* Nav Tabs */
.nav-tabs {
    border-bottom: 2px solid var(--gray-200);
}

.nav-tabs .nav-link {
    color: var(--text-muted);
    font-weight: 500;
    border: none;
    padding: 0.75rem 1rem;
    margin-bottom: -2px;
}

.nav-tabs .nav-link:hover {
    color: var(--text-dark);
    border: none;
}

.nav-tabs .nav-link.active {
    color: var(--accent);
    background: none;
    border: none;
    border-bottom: 2px solid var(--accent);
}

/* Toasts */
.toast {
    background: var(--bg-color);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    box-shadow: var(--shadow-md);
}

.toast-header {
    background: var(--bg-color);
    border-bottom: 1px solid var(--gray-100);
    color: var(--text-dark);
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info { border-left: 4px solid var(--info); }

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay .spinner-border {
    color: var(--accent);
}

/* PopUp - Original Style */
#popUp {
    display: block;
    position: absolute;
    z-index: 1500;
    background-color: var(--accent-bright);
    padding: 10px;
    max-height: 200px;
    overflow-y: none;
    transition: top 0.5s, left 0.5s;
    border-radius: 4px;
    max-width: 500px;
}

#popUp a {
    display: block;
    cursor: pointer;
}

/* Bottom Bar */
#bottom_bar {
    position: absolute;
    z-index: 2900;
    right: 0;
    height: 50px;
    bottom: 0;
    text-align: right;
}

#bottom_bar a {
    display: inline-block;
    padding: 10px;
    background-color: #222222;
    color: #FFFFFF;
    text-decoration: none;
    margin: 0 5px;
    border-radius: 5px;
}

/* Page Headers */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-dark);
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Color Utilities */
.text-primary { color: var(--accent) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }

.bg-light { background-color: var(--gray-100) !important; }

/* Icon Styling */
.icon {
    filter: invert(77%) sepia(47%) saturate(554%) hue-rotate(85deg) brightness(99%) contrast(106%);
}

.navbar .icon {
    height: 25px;
    padding-right: 10px;
}

/* Scrollbar */
::-webkit-scrollbar {
    background: transparent;
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-thumb {
    background-color: #AAAAAA;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #999999;
}

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

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

/* Responsive */
@media (max-width: 767px) {
    .main-content {
        padding: 1rem;
    }

    .navbar .navbar-nav .open .dropdown-menu > li > a {
        color: #CCC !important;
    }

    .navbar .navbar-nav .open .dropdown-menu > li > a:hover {
        color: #FFF !important;
    }
}

/* Print */
@media print {
    .navbar, .toast-container, .loading-overlay, .btn, .no-print {
        display: none !important;
    }

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

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .dialog_container > div {
        top: 0 !important;
    }
}
