/* AICnct Platform - Dashboard Styles */

/* ===== ROOT VARIABLES ===== */
:root {
    --aicnct-primary: #10367d;
    --aicnct-primary-hover: #0c2a5e;
    --aicnct-secondary: #EBEBEB;
    --aicnct-success: #28a745;
    --aicnct-info: #17a2b8;
    --aicnct-warning: #ffc107;
    --aicnct-danger: #dc3545;
    --aicnct-light: #f8f9fa;
    --aicnct-dark: #1A1A1A;
    --aicnct-accent: #2aad4d;

    --aicnct-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --aicnct-border-radius: 0.5rem;
    --aicnct-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --aicnct-box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);

    --aicnct-sidebar-width: 250px;
    --aicnct-header-height: 90px;
    --aicnct-header-height-tablet: 90px;
    --aicnct-header-height-mobile: 80px;

    /* ===== LIGHT MODE THEME VARIABLES ===== */
    --theme-bg-primary: #ffffff;
    --theme-bg-secondary: #f8f9fa;
    --theme-bg-tertiary: #e9ecef;
    --theme-bg-accent: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    --theme-text-primary: #1A1A1A;
    --theme-text-secondary: #6c757d;
    --theme-text-muted: #adb5bd;
    --theme-text-title: #1A1A1A;
    --theme-text-subtitle: #10367d;
    --theme-border-color: #dee2e6;
    --theme-border-subtle: rgba(0, 0, 0, 0.05);
    --theme-shadow: rgba(0, 0, 0, 0.075);
    --theme-shadow-lg: rgba(0, 0, 0, 0.15);
    --theme-hover-bg: rgba(16, 54, 125, 0.02);
    --theme-card-bg: #ffffff;
    --theme-card-border: transparent;
    --theme-input-bg: #ffffff;
    --theme-input-border: #ced4da;
    --theme-navbar-text: rgba(255, 255, 255, 0.85);
    --theme-navbar-text-hover: #ffffff;
    --theme-navbar-bg-hover: rgba(255, 255, 255, 0.1);
    --theme-form-section-bg: #f8f9fa;
    --theme-form-section-header-bg: #e9ecef;
    --theme-code-bg: #f8f9fa;
    --theme-primary-bg-subtle: #f8f9ff;
}

/* ===== DARK MODE THEME VARIABLES ===== */
[data-theme="dark"] {
    --aicnct-primary: #74b4da;
    --aicnct-primary-hover: #5a9ec5;
    --aicnct-secondary: #333333;
    --aicnct-light: #1a1a1a;
    --aicnct-dark: #ffffff;
    --aicnct-accent: #2aad4d;

    --theme-bg-primary: #121212;
    --theme-bg-secondary: #1a1a1a;
    --theme-bg-tertiary: #2a2a2a;
    --theme-bg-accent: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    --theme-text-primary: #ffffff;
    --theme-text-secondary: #8b949e;
    --theme-text-muted: #656d76;
    --theme-text-title: #ffffff;
    --theme-text-subtitle: #74b4da;
    --theme-border-color: #30363d;
    --theme-border-subtle: rgba(240, 246, 252, 0.1);
    --theme-shadow: rgba(0, 0, 0, 0.3);
    --theme-shadow-lg: rgba(0, 0, 0, 0.5);
    --theme-hover-bg: rgba(116, 180, 218, 0.1);
    --theme-card-bg: #1a1a1a;
    --theme-card-border: #30363d;
    --theme-input-bg: #121212;
    --theme-input-border: #30363d;
    --theme-navbar-text: rgba(240, 246, 252, 0.85);
    --theme-navbar-text-hover: #f0f6fc;
    --theme-navbar-bg-hover: rgba(240, 246, 252, 0.1);
    --theme-form-section-bg: #1a1a1a;
    --theme-form-section-header-bg: #2a2a2a;
    --theme-code-bg: #121212;
    --theme-primary-bg-subtle: rgba(116, 180, 218, 0.1);
}

/* ===== AUTO DARK MODE (SYSTEM PREFERENCE) ===== */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --aicnct-primary: #74b4da;
        --aicnct-primary-hover: #5a9ec5;
        --aicnct-secondary: #333333;
        --aicnct-light: #1a1a1a;
        --aicnct-dark: #ffffff;
        --aicnct-accent: #2aad4d;

        --theme-bg-primary: #121212;
        --theme-bg-secondary: #1a1a1a;
        --theme-bg-tertiary: #2a2a2a;
        --theme-bg-accent: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
        --theme-text-primary: #ffffff;
        --theme-text-secondary: #8b949e;
        --theme-text-muted: #656d76;
        --theme-text-title: #ffffff;
        --theme-text-subtitle: #74b4da;
        --theme-border-color: #30363d;
        --theme-border-subtle: rgba(240, 246, 252, 0.1);
        --theme-shadow: rgba(0, 0, 0, 0.3);
        --theme-shadow-lg: rgba(0, 0, 0, 0.5);
        --theme-hover-bg: rgba(116, 180, 218, 0.1);
        --theme-card-bg: #1a1a1a;
        --theme-card-border: #30363d;
        --theme-input-bg: #121212;
        --theme-input-border: #30363d;
        --theme-navbar-text: rgba(240, 246, 252, 0.85);
        --theme-navbar-text-hover: #f0f6fc;
        --theme-navbar-bg-hover: rgba(240, 246, 252, 0.1);
        --theme-form-section-bg: #1a1a1a;
        --theme-form-section-header-bg: #2a2a2a;
        --theme-code-bg: #121212;
        --theme-primary-bg-subtle: rgba(116, 180, 218, 0.1);
    }
}

/* ===== GLOBAL STYLES ===== */
html {
    height: 100%;
}

