/* app/static/css/main.css */

/* --- Main Theme & Layout --- */
:root {
    /* Primary Colors */
    --primary-color: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    
    /* Secondary Colors */
    --secondary-color: #1a2332;
    --secondary-light: #2d3748;
    --accent-color: #0ea5e9;
    --accent-gold: #f59e0b;
    
    /* Neutral Colors */
    --slate-gray: #64748b;
    --light-gray: #f8fafc;
    --pearl-white: #ffffff;
    --content-bg: #f1f5f9;
    
    /* Text Colors */
    --text-color: #1e293b;
    --text-muted: #64748b;
    
    /* Semantic Colors */
    --success-color: #22c55e;
    --warning-color: #eab308;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    
    /* UI Elements */
    --border-color: #e2e8f0;
    --sidebar-bg: #ffffff;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* Smaller icons in action buttons */
.tabulator .btn i {
    font-size: 0.75rem;
}

.small-icon {
    font-size: 0.75rem; /* Adjust size as needed */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--content-bg);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    flex-grow: 1;
}

/* --- Navigation Bar --- */
.navbar {
    background: var(--secondary-color);
    box-shadow: var(--shadow-md);
    border-bottom: 3px solid var(--primary-color);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--pearl-white) !important;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    color: var(--primary-color) !important;
    transform: translateY(-1px);
}

.navbar .nav-link {
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 1rem;
}

.navbar .nav-link:hover {
    color: var(--primary-color) !important;
    transform: translateY(-2px);
}

.navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background-color: var(--primary-color);
    transition: transform 0.3s ease;
}

.navbar .nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}


/* --- Main Content Area --- */
.page-header {
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1.5rem;
    background: linear-gradient(to right, transparent 0%, var(--primary-color) 0%, var(--primary-color) 4px, transparent 4px);
}

.page-header h1 {
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 2rem;
    letter-spacing: -0.025em;
}


/* --- Footer --- */
.footer {
    background-color: var(--secondary-color);
    border-top: 3px solid var(--primary-color);
    font-size: 0.875rem;
    color: #e2e8f0;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

.footer .text-muted {
    color: #cbd5e1 !important;
}

.footer a {
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--primary-light);
}

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

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

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

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

.bg-primary-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.bg-secondary-gradient {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-light) 100%);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: none;
    transform: translateX(2px);
}

/* Enhanced dropdown styling with icons */
.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
}

.dropdown-item i {
    margin-right: 0.5rem;
    width: 1rem;
    text-align: center;
}

.dropdown-header i {
    margin-right: 0.5rem;
}

/* Desktop nested dropdown support */
@media (min-width: 992px) {
    .dropdown-submenu {
        position: relative;
    }

    .dropdown-submenu .dropdown-menu {
        top: 0;
        left: 100%;
        margin-top: -1px;
    }

    .dropend .dropdown-menu {
        top: 0;
        right: auto;
        left: 100%;
        margin-top: -6px;
    }

    .dropend .dropdown-toggle::after {
        display: inline-block;
        margin-left: 0.5rem;
        vertical-align: 0.255em;
        content: "";
        border-top: 0.3em solid transparent;
        border-right: 0;
        border-bottom: 0.3em solid transparent;
        border-left: 0.3em solid;
    }
}

/* Mobile-specific styling */
@media (max-width: 991.98px) {
    .dropdown-menu {
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .dropdown-item.ps-4 {
        padding-left: 2rem !important;
        font-size: 0.9rem;
    }
    
    .dropdown-divider {
        margin: 0.25rem 0;
    }
}

/* Active state styling - Fixed version */
.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 600;
    position: relative;
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%) scaleX(1) !important;
    width: 80%;
    height: 3px;
    background-color: var(--primary-color);
    box-shadow: 0 0 8px var(--primary-color);
}

/* Dropdown hover effects - Fixed version */
@media (min-width: 992px) {
    .dropdown-menu .dropdown-item:hover {
        background-color: var(--primary-color);
        color: white;
        transform: translateX(4px);
        transition: all 0.3s ease;
    }
}

/* Dropdown styling */
.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
}

/* Dropdown header styling - Fixed version */
.dropdown-header {
    color: var(--secondary-color) !important;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 1rem 0.25rem;
}