/*!
 * Base on AdminLTE v3.2.0
 * Custom TAU Theme Styles - Reorganized for Maintainability
 * Optimized for WCAG AAA Compliance & UI Consistency
 */

/* =========================================================
   1. GLOBAL & UTILITY STYLES
   ========================================================= */

/* Reusable green background class - AAA Compliant */
.bg-tau-primary {
    background-color: #006600 !important;
    color: #ffffff !important;
}

.bg-tau-danger {
    background-color: #bd2130 !important; /* Slightly deeper than bootstrap default */
    border-color: #b21f2d !important;
}

.bg-tau-warning {
    background-color: #FFD700 !important; /* Gold */
    border-color: #e6c200 !important;
}


/* Base content wrapper reset */
.content-wrapper {
    margin-left: 0 !important;
}

/* =========================================================
   2. RESPONSIVE LAYOUT (PERCENTAGE-BASED)
   ========================================================= */

.classadjust {
    margin-left: 0% !important;
    transition: margin-left .3s ease-in-out;
}

@media (min-width: 768px)  { .classadjust { margin-left: 0% !important; } }
@media (min-width: 992px)  { .classadjust { margin-left: 18% !important; } }
@media (min-width: 1200px) { .classadjust { margin-left: 15% !important; } }
@media (min-width: 1600px) { .classadjust { margin-left: 14% !important; } }
@media (min-width: 1682px) { .classadjust { margin-left: 13% !important; } }

/* =========================================================
   3. NAVIGATION: NAVBAR & BRANDING
   ========================================================= */

/* Brand Text */
span.brand-text.font-weight-light {
    color: #000;
}

/* Mother Menu Base */
.navbar-nav .nav-item.dropdown > .nav-link {
    border-left: 4px solid transparent; 
    transition: all 0.2s ease-in-out;
}

/* Light Mode: Mother Menu Hover/Active */
.navbar-nav .nav-item.dropdown > .nav-link:hover,
.navbar-nav .nav-item.dropdown.show > .nav-link {
    background-color: #f4f6f9 !important; 
    color: #006600 !important;
    border-left: 4px solid #006600 !important; 
    padding-left: 12px !important; 
    border-radius: 0 4px 4px 0; 
    font-weight: 600;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

/* Light Mode: Child Menu - AAA Compliant Hover */
.navbar-nav .dropdown-menu .dropdown-item {
    padding: 10px 20px;
    border: none !important;
    transition: all 0.2s ease;
}

.navbar-nav .dropdown-menu .dropdown-item:hover {
    background-color: #004d00 !important; /* Deep Green AAA */
    color: #ffffff !important;
    padding-left: 25px;
}

/* =========================================================
   4. NAVIGATION: SIDEBAR (MOTHER & SUB MENU)
   ========================================================= */

/* Sidebar Mother Menu Link */
.nav-sidebar .nav-item > .nav-link#clckdropdown {
    background-color: #006600 !important;
    color: #ffffff !important;
}

/* Sidebar Mother Menu Hover - AAA Compliant */
.nav-sidebar .nav-item > .nav-link#clckdropdown:hover {
    background-color: #004d00 !important;
}

/* SUB MENU (Treeview) Hover - Light Mode AAA */
.nav-sidebar .nav-treeview > .nav-item > .nav-link:hover,
.nav-sidebar .nav-treeview > .nav-item > .nav-link:focus {
    background-color: #004d00 !important; 
    color: #ffffff !important;
}

/* Active State for Mother Menu */
.nav-sidebar .nav-item.menu-open > .nav-link#clckdropdown,
.nav-sidebar .nav-item > .nav-link#clckdropdown.active {
    background-color: #006600 !important;
    color: #ffffff !important;
    border-left: 4px solid #FFD700;
	}

.nav-sidebar .nav-item > .nav-link#clckdropdown i {
    color: #ffffff !important;
}

/* =========================================================
   5. UI COMPONENTS: CARDS (LOGIN FORM)
   ========================================================= */

.card-primary.card-outline {
    border-top: 7px solid #FFD700 !important; /* Gold Border */
    border-radius: 8px;
    border-left: 0; border-right: 0; border-bottom: 0;
    box-shadow: 0 10px 30px rgba(0, 20, 5, 0.5), 0 4px 10px rgba(0, 0, 0, 0.3) !important;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
    background-color: #ffffff; 
}

.card-primary.card-outline:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 45px rgba(0, 15, 2, 0.6), 0 10px 15px rgba(0, 0, 0, 0.2) !important;
}

/* =========================================================
   6. UI COMPONENTS: BUTTONS & FORMS
   ========================================================= */