body {
    font-family: var(--aicnct-font-family);
    background-color: var(--theme-bg-secondary);
    color: var(--theme-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
    padding-top: var(--aicnct-header-height);
}

/* Responsive body padding for navbar height */
@media (max-width: 992px) {
    body {
        padding-top: var(--aicnct-header-height-tablet);
    }
}

@media (max-width: 768px) {
    body {
        padding-top: var(--aicnct-header-height-mobile);
    }
}

/* ===== TYPOGRAPHY STYLES (Design System) ===== */
/* Titles H1, H2 - Light: #1A1A1A | Dark: #FFFFFF */
h1,
h2,
.h1,
.h2 {
    color: var(--theme-text-title);
}

/* Subtitles H3, H4, H5, H6 - Light: #10367d | Dark: #74b4da */
h3,
h4,
h5,
h6,
.h3,
.h4,
.h5,
.h6 {
    color: var(--theme-text-subtitle);
}

/* Ensure H1 and H2 elements always use title color */
h1,
h2 {
    color: var(--theme-text-title) !important;
}

/* Dashboard section titles */
.dashboard-section-title {
    color: var(--theme-text-subtitle) !important;
}

/* ===== CUSTOM BOOTSTRAP OVERRIDES ===== */
.bg-primary {
    background-color: var(--aicnct-primary) !important;
}

.bg-secondary {
    background-color: var(--aicnct-secondary) !important;
}

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

/* Primary Button - Light Mode: #10367d bg, white text | Dark Mode: #74b4da bg, near-black text */
.btn-primary {
    background-color: var(--aicnct-primary);
    border-color: var(--aicnct-primary);
    color: #ffffff;
}

[data-theme="dark"] .btn-primary {
    color: #1A1A1A;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--aicnct-primary-hover);
    border-color: var(--aicnct-primary-hover);
    color: #ffffff;
}

[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-primary:focus {
    color: #1A1A1A;
}

/* Secondary Button - Light Mode: #EBEBEB bg, #10367d text | Dark Mode: #333333 bg, #74b4da text */
.btn-secondary {
    background-color: var(--aicnct-secondary);
    border-color: var(--aicnct-secondary);
    color: var(--aicnct-primary);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--aicnct-primary);
    border-color: var(--aicnct-primary);
    color: #ffffff;
}

[data-theme="dark"] .btn-secondary:hover,
[data-theme="dark"] .btn-secondary:focus {
    color: #1A1A1A;
}

/* Outline Primary Button */
.btn-outline-primary {
    color: var(--aicnct-primary);
    border-color: var(--aicnct-primary);
    background-color: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--aicnct-primary);
    border-color: var(--aicnct-primary);
    color: #ffffff;
}

[data-theme="dark"] .btn-outline-primary:hover,
[data-theme="dark"] .btn-outline-primary:focus {
    color: #1A1A1A;
}

/* Accent Button - Light Mode: #2aad4d bg, white text | Dark Mode: #2aad4d bg, white text */
.btn-accent {
    background-color: var(--aicnct-accent);
    border-color: var(--aicnct-accent);
    color: #ffffff;
    transition: all 0.2s ease;
}

.btn-accent:hover,
.btn-accent:focus {
    background-color: #238f3e;
    border-color: #238f3e;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .btn-accent {
    background-color: var(--aicnct-accent);
    color: #ffffff;
}

[data-theme="dark"] .btn-accent:hover,
[data-theme="dark"] .btn-accent:focus {
    background-color: #238f3e;
    border-color: #238f3e;
    color: #ffffff;
}

/* ===== NAVIGATION STYLES ===== */
.aicnct-navbar {
    background: #ffffff !important;
    /* White for light theme */
    box-shadow: 0 0.125rem 0.25rem var(--theme-shadow);
    border-bottom: 1px solid var(--theme-border-color);
    min-height: var(--aicnct-header-height);
    max-height: var(--aicnct-header-height);
    height: var(--aicnct-header-height);
    transition: all 0.3s ease;
    z-index: 1001;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    overflow: visible;
}

@media (max-width: 768px) {
    .aicnct-navbar {
        min-height: var(--aicnct-header-height-mobile);
        max-height: var(--aicnct-header-height-mobile);
        height: var(--aicnct-header-height-mobile);
    }
}

/* Navbar container - prevent expansion */
.aicnct-navbar .container-fluid {
    height: 100%;
    display: flex;
    align-items: center;
}

/* Dark mode navbar - very dark gray background */
[data-theme="dark"] .aicnct-navbar {
    background: #121212 !important;
    /* Very dark gray for dark theme (not pure black to avoid eye strain) */
    border-bottom: 1px solid rgba(240, 246, 252, 0.1);
}

/* Navbar text colors */
.aicnct-navbar .navbar-brand {
    color: var(--theme-text-primary) !important;
}

.aicnct-navbar .nav-link {
    color: var(--theme-text-primary) !important;
}

.aicnct-navbar .dropdown-toggle {
    color: var(--theme-text-primary) !important;
}

/* Profile icon visibility on light/dark backgrounds */
.aicnct-navbar .bi-person-circle {
    color: var(--theme-text-primary) !important;
}

/* Profile dropdown text visibility */
.aicnct-navbar .dropdown-toggle span {
    color: var(--theme-text-primary) !important;
}

/* Hide dropdown arrow/caret from profile button */
#userMenuTrigger::after {
    display: none !important;
}

/* Profile button styling - follows design system colors */
#userMenuTrigger {
    color: var(--theme-text-primary) !important;
}

#userMenuTrigger:hover {
    background-color: var(--theme-hover-bg) !important;
    border-radius: 0.5rem;
}

#userMenuTrigger .bi-person-circle {
    color: var(--theme-text-primary) !important;
}

#userMenuTrigger span {
    color: var(--theme-text-primary) !important;
}

/* User dropdown styling */
.user-dropdown {
    min-width: 280px;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    left: auto !important;
    margin-top: 0.5rem !important;
    z-index: 1050 !important;
}

/* Ensure dropdown doesn't affect navbar height on mobile/tablet */
.navbar-nav .dropdown {
    position: relative;
}

/* Fix dropdown positioning on mobile to prevent navbar expansion */
@media (max-width: 991px) {
    .user-dropdown {
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;
        left: auto !important;
        transform: none !important;
        margin-top: 0.5rem !important;
    }
}

/* Logo theme switching */
.logo-dark {
    display: none;
}

[data-theme="dark"] .logo-light {
    display: none;
}

[data-theme="dark"] .logo-dark {
    display: block;
}

/* Plan Badge Clickable Styling */
.plan-badge {
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
}

.plan-badge:hover {
    opacity: 0.9;
}

