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

/* --- Main Theme & Layout --- */
:root {
    --primary-color: #0056b3;
    --secondary-color: #6c757d;
    --light-gray: #f8f9fa;
    --sidebar-bg: #ffffff;
    --content-bg: #f5f7fa;
    --text-color: #343a40;
    --border-color: #dee2e6;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* 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;
}

main {
    flex-grow: 1;
}

/* --- Navigation Bar --- */
.navbar {
    background: linear-gradient(90deg, #0d253f 0%, #01b4e4 50%, #90cea1 100%);
    box-shadow: var(--shadow-md);
    border-bottom: 3px solid #90cea1;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
}

.navbar .nav-link {
    transition: color 0.2s ease-in-out;
}

.navbar .nav-link:hover {
    color: #90cea1 !important;
}


/* --- Main Content Area --- */
.page-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.page-header h1 {
    font-weight: 600;
}


/* --- Footer --- */
.footer {
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--secondary-color);
}

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

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #003d82;
    text-decoration: underline;
}

/* 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: #90cea1 !important;
    font-weight: 600;
    position: relative;
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 2px;
    background-color: #90cea1;
}

/* Dropdown hover effects - Fixed version */
@media (min-width: 992px) {
    .dropdown-menu .dropdown-item:hover {
        background-color: #0056b3;
        color: white;
    }
}

/* Dropdown header styling - Fixed version */
.dropdown-header {
    color: #0056b3 !important;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1rem 0.25rem;
}

/* --- Nested Dropdown Styles --- */
.dropdown-submenu {
    position: relative;
}

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

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

.dropdown-item.dropdown-toggle::after {
    float: right;
    margin-top: 8px;
    margin-left: 0.755em;
    border-top: 0.3em solid transparent;
    border-right: 0;
    border-bottom: 0.3em solid transparent;
    border-left: 0.3em solid;
}

.dropdown-item.dropdown-toggle:hover::after {
    border-left-color: white;
}

/* Built-in Portfolios submenu specific styling */
#builtInPortfoliosSubmenu {
    color: #0056b3;
    font-weight: 500;
}

#builtInPortfoliosSubmenu:hover {
    background-color: #e9ecef;
    color: #0056b3;
}

/* Ensure proper spacing for nested dropdown items */
.dropdown-menu .dropdown-menu .dropdown-item {
    padding-left: 1.5rem;
    font-size: 0.9rem;
}

.dropdown-menu .dropdown-menu .dropdown-item i {
    margin-right: 0.5rem;
    width: 16px;
}