/* Global Variables */
:root {
    --dark-bg: #121212;
    --card-bg: rgba(30, 30, 30, 0.7);
    --primary-color: #856404;
    --accent-color: #ffeeba;
    --text-color: #f5f5f5;
    --border-color: rgba(255, 255, 255, 0.1);
    --danger-color: #dc3545;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
}

/* Base Styles */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-color);
    background-image: url('/images/1st-cavalry-bg.png');
    background-size: 15%;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    height: 100%;
    /* Create a main stacking context */
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Create stacking contexts for main components */
html {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Fix stacking context for navbar */
.glass-navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 250px;
    width: calc(100% - 250px);
    z-index: 1030;
    height: 50px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    padding: 8px 20px;
}

/* Fix for dropdowns */
.navbar-actions {
    position: relative;
    z-index: 1050 !important; /* Higher than navbar */
}

.dropdown-menu {
    z-index: 1060 !important; /* Higher than navbar actions */
}

/* Glass Components */
.glass-container, .glass-card, .glass-sidebar, .glass-navbar, .glass-dropdown {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.glass-card {
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.glass-sidebar {
    min-width: 250px;
    max-width: 250px;
    width: 250px;
    border-radius: 0;
    border-right: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1020;
    display: block !important;
}

.glass-navbar {
    padding: 10px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
}

.glass-dropdown {
    background: rgba(45, 45, 45, 0.9);
    border-color: var(--border-color);
    z-index: 9999 !important;
}

.glass-dropdown .dropdown-item {
    color: var(--text-color);
}

.glass-dropdown .dropdown-item:hover, 
.glass-dropdown .dropdown-item:focus {
    background-color: rgba(133, 100, 4, 0.3);
    color: var(--accent-color);
}

.glass-dropdown .dropdown-divider {
    border-top-color: var(--border-color);
}

/* Sidebar Styles */
#sidebar {
    padding: 20px 0;
    /* Changed from sticky to fixed to match .glass-sidebar */
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1020;
    transition: all 0.3s ease;
    width: 250px;
    min-width: 250px;
}

/* Fixed sidebar minimization rule */
#sidebar.active {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 10px 20px;
    text-align: center;
    margin-bottom: 20px;
}

.sidebar-logo {
    width: 165px;
    margin-bottom: 10px;
}

.sidebar-header h3 {
    color: var(--accent-color);
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(133, 100, 4, 0.1);
    margin-right: 14px;
}

.user-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

.user-details h6 {
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
}

.user-details small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-top: 2px;
}

#sidebar ul.components {
    padding: 0;
}

#sidebar ul li {
    padding: 0;
    margin: 0;
}

#sidebar ul li a {
    padding: 10px 20px;
    display: block;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s;
}

#sidebar ul li a:hover {
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

/* Add hover effect for the entire menu item row */
#sidebar ul.components > li:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

#sidebar ul li.active > a {
    color: var(--accent-color);
    background: rgba(133, 100, 4, 0.2);
    border-left: 4px solid var(--primary-color);
    font-weight: 600;
}

/* Give active items a subtle highlight background that covers the full width */
#sidebar ul.components > li.active {
    background-color: rgba(133, 100, 4, 0.1);
}

#sidebar ul ul a {
    padding: 10px 20px 10px 40px;
    font-size: 0.9rem;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
}

#sidebar ul ul a:hover {
    border-left: 2px solid var(--primary-color);
}

/* Additional space at the bottom of submenus */
#sidebar ul.components > li > ul.collapse {
    margin-bottom: 8px;
    background-color: rgba(0, 0, 0, 0.15);
}

/* Add dividing lines between sidebar menu items */
#sidebar ul.components > li {
    border-bottom: 1px solid var(--border-color);
}

#sidebar ul.components > li:first-child {
    border-top: 1px solid var(--border-color);
}

/* Don't add borders to submenu items */
#sidebar ul.components ul li {
    border-bottom: none;
}

/* Adjust padding for menu items to account for borders */
#sidebar ul.components > li > a {
    padding: 12px 20px;
}