/* Free badge uses accent color */
.bg-secondary.plan-badge {
    background-color: var(--aicnct-accent) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .bg-secondary.plan-badge {
    background-color: var(--aicnct-accent) !important;
    color: #ffffff !important;
}

.navbar {
    box-shadow: 0 0.125rem 0.25rem var(--theme-shadow);
    min-height: var(--aicnct-header-height);
    transition: all 0.3s ease;
}

/* This is handled by the navbar specific styles below */

.brand-text {
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* This is handled by the navbar specific dark mode styles below */

.navbar-nav .nav-link i {
    font-size: 0.9rem;
}

/* ===== MAIN CONTENT STYLES ===== */
.main-content {
    flex: 1;
    background: var(--theme-bg-accent);
    /* Removed fixed min-height calculation that could cause spacing issues */
    transition: background 0.3s ease;
}

/* ===== SIDEBAR STYLES ===== */
:root {
    --sidebar-width-expanded: 250px;
    --sidebar-width-collapsed: 70px;
    --sidebar-bg-light: #10367d;
    --sidebar-bg-dark: #74b4da;
    --sidebar-text-light: #ffffff;
    --sidebar-text-dark: #000000;
}

.aicnct-sidebar {
    position: fixed;
    top: var(--aicnct-header-height);
    left: 0;
    width: var(--sidebar-width-expanded);
    height: calc(100vh - var(--aicnct-header-height));
    background-color: var(--sidebar-bg-light);
    color: var(--sidebar-text-light);
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Responsive sidebar top position for navbar height */
@media (max-width: 992px) {
    .aicnct-sidebar {
        top: var(--aicnct-header-height-tablet);
        height: calc(100vh - var(--aicnct-header-height-tablet));
    }
}

@media (max-width: 768px) {
    .aicnct-sidebar {
        top: var(--aicnct-header-height-mobile);
        height: calc(100vh - var(--aicnct-header-height-mobile));
    }
}

[data-theme="dark"] .aicnct-sidebar {
    background-color: var(--sidebar-bg-dark);
    color: var(--sidebar-text-dark);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .sidebar-nav .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.1);
    border-left-color: rgba(0, 0, 0, 0.5);
}

.sidebar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-left-color: #ffffff;
    font-weight: 600;
}

[data-theme="dark"] .sidebar-nav .nav-link.active {
    background-color: rgba(0, 0, 0, 0.15);
    border-left-color: #000000;
}

.sidebar-nav .nav-link i {
    font-size: 1.25rem;
    width: 24px;
    margin-right: 1rem;
}

.sidebar-nav .nav-text {
    font-size: 0.95rem;
    white-space: nowrap;
}

/* Help Box at Bottom */
.sidebar-help {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: auto;

}

[data-theme="dark"] .sidebar-help {
    border-top-color: rgba(0, 0, 0, 0.2);
}

.sidebar-help .help-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    color: inherit;
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

[data-theme="dark"] .sidebar-help .help-link {
    background-color: rgba(0, 0, 0, 0.1);
}

.sidebar-help .help-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .sidebar-help .help-link:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

.sidebar-help .help-link i {
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

/* Content Wrapper Adjustment */
.content-wrapper {
    margin-left: var(--sidebar-width-expanded);
    transition: margin-left 0.3s ease;
}

/* Mobile/Tablet: Icon-Only Sidebar */
@media (max-width: 1024px) {
    .aicnct-sidebar {
        width: var(--sidebar-width-collapsed);
    }

    .sidebar-nav .nav-text,
    .sidebar-help .help-text {
        display: none;
    }

    .sidebar-nav .nav-link {
        justify-content: center;
        padding: 1rem 0.5rem;
    }

    .sidebar-nav .nav-link i {
        margin-right: 0;
    }

    .sidebar-help .help-link {
        justify-content: center;
        padding: 0.25rem 0.5rem;
    }

    .sidebar-help .help-link i {
        margin-right: 0;
    }

    .content-wrapper {
        margin-left: var(--sidebar-width-collapsed);
    }

    footer.footer {
        margin-left: var(--sidebar-width-collapsed) !important;
    }
}

/* Very Small Screens: Hide text completely */
@media (max-width: 576px) {
    .aicnct-sidebar {
        width: var(--sidebar-width-collapsed);
    }
}

/* ===== METRIC OVERVIEW CARDS ===== */
.metric-overview-card {
    transition: all 0.3s ease;
    background: var(--theme-card-bg);
}

.metric-overview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12) !important;
}

.metric-overview-card .card-body {
    padding: 2rem 1.5rem;
}

.metric-overview-card .display-4 {
    font-size: 3rem;
    line-height: 1;
}

/* Fix button text vertical alignment in metric cards */
.metric-overview-card .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0.5rem 1rem;
}

.metric-overview-card .btn i {
    display: inline-flex;
    align-items: center;
}

/* Responsive metric card adjustments */
@media (max-width: 768px) {
    .metric-overview-card .display-4 {
        font-size: 2.5rem;
    }

    .metric-overview-card .card-body {
        padding: 1.5rem 1rem;
    }
}

/* ===== ACTIVITY CARDS (Recent Websites & Connectors) ===== */
.activity-card {
    transition: all 0.3s ease;
    background: var(--theme-card-bg);
}

.activity-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12) !important;
}

.activity-item {
    transition: background-color 0.2s ease;
    border-radius: 0.5rem;
}

.activity-item:hover {
    background-color: var(--theme-hover-bg);
}

.activity-item:last-child {
    border-bottom: none !important;
}

/* Activity item name styling */
.activity-item h5 {
    font-size: 1.125rem;
    line-height: 1.4;
}

/* Activity item badge styling */
.activity-item .badge {
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Responsive adjustments for activity cards */
@media (max-width: 768px) {
    .activity-item h5 {
        font-size: 1rem;
    }

    .activity-item .badge {
        font-size: 0.75rem !important;
        padding: 0.4rem 0.75rem !important;
    }
}

/* ===== RECENT ACTIVITY TABLE MOBILE SCROLLING ===== */
/* Ensure horizontal scrolling works on mobile devices */
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        display: block !important;
    }

    /* Ensure table cells don't wrap on mobile */
    .table-responsive .table td,
    .table-responsive .table th {
        white-space: nowrap !important;
    }

    /* Ensure code elements in table cells don't break */
    .table-responsive .table td code {
        display: inline-block;
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Ensure badges stay compact */
    .table-responsive .table .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        white-space: nowrap;
    }
}

/* ===== DASHBOARD HOME PAGE SPECIFIC STYLES ===== */

/* Dashboard metric cards */
.dashboard-metric-card {
    background: var(--theme-card-bg);
    border: 1px solid var(--theme-border-subtle);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.dashboard-metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.dashboard-metric-card .card-body {
    padding: 2rem 1.5rem;
    text-align: center;
}

/* Dashboard graph section */
.dashboard-graph-card {
    background: var(--theme-card-bg);
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dashboard-graph-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--theme-border-subtle);
}

.dashboard-graph-header h5 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--theme-text-subtitle);
    margin: 0;
}

.dashboard-graph-body {
    padding: 2rem 1.5rem;
    min-height: 400px;
}

/* AI Provider Badge Colors */
.ai-provider-badge-dashboard .badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.3rem;
}

.bg-openai {
    background-color: #10a37f !important;
    color: white !important;
}

.bg-anthropic {
    background-color: #d97706 !important;
    color: white !important;
}

.bg-google-ai {
    background-color: #4285f4 !important;
    color: white !important;
}

.bg-microsoft-ai {
    background-color: #0078d4 !important;
    color: white !important;
}

.bg-meta-ai {
    background-color: #1877f2 !important;
    color: white !important;
}

.bg-generic-ai {
    background-color: #6c757d !important;
    color: white !important;
}

/* ===== CARD STYLES ===== */
.card {
    border: 1px solid var(--theme-card-border);
    border-radius: var(--aicnct-border-radius);
    box-shadow: 0 0.125rem 0.25rem var(--theme-shadow);
    transition: all 0.3s ease;
    background: var(--theme-card-bg);
    color: var(--theme-text-primary);
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--theme-border-subtle);
    font-weight: 600;
    color: var(--theme-text-primary);
}