/* Primary Button (Green) - AAA Hover */
.btn-primary {
    background-color: #006600 !important;
    border-color: #004d00 !important;
    color: #ffffff !important;
    font-weight: 500;
    transition: all 0.2s ease-in-out !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-primary:hover {
    background-color: #004d00 !important; /* Deep Green AAA */
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-primary:active {
    background-color: #003300 !important;
    transform: translateY(0);
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 0, 0.35) !important;
}

/* Danger Button (Deep Red - AAA Compliant) */
.btn-danger {
    background-color: #bd2130 !important; /* Slightly deeper than bootstrap default */
    border-color: #b21f2d !important;
    color: #ffffff !important;
    font-weight: 500;
    transition: all 0.2s ease-in-out !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-danger:hover {
    background-color: #a71d2a !important; /* Darker Red for AAA */
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-danger:active {
    background-color: #8e1924 !important;
    transform: translateY(0);
}

.btn-danger:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.4) !important;
}

/* Warning Button (Gold - Optimized for BLACK text for WCAG AAA) */
.btn-warning {
    background-color: #FFD700 !important; /* Gold */
    border-color: #e6c200 !important;
    color: #000000 !important; /* MUST be black to pass AAA on this background */
    font-weight: 600; 
    transition: all 0.2s ease-in-out !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-warning:hover {
    background-color: #e6c200 !important; /* Slightly darker gold */
    border-color: #ccad00 !important;
    color: #000000 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-warning:active {
    background-color: #ccad00 !important;
    transform: translateY(0);
}

.btn-warning:focus {
    /* Focus ring using a darker gold for visibility */
    box-shadow: 0 0 0 0.2rem rgba(255, 215, 0, 0.4) !important;
}

/* Form Focus */
.form-control:focus {
    border-color: #006600;
    box-shadow: 0 0 0 0.2rem rgba(7, 134, 31, 0.25);
}

/* =========================================================
   7. UI COMPONENTS: TABLES
   ========================================================= */

.table thead th {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-bottom: 3px solid #006600 !important;
}

/* =========================================================
   8. DARK MODE OVERRIDES (SYNCED WITH NAVBAR)
   ========================================================= */

.dark-mode .table thead th {
    background-color: #343a40 !important;
    color: #ffffff !important;
}

.dark-mode .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
}

/* 
   SYNCED STATES: Navbar Hover, Sidebar Sub-Menu Hover, and Sub-Menu ACTIVE
   Using #4b545c for a unified "Selection" look
*/
.dark-mode .navbar-nav .nav-item.dropdown > .nav-link:hover,
.dark-mode .nav-sidebar .nav-treeview > .nav-item > .nav-link:hover,
.dark-mode .nav-sidebar .nav-treeview > .nav-item > .nav-link:focus,
.dark-mode .nav-sidebar .nav-treeview > .nav-item > .nav-link.active, /* Selected Sub-menu */
.dark-mode .dropdown-menu .dropdown-item:hover {
    background-color: #4b545c !important; 
    color: #ffffff !important;
    transition: all 0.2s ease;
}

/* Navbar Specific Spacing on Hover */
.dark-mode .navbar-nav .nav-item.dropdown > .nav-link:hover {
    border-left: 4px solid #ffffff !important;
    padding-left: 12px !important;
}

/* Mother Menu Dropdown (when open) */
.dark-mode .navbar-nav .nav-item.dropdown.show > .nav-link {
    background-color: #3f474e !important;
    color: #28a745 !important;
    border-left: 4px solid #28a745 !important;
}

.dark-mode .dropdown-menu {
    background-color: #343a40 !important;
    border: 1px solid #4b545c !important;
}

.dark-mode .dropdown-menu .dropdown-item {
    color: #ffffff !important;
}

/* =========================================================
   9. ANIMATIONS & OVERLAYS (LOADING SPINNER)
   ========================================================= */

#loadingSpinner {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    z-index: 9999;
}

.dot-container { display: flex; justify-content: center; align-items: center; }

.dot {
    width: 12px; height: 12px; margin: 0 5px;
    background-color: white; border-radius: 50%;
    animation: bounce 1.5s infinite ease-in-out;
}

.dot:nth-child(1) { animation-delay: 0s; }
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
.dot:nth-child(4) { animation-delay: 0.6s; }
.dot:nth-child(5) { animation-delay: 0.8s; }

@keyframes bounce {
    0%, 100% { transform: translateY(0) scale(1); background-color: white; }
    50% { transform: translateY(-15px) scale(1.2); background-color: #004d00; }
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.navbar-nav .nav-item.dropdown.show .dropdown-menu {
    display: block;
    animation: dropdownFadeIn 0.2s ease-out;
    border: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    margin-top: 2px;
}

/* =========================================================
   10. PAGE CONTAINER & DYNAMIC BACKGROUNDS
   ========================================================= */

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
}

#container {
    background: 
        url('../img/pattern20.jpg'), 
        linear-gradient(135deg, #01411C 0%, #013516 45%, #001a0b 100%) !important;
    background-blend-mode: overlay !important;
    background-attachment: fixed !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-position: center center; /* Keeps the pattern centered */
    
    /* Use dvh for better mobile support, fallback to 100vh */
    min-height: 100vh;
    min-height: 100dvh; 
    width: 100%;
    
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (max-width: 768px) {
    #container {
        /* Mobile browsers struggle with 'fixed' backgrounds, 
           so 'scroll' or 'local' is the right move here. */
        background-attachment: scroll !important;
        background-size: cover !important; 
    }
}