/* NOA AI RAG Chatbot Stylesheet - Dark Obsidian & Neon Cyan Edition */
@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;0,700;0,900;1,400&family=Outfit:wght@400;600;700;900&display=swap');

:root {
    --rag-font: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --rag-primary: #06B6D4;
    --rag-primary-hover: #0891B2;
    --rag-primary-dark: #090D16;
    --rag-primary-light: #ECFEFF;
    --rag-secondary: #8B5CF6;
    --rag-accent: #3B82F6;
    --rag-success: #10B981;
    --rag-warning: #F59E0B;
    --rag-danger: #EF4444;
    --rag-info: #06B6D4;
    --rag-dark: #090D16;
    --rag-sidebar-bg: #090D16;
    --rag-sidebar-color: #A5F3FC;
    --rag-body-bg: #0F172A;
    --rag-card-bg: #1E293B;
    --rag-border: #334155;
    --rag-radius: 14px;
    --rag-shadow: 0 4px 20px -2px rgba(6, 182, 212, 0.12);
    --rag-shadow-hover: 0 12px 28px -4px rgba(6, 182, 212, 0.25);
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: var(--rag-font);
    background-color: var(--rag-body-bg);
    color: #F8FAFC;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Master Layout Structure - 100% Full Width Coverage */
#wrapper {
    display: flex;
    width: 100%;
    min-width: 100%;
    align-items: stretch;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Sidebar Styles */
#sidebar {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #090D16 0%, #020617 100%);
    color: var(--rag-sidebar-color);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.3s ease;
    z-index: 1040;
    box-shadow: 4px 0 25px rgba(0,0,0,0.4);
    overflow-y: auto;
    max-height: 100vh;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

#sidebar .sidebar-brand {
    padding: 1.25rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebar .sidebar-brand-text {
    font-weight: 900;
    font-size: 1.3rem;
    color: #FFFFFF;
    letter-spacing: -0.5px;
    font-family: 'Outfit', 'Roboto', sans-serif;
}

#sidebar .sidebar-menu {
    padding: 1rem 0.75rem;
    list-style: none;
    margin: 0;
}

#sidebar .menu-header {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #67E8F9;
    padding: 0.85rem 1rem 0.35rem;
}

#sidebar .nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.9rem;
    color: #A5F3FC;
    font-weight: 500;
    font-size: 0.86rem;
    border-radius: 9px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
    text-decoration: none;
}

#sidebar .nav-link .nav-link-content {
    display: flex;
    align-items: center;
}

#sidebar .nav-link i.menu-icon {
    font-size: 1.15rem;
    margin-right: 0.75rem;
    transition: color 0.2s ease;
}

#sidebar .nav-link:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.1);
}

#sidebar .nav-link.active {
    color: #FFFFFF;
    background: linear-gradient(135deg, #06B6D4 0%, #3B82F6 100%);
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.4);
}

/* Accordion Sub-Menu Animations & Formatting */
#sidebar .sub-menu {
    list-style: none;
    padding-left: 2.2rem;
    margin: 0.2rem 0;
}

#sidebar .sub-menu .sub-nav-link {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    color: #A5F3FC;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

#sidebar .sub-menu .sub-nav-link:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
}

#sidebar .sub-menu .sub-nav-link.active {
    color: #A855F7;
    font-weight: 700;
}

#sidebar .sub-menu .sub-nav-link::before {
    content: "•";
    margin-right: 0.5rem;
    font-size: 1.2rem;
    line-height: 0;
}

/* Rotate arrow when sub-menu expanded */
#sidebar .nav-link[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
    transition: transform 0.2s ease;
}

/* Content Wrapper */
#content-wrapper {
    flex: 1 1 0%;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

main.container-fluid {
    width: 100%;
    max-width: 100%;
    padding: 1.5rem 1.75rem !important;
}

/* Navbar */
.top-navbar {
    height: 72px;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rag-border);
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 999;
    width: 100%;
}

/* Card Styling */
.card-custom {
    background: var(--rag-card-bg);
    border-radius: var(--rag-radius);
    border: 1px solid var(--rag-border);
    box-shadow: var(--rag-shadow);
    transition: all 0.25s ease;
    margin-bottom: 1.5rem;
    width: 100%;
    color: #F8FAFC;
}

.card-custom:hover {
    box-shadow: var(--rag-shadow-hover);
}

.stat-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-icon-primary { background: rgba(6, 182, 212, 0.2); color: #06B6D4; }
.stat-icon-success { background: rgba(16, 185, 129, 0.2); color: #10B981; }
.stat-icon-warning { background: rgba(245, 158, 11, 0.2); color: #F59E0B; }
.stat-icon-danger { background: rgba(239, 68, 68, 0.2); color: #EF4444; }
.stat-icon-info { background: rgba(139, 92, 246, 0.2); color: #A855F7; }

/* Table Custom */
.table-custom {
    vertical-align: middle;
    width: 100%;
    color: #F8FAFC;
}
.table-custom th {
    background-color: #0F172A;
    color: #38BDF8;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--rag-border);
    padding: 0.85rem 0.85rem;
    white-space: nowrap;
}
.table-custom td {
    padding: 0.85rem 0.85rem;
    color: #E2E8F0;
    font-size: 0.88rem;
    border-bottom: 1px solid #334155;
    white-space: nowrap;
}

/* Chat Bubbles Component */
.chat-bubble-user {
    background: linear-gradient(135deg, #06B6D4 0%, #3B82F6 100%);
    color: #FFFFFF;
    border-radius: 18px 18px 2px 18px;
    padding: 1rem 1.25rem;
    max-width: 82%;
    margin-left: auto;
}

.chat-bubble-ai {
    background: #1E293B;
    border: 1px solid #334155;
    color: #F8FAFC;
    border-radius: 18px 18px 18px 2px;
    padding: 1.25rem;
    max-width: 90%;
}

.citation-box {
    background: rgba(6, 182, 212, 0.1);
    border-left: 3px solid #06B6D4;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
    margin-top: 0.75rem;
}

/* Footer Styling */
footer.footer {
    width: 100%;
    margin-top: auto;
    padding: 1rem 1.75rem;
    background: #090D16;
    border-top: 1px solid #334155;
}

/* Responsive Media Queries */
@media (min-width: 992px) {
    #sidebar.toggled {
        margin-left: -280px;
    }
}

@media (max-width: 991.98px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }
    #sidebar.toggled {
        transform: translateX(0);
    }
    .top-navbar {
        padding: 0 1rem;
        height: 64px;
    }
    main.container-fluid {
        padding: 1rem !important;
    }
}