.card-title {
    font-weight: 700;
    margin-bottom: 0;
}

.card .btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== METRIC CARDS ===== */
.metric-card {
    background: var(--theme-card-bg);
    border-left: 4px solid var(--aicnct-primary);
    transition: all 0.3s ease;
}

.metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Enhanced metric icon container for perfect vertical centering */
.metric-icon-container {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto;
    flex-shrink: 0;
    background: var(--aicnct-primary-light);
    transition: all 0.3s ease;
}

.metric-icon-container i {
    font-size: 1.75rem;
    line-height: 1 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--theme-text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== BADGE STYLES ===== */
.badge {
    font-weight: 500;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
}

.badge-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* ===== TABLE STYLES ===== */
.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin-bottom: 0;
}

.table th {
    background-color: var(--theme-bg-tertiary);
    border-bottom: 2px solid var(--theme-border-color);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--theme-text-primary);
    padding: 0.75rem 0.5rem;
    vertical-align: top;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table td {
    vertical-align: middle;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--theme-border-subtle);
    color: var(--theme-text-primary);
    word-wrap: break-word;
    max-width: 0;
}

.table-hover tbody tr:hover {
    background-color: var(--theme-hover-bg);
}

/* Fix table header sizing issues */
.table thead th {
    font-size: 0.75rem !important;
    padding: 0.5rem 0.5rem !important;
    line-height: 1.2 !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
}

/* Ensure table cells don't overflow */
.table td,
.table th {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: none;
    min-width: auto;
}

/* Fix button overflow in table cells */
.table .btn,
.table .badge {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Ensure table responsiveness works properly */
.table-responsive {
    border: 1px solid var(--theme-border-color);
    border-radius: 0.375rem;
    overflow: hidden;
}

.table-responsive .table {
    margin-bottom: 0;
}

/* Fix sticky header positioning */
.table-responsive .table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--theme-bg-tertiary);
}

/* Ensure proper table layout */
.table {
    table-layout: auto;
    width: 100%;
}

/* Fix column width issues */
.table th:nth-child(1) {
    min-width: 120px;
}

/* Timestamp */
.table th:nth-child(2) {
    min-width: 100px;
}

/* Service Status */
.table th:nth-child(3) {
    min-width: 100px;
}

/* Service */
.table th:nth-child(4) {
    min-width: 80px;
}

/* Method */
.table th:nth-child(5) {
    min-width: 150px;
}

/* URL/Endpoint */
.table th:nth-child(6) {
    min-width: 80px;
}

/* Status */
.table th:nth-child(7) {
    min-width: 100px;
}

/* Response Time */
.table th:nth-child(8) {
    min-width: 120px;
}

/* User Agent */
.table th:nth-child(9) {
    min-width: 100px;
}

/* IP Address */
.table th:nth-child(10) {
    min-width: 100px;
}

/* Actions */

/* Ensure badges and buttons fit properly */
.table .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== TEAM MEMBERS TABLE SPECIFIC STYLES ===== */
.table .d-flex.align-items-center {
    align-items: center;
}