/* Content Styles */
#content {
    position: relative;
    min-height: 100vh;
    margin-left: 250px;
    width: calc(100% - 250px);
    padding-top: 70px; /* Allow space for fixed navbar */
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

#content.active {
    margin-left: 60px;
    width: calc(100% - 60px);
}

.main-content {
    flex: 1 1 auto;
    padding-bottom: 20px;
    overflow-y: visible;
    width: 100%;
}

/* Navbar Styles */
.navbar {
    padding: 0;
    margin-bottom: 20px;
}

.navbar-actions {
    display: flex;
    align-items: center;
}

.btn-toggle, .btn-notification, .btn-user {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    padding: 0.5rem 0.8rem;
    border-radius: 50%;
    transition: all 0.3s;
}

.btn-toggle:hover, .btn-notification:hover, .btn-user:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
}

.page-title h4 {
    margin: 0;
    color: var(--accent-color);
    font-weight: 600;
}

/* Form Styles */
.form-control, .form-select {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px;
}

/* Fix for dropdown options text color */
.form-select option {
    background-color: #121212; /* Dark background */
    color: #f5f5f5; /* Light text */
}

.form-control:focus, .form-select:focus {
    background-color: rgba(0, 0, 0, 0.4);
    color: var(--text-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(133, 100, 4, 0.25);
}

.form-label {
    color: var(--accent-color);
    font-weight: 500;
}

/* Modpack / mod forms: lighter placeholder and helper text */
.modpacks-forms .form-control.dark-glass-input::placeholder,
.modpacks-forms .dark-glass-input::placeholder,
.modpacks-forms textarea.dark-glass-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}
.modpacks-forms .form-text,
.modpacks-forms .text-muted {
    color: rgba(255, 255, 255, 0.55) !important;
}

/* Special message field: bigger, expandable */
.modpacks-forms .modpack-special-message {
    min-height: 6rem;
    resize: vertical;
}

/* Button Styles */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-color);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #6a5003;
    border-color: #6a5003;
}

/* Alert Styles */
.alert {
    border-radius: 5px;
    padding: 12px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.3);
    color: #f8d7da;
}

.alert-danger.maintenance-banner {
    background-color: rgba(220, 53, 69, 0.9);
    color: #ffffff;
    border: none;
    border-radius: 0;
    margin: 0;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    position: relative;
    z-index: 1040;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.2);
    border-color: rgba(25, 135, 84, 0.3);
    color: #d1e7dd;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.3);
    color: #fff3cd;
}

.alert-info {
    background-color: rgba(13, 202, 240, 0.2);
    border-color: rgba(13, 202, 240, 0.3);
    color: #d1ecf1;
}

/* Table Styles */
.table {
    color: var(--text-color);
}

.table-glass {
    background: rgba(30, 30, 30, 0.5);
    backdrop-filter: blur(5px);
    border-radius: 8px;
    overflow: hidden;
}

.table-glass thead th {
    background: rgba(0, 0, 0, 0.2);
    color: var(--accent-color);
    font-weight: 600;
    border-color: var(--border-color);
}

.table-glass td {
    border-color: var(--border-color);
}

.table-glass tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Card Styles */
.card {
    background: transparent;
    border: none;
}

.card-header {
    background: rgba(0, 0, 0, 0.2);
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.card-footer {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color);
}

/* Stats Card */
.stats-card {
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.stats-card .stats-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--accent-color);
}

.stats-card .stats-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stats-card .stats-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
}

/* Footer Styles */
.app-footer {
    padding: 2px 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    flex-shrink: 0;
    height: auto;
}

.footer-content {
    line-height: 1;
    padding: 0;
    margin: 0;
}

/* Responsive Styles */
@media (max-width: 768px) {
    #sidebar {
        margin-left: 0;
        width: 250px;
        min-width: 250px;
    }
    #sidebar.active {
        width: 60px;
        min-width: 60px;
        max-width: 60px;
        margin-left: 0;
    }
    #content {
        width: calc(100% - 250px);
        margin-left: 250px;
    }
    #content.active {
        width: calc(100% - 60px);
        margin-left: 60px;
    }
    .glass-navbar {
        left: 250px;
        width: calc(100% - 250px);
    }
    .glass-navbar.active {
        left: 60px;
        width: calc(100% - 60px);
    }
}

