/* ApexCharts custom tooltip for EarthNodes */
.apexcharts-tooltip-custom {
    background: var(--kt-gray-800);
    color: var(--kt-gray-100);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* Ensure chart containers don't overflow */
[id^="kt_earthnodes_chart_"] {
    overflow: visible !important;
}

/* Light mode tooltip adjustment */
[data-bs-theme="light"] .apexcharts-tooltip-custom {
    background: var(--kt-gray-900);
    color: var(--kt-gray-100);
}
.row.g-6 {
        display: flex;
        flex-wrap: wrap;
    }

    .col-xl-4.col-md-6 {
        display: flex;
        flex-direction: column;
    }
    /* Node Card Styling */
    .node-card-container {
        flex: 1 1 100%;
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 350px; /* Increase if needed for more content */
        margin-bottom: 1rem;
    }

    .node-card-inner {
        flex: 1 1 auto;
        position: relative;
        width: 100%;
        height: 100%;
        transition: transform 0.8s;
        transform-style: preserve-3d;
        min-height: 350px; /* Match min-height above */
    }


    .card-body.flex-grow-1.overflow-auto {
        overflow: auto;
        min-height: 0; /* Required for flexbox scrolling */
    }

    .node-card-inner.flipped {
        transform: rotateY(180deg);
    }

    .node-card-back,
    .node-card-front {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 350px;
        position: absolute;
        width: 100%;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        border-radius: 0.75rem;
        /* Remove overflow: auto here */
    }

    .node-card-front {
        z-index: 1;
    }

    .node-card-back {
        transform: rotateY(180deg);
    }

    /* Theme aware cards */
    .theme-card {
        background-color: #ffffff;
        border: 1px solid #e4e6ef;
    }

    .theme-card-secondary {
        background-color: #f5f8fa;
        border: 1px solid #e4e6ef;
    }

    [data-bs-theme="dark"] .theme-card {
        background-color: #1e1e2d;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    [data-bs-theme="dark"] .theme-card-secondary {
        background-color: #2b2b40;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Text colors for theme awareness */
    .node-title {
        color: #181c32;
    }

    .node-subtitle {
        color: #a1a5b7;
    }

    .node-label {
        color: #5e6278;
    }

    .node-value {
        color: #7e8299;
    }

    [data-bs-theme="dark"] .node-title {
        color: #ffffff;
    }

    [data-bs-theme="dark"] .node-subtitle {
        color: #9899ac;
    }

    [data-bs-theme="dark"] .node-label {
        color: #9899ac;
    }

    [data-bs-theme="dark"] .node-value {
        color: #cdcdde;
    }

    /* Premium shadow and glow effects - much more dramatic */
    .premium-card-glow {
        border-radius: 0.75rem;
        transition: all 0.4s ease;
        position: relative;
    }

    /* Light theme premium glow */
    [data-bs-theme="light"] .premium-card-glow {
        box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.1), 0 0 30px rgba(50, 100, 255, 0.15), 0 0 10px rgba(65, 125, 255, 0.15), inset 0 0 0.5px rgba(255, 255, 255, 0.6);
    }

    /* Dark theme premium glow */
    [data-bs-theme="dark"] .premium-card-glow {
        box-shadow: 0 0.75rem 2.5rem rgba(0, 0, 0, 0.3), 0 0 30px rgba(0, 80, 255, 0.25), 0 0 15px rgba(60, 85, 185, 0.3), inset 0 0 1px rgba(255, 255, 255, 0.2);
    }

    /* Add subtle color edge to cards */
    [data-bs-theme="light"] .premium-card-glow::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 0.75rem;
        background: linear-gradient(135deg, rgba(65, 125, 255, 0.15) 0%, rgba(50, 100, 150, 0) 50%, rgba(65, 125, 255, 0.1) 100%);
        z-index: -1;
        pointer-events: none;
    }

    [data-bs-theme="dark"] .premium-card-glow::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 0.75rem;
        background: linear-gradient(135deg, rgba(60, 85, 185, 0.25) 0%, rgba(0, 80, 255, 0) 50%, rgba(60, 85, 185, 0.2) 100%);
        z-index: -1;
        pointer-events: none;
    }

    /* Premium stats card glow effects */
    .premium-stat-glow {
        border-radius: 0.75rem;
        transition: all 0.4s ease;
        position: relative;
    }

    /* Light theme stats card */
    [data-bs-theme="light"] .premium-stat-glow {
        box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.08), 0 0 20px rgba(50, 100, 150, 0.12), 0 0 5px rgba(65, 125, 255, 0.1);
    }

    /* Dark theme stats card */
    [data-bs-theme="dark"] .premium-stat-glow {
        box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.2), 0 0 20px rgba(0, 80, 255, 0.2), 0 0 5px rgba(60, 85, 185, 0.2);
    }

    /* Elevated hover effect */
    .hover-elevate-up {
        transition: transform 0.4s ease, box-shadow 0.4s ease;
    }

        .hover-elevate-up:hover {
            transform: translateY(-8px);
        }

    /* Light theme hover glow */
    [data-bs-theme="light"] .hover-elevate-up:hover {
        box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.15), 0 0 40px rgba(50, 100, 255, 0.3), 0 0 15px rgba(65, 125, 255, 0.25);
    }

    /* Dark theme hover glow */
    [data-bs-theme="dark"] .hover-elevate-up:hover {
        box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.35), 0 0 45px rgba(0, 80, 255, 0.35), 0 0 20px rgba(60, 85, 185, 0.4);
    }

    /* Glow effect for button */
    .glow-effect {
        animation: glow 2s infinite alternate;
    }

    .pulse-btn {
        box-shadow: 0 0 0 rgba(255, 255, 255, 0.1);
        transition: all 0.3s ease;
    }

        .pulse-btn:hover {
            box-shadow: 0 0 25px rgba(100, 150, 255, 0.5);
        }

    [data-bs-theme="dark"] .pulse-btn:hover {
        box-shadow: 0 0 30px rgba(100, 150, 255, 0.7);
    }

    @keyframes glow {
        from {
            box-shadow: 0 0 10px rgba(100, 150, 255, 0.4);
        }

        to {
            box-shadow: 0 0 25px rgba(100, 150, 255, 0.7);
        }
    }

    /* Separator styling based on theme */
    .theme-separator {
        border-bottom: 1px dashed #e4e6ef;
        opacity: 0.6;
    }

    [data-bs-theme="dark"] .theme-separator {
        border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
    }

    /* Make sure stat cards have consistent height */
    .card-xl-stretch {
        height: calc(100% - 1.5rem);
    }

    /* Ensure sidebar menu items are visible */
    #kt_app_sidebar_menu .menu-item {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    #kt_app_sidebar_menu .menu-sub {
        display: block !important;
    }

    /* Hide submenu text when minimized, but keep structure */
    body.app-sidebar-minimize #kt_app_sidebar_menu .menu-sub .menu-title {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    /* Show submenu text on hover when minimized */
    body.app-sidebar-minimize #kt_app_sidebar:hover #kt_app_sidebar_menu .menu-sub .menu-title {
        opacity: 1;
        visibility: visible;
    }

    /* Ensure proper submenu positioning when minimized */
    body.app-sidebar-minimize #kt_app_sidebar_menu .menu-sub {
        position: absolute;
        left: 100%;
        top: 0;
        background: var(--bs-body-bg);
        box-shadow: 0 0 20px rgba(0,0,0,0.1);
        min-width: 200px;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    /* Show submenu on hover when minimized */
    body.app-sidebar-minimize #kt_app_sidebar_menu .menu-item:hover > .menu-sub,
    body.app-sidebar-minimize #kt_app_sidebar_menu .menu-item.hover > .menu-sub {
        opacity: 1;
        visibility: visible;
    }

    /* Prevent menu items from being hidden */
    .menu-item, .menu-sub-item {
        display: block !important;
    }

    /* Fix for accordion behavior in minimized state */
    body.app-sidebar-minimize #kt_app_sidebar_menu .menu-accordion {
        overflow: visible !important;
    }