.table .bg-primary.bg-opacity-10.rounded-circle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.table .fw-semibold {
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.table small.text-muted {
    line-height: 1.2;
    display: block;
}

.table .badge {
    display: inline-block;
    vertical-align: middle;
}

.table .btn-group {
    display: flex;
    align-items: center;
}

.table .btn-group .btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== FIX TABLE ALIGNMENT ISSUES ===== */
.table td {
    padding: 0.75rem 0.5rem !important;
    text-align: left !important;
}

/* Ensure consistent spacing for all rows */
.table tbody tr td {
    vertical-align: middle !important;
    padding: 0.75rem 0.5rem !important;
}

/* Styling for the card body */
.card .table tbody tr td:first-child {
    padding-left: 0.75rem;
    text-align: left;
}

.card .table tbody tr td:first-child .d-flex {
    justify-content: flex-start;
    align-items: center;
    width: 100%;
}

.card .table tbody tr td:first-child .bg-primary.bg-opacity-10.rounded-circle {
    flex-shrink: 0;
    margin-right: 0.75rem;
    margin-left: 0;
    width: 40px;
    height: 40px;
}

.card .table tbody tr td:first-child>div>div:last-child {
    flex-grow: 1;
    min-width: 0;
}

/* Force all rows to have identical structure */
.card .table tbody tr {
    height: auto;
}

.card .table tbody tr td {
    border: none;
    background: transparent;
}

/* Ensure consistent badge positioning */
.card .table tbody tr td .badge {
    display: inline-block;
    margin: 0;
    padding: 0.375rem 0.75rem;
}

/* Ensure consistent button positioning */
.card .table tbody tr td .btn-group {
    display: flex;
    justify-content: flex-end;
    margin: 0;
}

.card .table tbody tr td .btn-group .btn {
    margin: 0;
    padding: 0.375rem 0.75rem;
}

/* ===== OVERRIDE BOOTSTRAP RESPONSIVE TABLE ISSUES ===== */
.table-responsive .table {
    margin-bottom: 0 !important;
}

.table-responsive .table tbody tr td {
    white-space: normal !important;
    min-width: 0 !important;
}

/* Override any Bootstrap table hover effects that might cause alignment issues */
.table-hover tbody tr:hover td {
    background-color: var(--theme-hover-bg);
    transform: none;
    transition: none;
}

/* Ensure no floating or positioning issues */
.table tbody tr td * {
    float: none;
    position: static;
}

/* ===== TABLE STRUCTURE ENFORCEMENT ===== */
.table {
    table-layout: auto;
    width: 100%;
}

.table th,
.table td {
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== TABLE SCALING FIXES ===== */
/* Ensure table doesn't stretch beyond reasonable bounds */
.card .table-responsive .table {
    width: 100%;
    max-width: 100%;
}

/* ===== LIST GROUP STYLES ===== */
.list-group-item {
    background-color: var(--theme-card-bg);
    border: 1px solid var(--theme-border-color);
    color: var(--theme-text-primary);
    transition: all 0.2s ease;
    transform: none;
}

.list-group-item:hover {
    background-color: var(--theme-hover-bg);
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 1040;
    /* Lower than modals (1050+) */
    backdrop-filter: blur(2px);
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ===== ALERT STYLES ===== */
.alert {
    border: none;
    border-radius: var(--aicnct-border-radius);
    box-shadow: var(--aicnct-box-shadow);
}

.alert-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #0277bd;
}

.alert-success {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    color: #2e7d32;
}

.alert-warning {
    background: linear-gradient(135deg, #fffde7 0%, #fff9c4 100%);
    color: #f57f17;
}

.alert-danger {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
}

/* ===== FOOTER STYLES ===== */
footer.footer {
    margin-top: auto;
    background: var(--theme-card-bg);
    border-top: 1px solid var(--theme-border-color);
    color: var(--theme-text-secondary);
    transition: background 0.3s ease, margin-left 0.3s ease;
    padding: 0.75rem 0;
    margin-bottom: 0;
    margin-left: var(--sidebar-width-expanded);
}

/* ===== STATUS INDICATORS ===== */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-online {
    background-color: var(--aicnct-success);
    animation: pulse-green 2s infinite;
}

.status-offline {
    background-color: var(--aicnct-danger);
}

.status-warning {
    background-color: var(--aicnct-warning);
    animation: pulse-yellow 2s infinite;
}

/* ===== ANIMATIONS ===== */
@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

@keyframes pulse-yellow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* ===== RESPONSIVE DESIGN ===== */

/* ===== RESPONSIVE NAVIGATION ===== */
/* Brand responsiveness */
.brand-text-short {
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* Navigation text responsive classes */
.nav-text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Compact navbar styles for smaller screens */
@media (max-width: 1200px) {
    .aicnct-navbar .navbar-nav .nav-link {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.85rem;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .nav-text {
        font-size: 0.85rem;
    }
}

@media (max-width: 992px) {
    .aicnct-navbar .navbar-nav .nav-link {
        padding: 0.35rem 0.5rem !important;
        font-size: 0.8rem;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .nav-text {
        font-size: 0.8rem;
    }

    /* Make navbar more compact vertically */
    .aicnct-navbar {
        min-height: 50px;
    }
}

@media (max-width: 768px) {

    .card-body {
        padding: 1rem;
    }

    .metric-value {
        font-size: 2rem;
    }

    .table-responsive {
        border-radius: var(--aicnct-border-radius);
    }

    .navbar-brand {
        font-size: 1rem;
    }

    /* Mobile navbar adjustments */
    .aicnct-navbar {
        min-height: 45px;
        padding: 0.25rem 0.5rem;
    }

    .navbar-toggler {
        padding: 0.15rem 0.3rem;
        font-size: 0.9rem;
    }

    /* Mobile navigation menu */
    .navbar-collapse {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .navbar-nav .nav-link {
        padding: 0.6rem 1rem !important;
        font-size: 0.95rem !important;
        border-radius: 0.375rem;
        margin: 0.1rem 0;
    }

    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link.active {
        background-color: rgba(255, 255, 255, 0.15);
        margin-left: 0.25rem;
        padding-left: 1.25rem !important;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .row.g-4 {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }

    .metric-value {
        font-size: 1.75rem;
    }

    .card-header .btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.border-left-primary {
    border-left: 4px solid var(--aicnct-primary) !important;
}

.border-left-success {
    border-left: 4px solid var(--aicnct-success) !important;
}

.border-left-info {
    border-left: 4px solid var(--aicnct-info) !important;
}

.border-left-warning {
    border-left: 4px solid var(--aicnct-warning) !important;
}

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

.shadow-hover {
    transition: box-shadow 0.3s ease;
}

.shadow-hover:hover {
    box-shadow: var(--aicnct-box-shadow-lg);
}

/* ===== UI STRETCHING FIXES ===== */
* {
    /* Prevent transform accumulation and ensure consistent sizing */
    box-sizing: border-box;
}

html,
body {
    /* Ensure proper viewport scaling */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Force proper aspect ratio for all elements */
.card,
.btn,
.badge,
.alert,
.list-group-item {
    /* Prevent distortion by ensuring transforms don't accumulate */
    transform-style: preserve-3d;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* Reset any inherited transforms */
    transform: none !important;
}

/* CRITICAL FIX: Force circular elements to maintain perfect circles */
.rounded-circle {
    /* Override Bootstrap's rounded-circle for perfect circles */
    border-radius: 50% !important;
    /* Force square aspect ratio for all circular elements */
    aspect-ratio: 1 / 1 !important;
    /* Ensure width equals height */
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
}

/* ===== ENHANCED ICON CENTERING SYSTEM ===== */

/* Perfect circular icon containers for dashboard metrics */
.bg-opacity-10.rounded-circle.d-inline-flex {
    /* Force exact dimensions to prevent oval distortion */
    width: 80px !important;
    height: 80px !important;
    min-width: 80px !important;
    min-height: 80px !important;
    max-width: 80px !important;
    max-height: 80px !important;
    /* Ensure perfect circle */
    border-radius: 50% !important;
    /* Center the icon inside */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    /* Prevent content from affecting dimensions */
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    /* Remove problematic padding that can cause distortion */
    padding: 0 !important;
    /* Force box-sizing */
    box-sizing: border-box !important;
    /* Center the circle container itself */
    margin: 0 auto !important;
    position: relative !important;
}

/* Enhanced icon centering for ALL circular containers */
.rounded-circle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

/* Perfect icon centering for ALL icons inside any container */
.rounded-circle i,
.metric-icon-container i,
.connector-icon i,
.bg-opacity-10 i,
.d-inline-flex i {
    /* Perfect vertical and horizontal centering */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    /* Prevent icon from affecting parent dimensions */
    width: auto !important;
    height: auto !important;
    /* Center text inside icon */
    text-align: center !important;
    vertical-align: middle !important;
}

/* Button icon centering improvements */
.btn i {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    margin: 0 !important;
}

/* Navigation icon centering */
.nav-link i,
.navbar-nav i,
.dropdown-item i {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    width: auto !important;
    height: auto !important;
}

/* Statistics card icon improvements */
.fa-2x {
    line-height: 1 !important;
    vertical-align: middle !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Card body icon centering for d-flex layouts */
.card-body .d-flex .fas,
.card-body .d-flex .bi,
.card-body .d-flex i {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    margin: 0 !important;
}

/* Specific improvements for metric cards with icons on the right */
.card-body .d-flex.justify-content-between .fas,
.card-body .d-flex.justify-content-between .bi {
    align-self: center !important;
    margin: 0 !important;
    line-height: 1 !important;
}

/* Smaller circular elements (like in lists) */
.bg-opacity-10.rounded-circle.p-2 {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    /* Center the circle container itself */
    margin: 0 auto !important;
}

/* Ensure icons inside circular containers don't distort the container */
.rounded-circle i {
    /* Prevent icons from affecting parent dimensions */
    width: auto !important;
    height: auto !important;
    line-height: 1 !important;
    /* Center the icon */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    /* Ensure icon stays centered */
    margin: 0 !important;
    text-align: center !important;
}

/* Additional centering for the container of circular elements */
.text-center .mb-3 {
    /* Ensure the container itself centers the circle */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Alternative approach - center via text alignment for inline-flex elements */
.card-body.text-center .d-inline-flex.rounded-circle {
    /* Override inline-flex to use block for proper centering */
    display: flex !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Override hover transforms to prevent accumulation */
/* Removed duplicate card hover effect for better UX */

/* Ensure navbar links don't accumulate transforms */
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1);
    /* Use padding instead of transform */
    padding-top: calc(0.5rem - 1px) !important;
    padding-bottom: calc(0.5rem + 1px) !important;
    transition: all 0.2s ease;
}

.navbar-nav .nav-link:not(:hover):not(.active) {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* Fix list group item transforms */
.list-group-item:hover {
    background-color: rgba(0, 102, 204, 0.02);
    transition: all 0.2s ease;
}

/* Ensure metric cards maintain proper proportions */
.metric-icon {
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    max-width: 60px;
    max-height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    /* Prevent any distortion */
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
}

/* Force consistent button dimensions */
.btn {
    /* Prevent button distortion */
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
    /* Ensure buttons maintain proper aspect ratio */
    min-height: 38px;
}

/* Reset any problematic transforms on all interactive elements */
.btn:hover,
.btn:focus,
.btn:active {
    transform: none !important;
}

/* ===== DROPDOWN BUTTON FIXES ===== */
/* Prevent dropdown button sizing glitches */
.btn-group .dropdown-toggle {
    min-width: auto !important;
    max-width: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    transition: all 0.2s ease !important;
}

/* Prevent button expansion during dropdown state changes */
.btn-group .dropdown-toggle[aria-expanded="true"],
.btn-group .dropdown-toggle.show {
    transform: none !important;
    min-width: auto !important;
    max-width: none !important;
    background-color: var(--theme-hover-bg) !important;
    border-color: var(--theme-border-color) !important;
    color: var(--theme-text-primary) !important;
}

/* Fix for dropdown button in tables - prevent overflow */
.table .btn-group .dropdown-toggle {
    min-width: 70px !important;
    max-width: 120px !important;
    font-size: 0.75rem !important;
    padding: 0.25rem 0.5rem !important;
}

/* Ensure dropdown menus don't trigger button resizing */
.btn-group .dropdown-menu {
    transform: none !important;
    position: absolute !important;
    z-index: 1080 !important;
    /* Ensure dropdown opens relative to the button, not in top-right corner */
    left: 0 !important;
    right: auto !important;
    top: 100% !important;
    margin-top: 0.25rem !important;
}

/* Prevent flickering during dropdown toggle */
.btn-group .dropdown-toggle::before,
.btn-group .dropdown-toggle::after {
    display: none !important;
}

/* Fix button group alignment in tables */
.table .btn-group {
    display: inline-flex !important;
    vertical-align: middle !important;
    align-items: center !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Specific positioning for table dropdown menus */
.table .btn-group .dropdown-menu {
    /* For table rows, ensure dropdown doesn't go off-screen */
    position: absolute !important;
    left: auto !important;
    right: 0 !important;
    top: 100% !important;
    margin-top: 0.25rem !important;
    min-width: 150px !important;
    z-index: 1090 !important;
}

/* Ensure table itself doesn't create stacking context issues */
.table {
    position: relative !important;
    z-index: auto !important;
}

/* Ensure table-responsive container doesn't interfere */
.table-responsive {
    position: relative !important;
    z-index: auto !important;
}

/* Override for Actions column that's right-aligned */
.table th.text-end .btn-group .dropdown-menu,
.table td.text-end .btn-group .dropdown-menu {
    left: auto !important;
    right: 0 !important;
    z-index: 1090 !important;
}

/* Ensure card containers don't interfere with dropdown z-index */
.card {
    position: relative !important;
    z-index: auto !important;
}

.card-body {
    position: relative !important;
    z-index: auto !important;
}

/* High-priority dropdown menu styling to override any conflicts */
.dropdown-menu.show,
.btn-group .dropdown-menu.show {
    z-index: 1095 !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure Bootstrap dropdown functionality isn't overridden */
.dropdown-menu {
    display: none !important;
}

.dropdown-menu.show {
    display: block !important;
}

/* Prevent Actions button from becoming huge/black */
.btn-outline-secondary.dropdown-toggle {
    background-color: transparent !important;
    color: var(--theme-text-secondary) !important;
    border: 1px solid var(--theme-border-color) !important;
    min-height: 31px !important;
    max-height: 31px !important;
}

.btn-outline-secondary.dropdown-toggle:hover,
.btn-outline-secondary.dropdown-toggle:focus,
.btn-outline-secondary.dropdown-toggle.show {
    background-color: var(--theme-text-secondary) !important;
    color: var(--theme-bg-primary) !important;
    border-color: var(--theme-text-secondary) !important;
    transform: none !important;
}

/* Add debugging class for development */
.debug-borders * {
    outline: 1px solid red !important;
}

/* Media query to handle specific browser scaling issues */
@media screen and (-webkit-min-device-pixel-ratio: 1.25) {

    /* For high DPI displays that might cause scaling issues */
    body {
        -webkit-transform: scale(1);
        transform: scale(1);
    }
}

/* Browser zoom compensation */
@media screen and (min-resolution: 1.5dppx) {
    .rounded-circle {
        /* Extra compensation for high-res displays */
        aspect-ratio: 1 / 1 !important;
        border-radius: 50% !important;
    }
}

/* Force browser zoom reset on specific problematic elements */
.bg-opacity-10.rounded-circle {
    /* Override any browser zoom effects */
    zoom: normal !important;
    -moz-transform: scale(1) !important;
    -webkit-transform: scale(1) !important;
    transform: scale(1) !important;
}

/* ===== PRINT STYLES ===== */
@media print {

    .navbar,
    footer.footer,
    .btn,
    .loading-overlay {
        display: none !important;
    }

    .main-content {
        background: white;
    }

    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
        page-break-inside: avoid;
        transform: none !important;
        margin: 0 !important;
    }
}

/* ===== DARK MODE SPECIFIC STYLES ===== */

/* Form Controls */
.form-control,
.form-select {
    background-color: var(--theme-input-bg);
    border: 1px solid var(--theme-input-border);
    color: var(--theme-text-primary);
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--theme-input-bg);
    border-color: var(--aicnct-primary);
    color: var(--theme-text-primary);
    box-shadow: 0 0 0 0.2rem rgba(74, 158, 255, 0.25);
}

.form-control::placeholder {
    color: var(--theme-text-muted);
}

/* Input Groups */
.input-group-text {
    background-color: var(--theme-bg-tertiary);
    border: 1px solid var(--theme-input-border);
    color: var(--theme-text-secondary);
}

/* Dropdown Menus */
.dropdown-menu {
    background-color: var(--theme-card-bg);
    border: 1px solid var(--theme-border-color);
    box-shadow: 0 0.5rem 1rem var(--theme-shadow-lg);
}

.dropdown-item {
    color: var(--theme-text-primary);
    transition: all 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--theme-hover-bg);
    color: var(--theme-text-primary);
}

.dropdown-header {
    color: var(--theme-text-secondary);
}

.dropdown-divider {
    border-top: 1px solid var(--theme-border-color);
}

/* Modals */
.modal-content {
    background-color: var(--theme-card-bg);
    border: 1px solid var(--theme-border-color);
    color: var(--theme-text-primary);
}

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

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

/* Simple modal sizing - let Bootstrap handle positioning */
#requestDetailsModal .modal-dialog {
    max-width: 800px;
}

#requestDetailsModal .modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

/* Navbar specific dark mode styles */
.aicnct-navbar .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    transition: all 0.2s ease;
    font-weight: 500;
    border-radius: var(--aicnct-border-radius);
    margin: 0 0.25rem;
    padding: 0.5rem 1rem !important;
}

.aicnct-navbar .navbar-nav .nav-link:hover,
.aicnct-navbar .navbar-nav .nav-link.active {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.aicnct-navbar .navbar-brand {
    color: white !important;
    font-weight: 700;
    transition: opacity 0.2s ease;
}

.aicnct-navbar .navbar-brand:hover {
    opacity: 0.8;
    color: white !important;
}

.aicnct-navbar .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
}

.aicnct-navbar .dropdown-toggle {
    color: rgba(255, 255, 255, 0.85) !important;
}

.aicnct-navbar .dropdown-toggle:hover {
    color: white !important;
}

/* Navbar badge styling */
.navbar-badge {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Content header styling */
.content-header {
    background: var(--theme-bg-secondary);
    border-bottom: 1px solid var(--theme-border-color) !important;
    transition: all 0.3s ease;
}

.content-header-title {
    color: var(--theme-text-title) !important;
}

.content-header-subtitle {
    color: var(--theme-text-secondary) !important;
}

/* Metric components styling */
.metric-icon-container {
    background: var(--aicnct-primary-light);
    transition: all 0.3s ease;
}

.metric-icon-color {
    color: var(--aicnct-primary) !important;
}

.metric-value {
    color: var(--theme-text-primary) !important;
}

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

/* Navbar brand styling */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white !important;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.navbar-brand:hover {
    opacity: 0.8;
    color: white !important;
}

/* User dropdown specific styles */
.navbar .dropdown-toggle {
    color: var(--theme-navbar-text) !important;
    transition: all 0.2s ease;
}

.navbar .dropdown-toggle:hover {
    color: var(--theme-navbar-text-hover) !important;
}

/* User avatar styling */
.user-avatar {
    background: var(--aicnct-primary);
    color: white;
    transition: all 0.3s ease;
}

/* Dropdown menu styling */
.dropdown-menu {
    background: var(--theme-card-bg);
    border: 1px solid var(--theme-border-color);
    box-shadow: 0 0.5rem 1rem var(--theme-shadow-lg);
}

.dropdown-header {
    background: var(--theme-bg-secondary) !important;
    color: var(--theme-text-primary);
    border-bottom: 1px solid var(--theme-border-color);
}

.dropdown-item {
    color: var(--theme-text-primary);
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: var(--theme-bg-secondary);
    color: var(--theme-text-primary);
}

.dropdown-item:focus {
    background: var(--theme-bg-secondary);
    color: var(--theme-text-primary);
}

/* Dark Mode Toggle Styles */
.theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--theme-text-secondary);
    border-radius: var(--aicnct-border-radius);
    transition: all 0.2s ease;
    cursor: pointer;
}

.theme-toggle:hover {
    background-color: var(--theme-hover-bg);
    color: var(--theme-text-primary);
}

.theme-toggle i {
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

/* Progress Bars */
.progress {
    background-color: var(--theme-bg-tertiary);
}

.progress-bar {
    background-color: var(--aicnct-primary);
    transition: width 0.3s ease;
}

/* Text Color Classes */
.text-muted {
    color: var(--theme-text-muted) !important;
}

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

/* ===== CONNECTOR ICON DARK MODE FIXES ===== */
/* Fix connector icons in dark mode - ensure they remain visible */
[data-theme="dark"] .connector-icon.bg-light {
    background-color: var(--theme-bg-tertiary) !important;
    color: var(--aicnct-primary) !important;
}

/* Auto dark mode support for connector icons */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .connector-icon.bg-light {
        background-color: var(--theme-bg-tertiary) !important;
        color: var(--aicnct-primary) !important;
    }
}

/* Ensure connector icons in cards maintain proper contrast */
[data-theme="dark"] .connector-icon.bg-light.text-primary {
    background-color: var(--theme-bg-tertiary) !important;
    color: var(--aicnct-primary) !important;
    border: 1px solid var(--theme-border-color);
}

/* Auto dark mode support for connector icons with primary text */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .connector-icon.bg-light.text-primary {
        background-color: var(--theme-bg-tertiary) !important;
        color: var(--aicnct-primary) !important;
        border: 1px solid var(--theme-border-color);
    }
}

/* Dark mode transitions for all elements */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* Prevent transition on page load */
.no-transition * {
    transition: none !important;
}

/* ===== GATEWAY URL SECTION STYLES ===== */
.gateway-endpoints {
    background: var(--theme-bg-secondary);
    border: 1px solid var(--theme-border-color);
    border-radius: var(--aicnct-border-radius);
    transition: all 0.3s ease;
}

.gateway-endpoints .form-control {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    background-color: var(--theme-input-bg);
    border-color: var(--theme-input-border);
    color: var(--theme-text-primary);
}

.gateway-endpoints .form-control:focus {
    background-color: var(--theme-input-bg);
    border-color: var(--aicnct-primary);
    color: var(--theme-text-primary);
    box-shadow: 0 0 0 0.2rem rgba(74, 158, 255, 0.25);
}

.gateway-endpoints .btn-outline-secondary {
    border-color: var(--theme-border-color);
    color: var(--theme-text-secondary);
}

.gateway-endpoints .btn-outline-secondary:hover {
    background-color: var(--theme-text-secondary);
    border-color: var(--theme-text-secondary);
    color: var(--theme-bg-primary);
}

.gateway-endpoints .btn-outline-info {
    border-color: var(--aicnct-info);
    color: var(--aicnct-info);
}

.gateway-endpoints .btn-outline-info:hover {
    background-color: var(--aicnct-info);
    border-color: var(--aicnct-info);
    color: white;
}

/* Success state for copy button */
.gateway-endpoints .btn-success {
    background-color: var(--aicnct-success);
    border-color: var(--aicnct-success);
    color: white;
}

/* Dark mode specific styling for gateway section */
[data-theme="dark"] .gateway-endpoints {
    background: var(--theme-bg-tertiary);
}

/* Light mode background override */
.bg-light {
    background-color: var(--theme-bg-secondary) !important;
}

/* Dark mode override for Bootstrap .bg-light class */
[data-theme="dark"] .bg-light {
    background-color: var(--theme-bg-tertiary) !important;
    color: var(--theme-text-primary) !important;
}

/* Auto dark mode support for Bootstrap .bg-light class */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .bg-light {
        background-color: var(--theme-bg-tertiary) !important;
        color: var(--theme-text-primary) !important;
    }
}

/* Form label styling in gateway section */
.gateway-endpoints .form-label {
    color: var(--theme-text-primary) !important;
    font-size: 0.9rem;
}

/* Preview modal styles */
#endpointPreviewModal .modal-content {
    background-color: var(--theme-card-bg);
    border: 1px solid var(--theme-border-color);
}

#endpointPreviewModal .modal-header {
    background-color: var(--theme-bg-secondary);
    border-bottom: 1px solid var(--theme-border-color);
}

#endpointPreviewModal .modal-header .modal-title {
    color: var(--theme-text-primary);
}

#endpointPreviewModal .border-bottom {
    border-color: var(--theme-border-color) !important;
}

#endpointPreviewModal .text-muted {
    color: var(--theme-text-secondary) !important;
}

#endpointPreviewModal code {
    background-color: var(--theme-bg-tertiary);
    color: var(--theme-text-primary);
    border: 1px solid var(--theme-border-color);
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
}