/* Utilities */
.text-primary {
    color: var(--primary-color) !important;
}

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

.text-muted {
    color: rgba(255, 191, 0, 0.651) !important;
}

.bg-glass {
    background: var(--card-bg) !important;
    backdrop-filter: blur(10px);
}

/* Badge Styles */
.badge {
    padding: 0.4em 0.6em;
    font-weight: 600;
    font-size: 0.75em;
}

.badge-success {
    background-color: var(--success-color);
    color: white;
}

.badge-danger {
    background-color: var(--danger-color);
    color: white;
}

.badge-warning {
    background-color: var(--warning-color);
    color: black;
}

.badge-info {
    background-color: var(--info-color);
    color: white;
}

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

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(133, 100, 4, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(133, 100, 4, 0.7);
} 

/* Forms */
.form-text {
    color: rgba(255, 191, 0, 0.651);
}

/* box backgrounds */
.bg-dark-custom {
    background-color: rgba(70, 65, 65, 0.534) !important;
}

/* login custom */
.img-fluid-login-custom {
    width: 144;
    height: 144;
}

/* Avatar Styles */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.avatar-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    overflow: hidden;
    box-shadow: none;
}

.btn-user {
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 24px;
    transition: background 0.2s;
}

.btn-user:hover, .btn-user:focus {
    background: rgba(255,255,255,0.08);
    color: var(--accent-color);
}

.btn-user .avatar {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    position: static;
    top: 0;
}

.btn-user .username {
    font-weight: 600;
    font-size: 1rem;
}

/* Profile: Steam ID 64 value - lighter text */
.steam-id-value {
    color: #b8bcc4 !important;
}

/* Remove any shadow from avatar and its container on profile page */
.avatar-circle,
.profile-image,
.profile-image .avatar-circle,
.profile-image img.avatar {
    box-shadow: none !important;
    background: transparent !important;
}

/* Submenu styling for collapsed sidebar */
#sidebar.active ul.components > li > ul.collapse {
    position: fixed !important;
    left: 60px !important;
    top: auto !important;
    width: 200px !important;
    background: rgba(30, 30, 30, 0.95) !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
    z-index: 1025 !important;
    display: none !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 10px 0 !important;
}

#sidebar.active ul.components > li > ul.collapse.show {
    display: block !important;
}

/* Fix submenu text display in collapsed mode */
#sidebar.active ul.components > li > ul.collapse a span {
    display: inline !important;
}

/* Fix submenu icon display in collapsed mode */
#sidebar.active ul.components > li > ul.collapse a i {
    width: auto !important;
    margin-right: 10px !important;
    text-align: left !important;
}

/* Fix submenu items in collapsed mode */
#sidebar.active ul.components > li > ul.collapse li a {
    padding: 8px 15px !important;
    text-align: left !important;
    white-space: nowrap !important;
}

/* Nested submenus in collapsed mode */
#sidebar.active ul.components > li > ul.collapse li ul.collapse {
    position: static !important;
    width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    background: rgba(0, 0, 0, 0.2) !important;
    margin-left: 15px !important;
    padding: 0 !important;
}

/* Adjust dividers for collapsed sidebar */
#sidebar.active ul.components > li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#sidebar.active ul.components > li > a {
    padding: 15px 0;
}

/* Ensure submenu dividers look good in collapsed state */
#sidebar.active ul.components > li > ul.collapse li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#sidebar.active ul.components > li > ul.collapse li:last-child {
    border-bottom: none;
}

/* Calendar-specific styling */
.fc-theme-standard {
    --fc-border-color: rgba(255, 255, 255, 0.1);
    --fc-button-bg-color: #007bff;
    --fc-button-border-color: #007bff;
    --fc-button-hover-bg-color: #0056b3;
    --fc-button-hover-border-color: #0056b3;
    --fc-button-active-bg-color: #0056b3;
    --fc-button-active-border-color: #0056b3;
    --fc-today-bg-color: rgba(0, 123, 255, 0.1);
    --fc-event-bg-color: #007bff;
    --fc-event-border-color: #007bff;
    --fc-event-text-color: #ffffff;
}

