/* ===================================================
   CCU Thesis Management System - Professional Theme
   Carver Christian University Brand
   =================================================== */

/* CSS Variables for Light/Dark Mode */
:root {
    --primary: #1a3a5c;
    --primary-light: #2c5282;
    --primary-dark: #0d2137;
    --accent: #c9a93e;
    --accent-light: #dbc45c;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;

    --bg-body: #f0f2f5;
    --bg-card: #ffffff;
    --bg-sidebar: #1a3a5c;
    --bg-navbar: #ffffff;
    --bg-footer: #1a3a5c;

    --text-primary: #1a1a2e;
    --text-secondary: #6c757d;
    --text-light: #f8f9fa;
    --text-muted: #adb5bd;

    --border-color: #e9ecef;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
    --radius: 10px;
    --radius-sm: 6px;

    --sidebar-width: 260px;
    --sidebar-collapsed: 0px;
    --navbar-height: 60px;

    --transition: all 0.3s ease;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-body: #1a1a2e;
    --bg-card: #16213e;
    --bg-sidebar: #0f3460;
    --bg-navbar: #16213e;
    --bg-footer: #0f3460;

    --text-primary: #e4e6eb;
    --text-secondary: #b0b3b8;
    --text-muted: #6c757d;

    --border-color: #2d3748;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.4);
}

/* ===================================================
   BASE & RESET
   =================================================== */
* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    transition: var(--transition);
    overflow-x: hidden;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--primary); }

/* ===================================================
   WRAPPER LAYOUT
   =================================================== */
.wrapper {
    display: flex;
    min-height: 100vh;
    transition: var(--transition);
}

/* ===================================================
   SIDEBAR
   =================================================== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.sidebar.closed {
    margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-brand {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.sidebar-brand h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1px;
}

.sidebar-brand p {
    margin: 5px 0 0;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.sidebar-brand .brand-logo {
    width: 90px;
    height: auto;
    display: block;
    margin: 0 auto 10px;
    border-radius: 8px;
}

.sidebar-menu {
    padding: 15px 0;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.sidebar-menu .menu-label {
    padding: 10px 20px 5px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    font-size: 14px;
    gap: 12px;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.08);
    color: white;
    border-left-color: var(--accent);
}

.sidebar-menu a.active {
    background: rgba(255,255,255,0.12);
    color: white;
    border-left-color: var(--accent);
    font-weight: 600;
}

.sidebar-menu a .icon {
    width: 22px;
    text-align: center;
    font-size: 16px;
}

.sidebar-menu a .badge {
    margin-left: auto;
}

.submenu-group > a {
    cursor: pointer;
}

.submenu {
    background: rgba(0,0,0,0.15);
}

.submenu a {
    padding: 8px 20px 8px 55px;
    font-size: 13px;
    border-left: 3px solid transparent;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    display: block;
    transition: var(--transition);
}

.submenu a:hover {
    background: rgba(255,255,255,0.06);
    color: white;
    border-left-color: var(--accent);
}

.submenu a.active {
    color: white;
    border-left-color: var(--accent);
    font-weight: 500;
    background: rgba(255,255,255,0.08);
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.8);
}

.sidebar-footer .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--primary-dark);
    font-size: 14px;
    overflow: hidden;
    flex-shrink: 0;
}

/* ===================================================
   MAIN CONTENT
   =================================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content.expanded {
    margin-left: 0;
}

/* ===================================================
   NAVBAR
   =================================================== */
.navbar {
    background: var(--bg-navbar);
    border-bottom: 1px solid var(--border-color);
    padding: 0 25px;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar .sidebar-toggle {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-primary);
    padding: 5px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.navbar .sidebar-toggle:hover {
    background: var(--border-color);
}

.navbar .page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.navbar .nav-item {
    position: relative;
}

.navbar .nav-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar .nav-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.navbar .nav-btn .notif-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-navbar);
}

.navbar .user-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.navbar .user-dropdown:hover {
    background: var(--border-color);
}

.navbar .user-dropdown .avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.navbar .user-dropdown .user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.navbar .user-dropdown .user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===================================================
   CONTENT AREA
   =================================================== */
.content-wrapper {
    flex: 1;
    padding: 25px;
}

/* ===================================================
   FOOTER
   =================================================== */
.footer {
    background: var(--bg-footer);
    color: rgba(255,255,255,0.7);
    padding: 15px 25px;
    text-align: center;
    font-size: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ===================================================
   CARDS
   =================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    margin-bottom: 20px;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Small helpers to integrate with Bootstrap layout */
.display-5 { font-size: 2rem; font-weight: 600; }
.lead { font-size: 1.0625rem; }
.bg-body { background: var(--bg-body) !important; }
.text-body { color: var(--text-primary) !important; }
.card { border-radius: var(--radius); }
.footer a { color: rgba(255,255,255,0.9); text-decoration: underline; }

.card-header h5 {
    margin: 0;
    font-size: 15px;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* Card colors */
.card-primary .card-header { background: var(--primary); color: white; }
.card-success .card-header { background: var(--success); color: white; }
.card-info .card-header { background: var(--info); color: white; }
.card-warning .card-header { background: var(--warning); color: #333; }
.card-danger .card-header { background: var(--danger); color: white; }
.card-dark .card-header { background: #343a40; color: white; }
.card-accent .card-header { background: var(--accent); color: var(--primary-dark); }

/* Stat Cards */
.stat-card {
    text-align: center;
    padding: 25px;
}

.stat-card .stat-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    margin: 5px 0;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===================================================
   TABLES
   =================================================== */
.table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-primary);
}

.table th {
    background: var(--bg-body);
    padding: 12px 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    text-align: left;
}

.table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: rgba(0,0,0,0.02);
}

[data-theme="dark"] .table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}