/* Iframe loading and error states */
#iframeLoading .spinner-border {
    color: var(--aicnct-primary);
}

#iframeLoading .text-muted {
    color: var(--theme-text-secondary) !important;
}

#contentError .text-danger {
    color: var(--aicnct-danger) !important;
}

/* Content display styles */
#contentDisplay pre {
    background-color: #1e1e1e !important;
    color: #d4d4d4 !important;
    border: 1px solid var(--theme-border-color);
    border-radius: 0.375rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
}

#contentDisplay code {
    background-color: transparent !important;
    color: inherit !important;
    border: none !important;
    padding: 0 !important;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Dark mode adjustments for content display */
[data-theme="dark"] #contentDisplay pre {
    background-color: #0d1117 !important;
    color: #c9d1d9 !important;
    border-color: #21262d;
}

/* Content type badges */
#contentDisplay .badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

/* Copy content button styling */
#contentDisplay .btn-outline-secondary {
    border-color: var(--theme-border-color);
    color: var(--theme-text-secondary);
    font-size: 0.875rem;
}

#contentDisplay .btn-outline-secondary:hover {
    background-color: var(--theme-text-secondary);
    border-color: var(--theme-text-secondary);
    color: var(--theme-bg-primary);
}

#contentDisplay .btn-success {
    background-color: var(--aicnct-success);
    border-color: var(--aicnct-success);
    color: white;
}