.fc-event {
    border-radius: 4px;
    border: none;
    padding: 2px 4px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fc-event:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

.fc-event.event-training {
    background-color: #28a745;
    border-color: #28a745;
}

.fc-event.event-meeting {
    background-color: #17a2b8;
    border-color: #17a2b8;
}

.fc-event.event-deployment {
    background-color: #dc3545;
    border-color: #dc3545;
}

.fc-event.event-ceremony {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
}

.fc-event.event-other {
    background-color: #6c757d;
    border-color: #6c757d;
}

/* Calendar event items */
.event-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.event-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* Calendar statistics */
.stat-item {
    padding: 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Upcoming events list */
.upcoming-events-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.upcoming-events-list::-webkit-scrollbar {
    width: 6px;
}

.upcoming-events-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.upcoming-events-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.upcoming-events-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Document modal (record document view) – dark theme to match app */
.modal-content.dark-glass-bg {
    background: rgba(33, 37, 41, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    color: #e9ecef;
}
.modal-content.dark-glass-bg .modal-header {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
}
.modal-content.dark-glass-bg .modal-body {
    background: rgba(30, 30, 30, 0.95);
    color: #e9ecef;
    border-bottom: 1px solid var(--border-color);
}
.modal-content.dark-glass-bg .modal-footer {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color);
}
/* Injected document body (rich HTML from records) – force dark theme and light text */
.document-body-content {
    background: transparent !important;
    color: #dee2e6 !important;
    min-height: 1em;
}
.document-body-content * {
    color: #dee2e6 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}
.document-body-content p,
.document-body-content div,
.document-body-content span,
.document-body-content li,
.document-body-content td,
.document-body-content th {
    color: #dee2e6 !important;
}
.document-body-content h1,
.document-body-content h2,
.document-body-content h3,
.document-body-content h4,
.document-body-content h5,
.document-body-content h6 {
    color: #f8f9fa !important;
}
.document-body-content a {
    color: #7dd3fc !important;
}
.document-body-content table {
    border-color: rgba(255, 255, 255, 0.2) !important;
}
.document-body-content th,
.document-body-content td {
    border-color: rgba(255, 255, 255, 0.15) !important;
}
.document-body-content .text-muted {
    color: #adb5bd !important;
}

/* Calendar modal styling */
.calendar-modal .modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

.calendar-modal .modal-header {
    border-bottom: 1px solid var(--border-color);
}

.calendar-modal .modal-footer {
    border-top: 1px solid var(--border-color);
}

/* Calendar form styling */
.calendar-form .form-control,
.calendar-form .form-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.calendar-form .form-control:focus,
.calendar-form .form-select:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(133, 100, 4, 0.25);
}

.calendar-form .form-label {
    color: var(--text-color);
    font-weight: 500;
}

/* Calendar event type badges */
.event-type-badge {
    font-size: 0.75em;
    padding: 0.25em 0.5em;
    border-radius: 4px;
}

.event-type-badge.training {
    background-color: #28a745;
    color: white;
}

.event-type-badge.meeting {
    background-color: #17a2b8;
    color: white;
}

.event-type-badge.deployment {
    background-color: #dc3545;
    color: white;
}

.event-type-badge.ceremony {
    background-color: #ffc107;
    color: #000;
}

.event-type-badge.other {
    background-color: #6c757d;
    color: white;
}

/* Calendar loading states */
.calendar-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: var(--text-color);
}

.calendar-loading .spinner-border {
    color: var(--primary-color);
}

/* Calendar responsive design */
@media (max-width: 768px) {
    .fc-toolbar {
        flex-direction: column;
        gap: 10px;
    }
    
    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
    }
    
    .fc-button-group {
        flex-wrap: wrap;
    }
    
    .fc-button {
        font-size: 0.8em;
        padding: 0.25rem 0.5rem;
    }
}