/* ===================================================
   FORMS
   =================================================== */
.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 14px;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: var(--transition);
    width: 100%;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    outline: none;
    box-shadow: 0 0 0 3px rgba(42, 82, 130, 0.15);
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

.form-text {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===================================================
   BUTTONS
   =================================================== */
.btn {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,0.15); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }

.btn-success { background: var(--success); color: white; }
.btn-info { background: var(--info); color: white; }
.btn-warning { background: var(--warning); color: #333; }
.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: var(--text-secondary); color: white; }
.btn-light { background: var(--border-color); color: var(--text-primary); }
.btn-dark { background: #343a40; color: white; }
.btn-accent { background: var(--accent); color: var(--primary-dark); }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 30px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }

/* ===================================================
   BADGES
   =================================================== */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-primary { background: #cce5ff; color: #004085; }

[data-theme="dark"] .badge-success { background: rgba(40, 167, 69, 0.2); color: #5dd879; }
[data-theme="dark"] .badge-danger { background: rgba(220, 53, 69, 0.2); color: #f06a7a; }
[data-theme="dark"] .badge-warning { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
[data-theme="dark"] .badge-info { background: rgba(23, 162, 184, 0.2); color: #5dd0e0; }
[data-theme="dark"] .badge-primary { background: rgba(42, 82, 130, 0.3); color: #6ca2e0; }

/* ===================================================
   AUTH PAGES (Login / Register)
   =================================================== */
.auth-body {
    min-height: 100vh;
    background: url('/images/background1.jpg') center center / cover no-repeat fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
}

.auth-wrapper {
    width: 460px;
    max-width: 100%;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 35px 35px 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-header {
    text-align: center;
    margin-bottom: 25px;
}

.auth-logo {
    width: 90px;
    height: auto;
    margin-bottom: 10px;
    border-radius: 8px;
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 4px 0 0;
}

.auth-form .form-label {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
}

.auth-form .form-control {
    padding: 10px 14px;
    font-size: 15px;
    border-radius: 8px;
}

.auth-form .btn-primary {
    padding: 10px 24px;
    font-size: 15px;
    border-radius: 8px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    border-radius: 8px;
}

.login-footer {
    text-align: center;
    margin-top: 25px;
}

.login-footer p {
    color: var(--text-muted);
    font-size: 13px;
}

/* ===================================================
   ALERTS
   =================================================== */
.alert {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

[data-theme="dark"] .alert-success { background: rgba(40,167,69,0.15); color: #5dd879; }
[data-theme="dark"] .alert-danger { background: rgba(220,53,69,0.15); color: #f06a7a; }
[data-theme="dark"] .alert-warning { background: rgba(255,193,7,0.15); color: #ffc107; }
[data-theme="dark"] .alert-info { background: rgba(23,162,184,0.15); color: #5dd0e0; }

/* ===================================================
   PAGINATION
   =================================================== */
.pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    list-style: none;
    padding: 0;
}

.pagination .page-item .page-link {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    background: var(--bg-card);
    font-size: 13px;
    transition: var(--transition);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination .page-item .page-link:hover {
    background: var(--primary-light);
    color: white;
}

/* ===================================================
   PROGRESS
   =================================================== */
.progress {
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* ===================================================
   TIMELINE
   =================================================== */
.timeline-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.timeline-step .step-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
}

.timeline-step .step-dot.completed {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.timeline-step .step-dot.current {
    border-color: var(--accent);
    border-width: 3px;
}

.timeline-step .step-label {
    font-size: 13px;
    padding-top: 2px;
}

.timeline-step .step-label.completed { color: var(--success); font-weight: 500; }
.timeline-step .step-label.current { color: var(--accent); font-weight: 600; }

/* ===================================================
   SEARCH & FILTERS
   =================================================== */
.filter-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }

    .sidebar.open {
        margin-left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .content-wrapper {
        padding: 15px;
    }

    .navbar {
        padding: 0 15px;
    }

    .navbar .page-title {
        font-size: 15px;
    }

    .stat-card .stat-value {
        font-size: 24px;
    }

    .auth-card {
        padding: 25px;
    }

    .table-responsive {
        overflow-x: auto;
    }
}

@media (min-width: 769px) {
    .sidebar-toggle-mobile {
        display: none;
    }
}

/* ===================================================
   ANIMATIONS
   =================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===================================================
   DASHBOARD SPECIFIC
   =================================================== */
.dashboard-widget {
    transition: var(--transition);
    height: 100%;
}

.dashboard-widget:hover {
    transform: translateY(-3px);
}

.dashboard-header {
    margin-bottom: 25px;
}

.dashboard-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.dashboard-header p {
    color: var(--text-secondary);
    margin: 5px 0 0;
    font-size: 14px;
}

/* Dropdown Menu */
.dropdown-menu {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 8px;
    min-width: 200px;
}

.dropdown-menu a, .dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition);
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
}

.dropdown-menu a:hover, .dropdown-menu button:hover {
    background: var(--border-color);
}

/* Search bar */
.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-body);
    border-radius: 20px;
    padding: 5px 15px;
    border: 1px solid var(--border-color);
}

.search-box input {
    border: none;
    background: none;
    padding: 6px;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    min-width: 180px;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* Dark Mode Toggle Switch */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border-color);
    transition: var(--transition);
    border-radius: 24px;
}

.theme-slider:before {
    position: absolute;
    content: "☀️";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--bg-card);
    transition: var(--transition);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    line-height: 1;
}

input:checked + .theme-slider:before {
    content: "🌙";
    transform: translateX(20px);
}

input:checked + .theme-slider {
    background: var(--primary);
}