/* Responsive adjustments for gateway URLs */
@media (max-width: 768px) {
    .gateway-endpoints .input-group {
        flex-wrap: wrap;
    }

    .gateway-endpoints .form-control {
        min-width: 0;
        flex: 1;
        font-size: 0.8rem;
        margin-bottom: 0.25rem;
    }

    .gateway-endpoints .btn {
        font-size: 0.8rem;
        padding: 0.375rem 0.5rem;
    }

    .gateway-endpoints .form-label {
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .gateway-endpoints .col-lg-6 {
        margin-bottom: 1rem !important;
    }

    .gateway-endpoints .input-group .btn {
        width: 100%;
        margin-top: 0.25rem;
    }

    .gateway-endpoints .input-group {
        flex-direction: column;
    }

    .gateway-endpoints .form-control {
        border-radius: var(--aicnct-border-radius) !important;
        margin-bottom: 0.5rem;
    }

    .gateway-endpoints .btn {
        border-radius: var(--aicnct-border-radius) !important;
        margin-bottom: 0.25rem;
    }

    /* Stack buttons horizontally on very small screens */
    .gateway-endpoints .btn:last-child {
        margin-bottom: 0;
    }
}

/* ===== RESPONSIVE USER DROPDOWN STYLES ===== */
.user-dropdown,
.user-dropdown-desktop {
    min-width: 260px !important;
    max-width: 90vw;
}

/* Mobile user dropdown - simplified */
@media (max-width: 991.98px) {
    .user-dropdown {
        min-width: 240px !important;
        right: 0.5rem !important;
        left: auto !important;
    }

    .user-dropdown .dropdown-item {
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem;
    }

    .user-dropdown .dropdown-header {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .user-dropdown .user-avatar {
        width: 32px !important;
        height: 32px !important;
    }
}

/* Desktop user dropdown - full featured */
@media (min-width: 992px) {
    .user-dropdown-desktop {
        min-width: 280px !important;
    }
}

/* Ensure dropdown doesn't go off screen */
.dropdown-menu {
    transform: none !important;
}

.dropdown-menu.dropdown-menu-end {
    --bs-position: end;
}

/* Brand text responsiveness */
@media (max-width: 575.98px) {
    .brand-text {
        display: none !important;
    }

    .brand-text-short {
        display: inline !important;
    }

    .navbar-brand {
        font-size: 1.1rem !important;
    }
}

@media (min-width: 576px) {
    .brand-text-short {
        display: none !important;
    }
}

/* Navigation link responsive padding and sizing */
@media (max-width: 1199.98px) {
    .aicnct-navbar .navbar-nav .nav-link {
        padding: 0.4rem 0.5rem !important;
        font-size: 0.85rem;
    }

    .aicnct-navbar .navbar-nav .nav-link i {
        font-size: 0.8rem;
    }
}

@media (max-width: 991.98px) {
    .aicnct-navbar .navbar-nav .nav-link {
        padding: 0.35rem 0.4rem !important;
        font-size: 0.8rem;
    }

    .nav-text {
        font-size: 0.8rem;
    }

    /* Make "Gateway Health" shorter on smaller screens */
    .nav-text.d-xl-none {
        font-size: 0.75rem;
    }
}

/* Ensure navigation always fits */
@media (max-width: 575.98px) {
    .aicnct-navbar .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .navbar-toggler {
        border: none !important;
        padding: 0.25rem !important;
    }

    .navbar-brand .badge {
        display: none !important;
    }
}

/* Fix for very narrow screens */
@media (max-width: 359px) {
    .aicnct-navbar .navbar-nav .nav-link {
        padding: 0.3rem 0.3rem !important;
        font-size: 0.75rem;
    }

    .nav-text {
        display: none;
    }

    .aicnct-navbar .navbar-nav .nav-link i {
        margin-right: 0 !important;
    }
}

/* ===== TEAM MEMBERS TABLE SPECIFIC STYLING ===== */
/* Team Members card specific styling */
.card .card-header h5 {
    margin-bottom: 0;
}

/* Ensure consistent spacing in team members table */
.card .table-responsive .table tbody tr td {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
}

/* Optimize team members table for different screen sizes */
@media (max-width: 1200px) {
    .card .table-responsive {
        max-width: 100%;
        margin: 0;
    }

    .card .table-responsive .table {
        min-width: 100%;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .card .table-responsive .table {
        font-size: 0.85rem;
    }

    .card .table-responsive .table tbody tr td {
        padding: 0.75rem 0.5rem;
    }

    .card .table-responsive .table .btn-group .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
}