/*
Theme Name: Asguard IDE
Theme URI: https://asguard.pro
Description: A custom Dark IDE (Breeze/VS Code) styled theme for Asguard Networks. v2.1 Precision.
Author: Gemini CLI & User
Version: 2.1.2
Text Domain: asguard-ide
*/



:root {
    /* UNIFIED TYPOGRAPHY */
    --ide-font-mono: 'Fira Code', 'Cascadia Code', monospace;
    --ide-font-sans: 'Roboto', 'Segoe UI', sans-serif;
    --ide-font-size: 14px;
    --ide-line-height: 1.6;

    --breeze-bg: #232629;
    --breeze-paper: #31363b;
    --breeze-text: #eff0f1;
    --breeze-dim: #7f8c8d;
    --asguard-orange: #f7992b;
    --asguard-blue: #3daee9;
    --border-color: #4d5052;
    --sidebar-w: 45px;
    --bar-h: 45px;
}

/* 1. RESET & ISOLATION */
* { box-sizing: border-box !important; margin: 0; padding: 0; }
html, body { 
    width: 100% !important; 
    min-height: 100% !important; 
    background: var(--breeze-bg) !important; 
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
}

/* WP Specific Resets */
p:last-child { margin-bottom: 0; }
.entry-content > *:first-child { margin-top: 0; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4, h5, h6 { color: #fff; font-family: 'Fira Code', monospace; }

/* 1.1 ADMIN BAR OVERLAYS */
#wpadminbar { position: fixed !important; top: 0 !important; z-index: 999999 !important; opacity: 0.95; }
html { margin-top: 0 !important; }
.admin-bar .ide-window { margin-top: 45px !important; }
@media (max-width: 782px) {
    .admin-bar .ide-window { margin-top: 46px !important; }
}

/* BRUTAL HIDE: Anything outside the IDE window is destroyed */
body > *:not(.ide-window):not(.cyber-chat-window):not(#wpadminbar):not(script):not(style) { 
    display: none !important; 
}

/* ... rest of styles ... */

.asguard-unified-footer, footer:not(.ide-status-bar), header:not(.ide-top-bar), .elementor {
    display: none !important;
}


body { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    font-family: 'Roboto', sans-serif; 
    min-height: 100vh;
}

/* 2. IDE WINDOW */
.ide-window {
    width: calc(100% - 80px); 
    max-width: 1600px; 
    height: 90vh; /* Restore fixed height on desktop */
    background: var(--breeze-paper); 
    border: 1px solid var(--border-color);
    box-shadow: 0 30px 100px rgba(0,0,0,0.5); 
    display: flex; 
    flex-direction: column;
    position: relative; 
    z-index: 10; 
    margin: 40px auto;
    overflow: hidden; /* Lock window boundaries */
    padding-bottom: 30px; /* Space for the absolute status bar */
}

/* Tablet & Mobile: No background visible above/below */
@media (max-width: 1350px) {
    body { align-items: flex-start; }
    .ide-window { 
        width: 100% !important; 
        min-height: 100vh !important; 
        height: auto !important;
        margin: 0 !important; 
        border: none !important; 
        padding-bottom: calc(30px + env(safe-area-inset-bottom)) !important;
    }
    .main-view {
        overflow: visible !important;
    }
}

/* 3. TABS BAR */
/* 3. TABS BAR & SUBMENUS */
#tabs-panel *, .ide-top-bar, .ide-tab, .ide-top-bar a {
    text-transform: lowercase !important; /* Thesis 23 - Absolute Force */
}

.ide-top-bar { 
    background: #1b1e20; display: flex; border-bottom: 1px solid var(--border-color);
    height: var(--bar-h) !important; flex-shrink: 0; position: sticky; top: 0; z-index: 1000;
    list-style: none !important; margin: 0 !important; padding: 0 !important;
}
.ide-top-bar li { position: relative; margin: 0; padding: 0; }
.ide-top-bar a, .ide-tab {
    padding: 0 20px; height: var(--bar-h) !important;
    display: inline-flex; align-items: center; gap: 8px;
    font-family: 'Fira Code', monospace; font-size: 12px; color: var(--breeze-dim);
    border-right: 1px solid var(--border-color); background: #1b1e20;
    text-decoration: none !important; cursor: pointer;
    white-space: nowrap;
    text-transform: lowercase !important; /* Thesis 23 */
}
.ide-top-bar li.current-menu-item > a, .ide-tab.active { 
    background: var(--breeze-paper); color: var(--asguard-orange); 
    box-shadow: inset 0 -2px 0 var(--asguard-orange); 
}

/* Submenu logic - Dropdown style */
.ide-top-bar li .sub-menu {
    display: none !important; 
    position: absolute !important; 
    top: 45px !important; 
    left: 0 !important;
    background: #1b1e20 !important; 
    border: 1px solid var(--border-color) !important;
    list-style: none !important; 
    padding: 0 !important; 
    min-width: 220px !important; 
    z-index: 200002 !important; /* Above everything */
    box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
}

.ide-top-bar li:hover > .sub-menu { 
    display: block !important; 
}

.ide-top-bar .sub-menu li {
    width: 100% !important;
}

.ide-top-bar .sub-menu a {
    width: 100% !important; 
    border-right: none !important; 
    border-bottom: 1px solid var(--border-color) !important;
    padding: 10px 20px !important; 
    height: auto !important;
    display: block !important;
    color: var(--breeze-dim) !important;
}

.ide-top-bar .sub-menu a:hover { 
    background: var(--breeze-paper) !important; 
    color: var(--asguard-orange) !important; 
}

@media (max-width: 768px) {
    .ide-top-bar { height: auto !important; overflow-x: visible; }
    .ide-top-bar .sub-menu { position: static; box-shadow: none; border-left: 2px solid var(--asguard-orange); margin-left: 15px; }
    #tabs-panel.open .ide-top-bar { display: flex !important; }
}


/* 4. WORKSPACE & SIDEBAR */
.main-view { display: flex; flex: 1; background: var(--breeze-paper); min-height: 0; overflow: hidden; /* Hide the sliding chat */ }

.side-bar {
    width: var(--sidebar-w); background: #2a2e32; border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column; align-items: center; flex-shrink: 0;
    z-index: 10;
}

@media (max-width: 1350px) {
    .side-bar {
        position: fixed !important; 
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important; 
        height: 100dvh !important;
        z-index: 1001 !important;
    }
    .editor-container {
        margin-left: 45px !important; /* Make room for the fixed sidebar */
    }
}

.ide-menu-toggle {
    display: none; width: 45px !important; height: 45px !important;
    background: #2a2e32; color: var(--asguard-orange); cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    text-align: center; line-height: 45px !important; font-size: 18px;
}
.side-bar-lines { padding-top: 15px; color: #4d5052; font-family: 'Fira Code', monospace; font-size: 14px; line-height: 21px; text-align: center; }

.editor-container {
    flex: 1; padding: 50px; position: relative; background: var(--breeze-paper);
    font-family: var(--ide-font-mono); font-size: var(--ide-font-size); line-height: var(--ide-line-height); color: var(--breeze-text);
    overflow-y: auto; /* Enable internal scroll on desktop */
}

@media (max-width: 768px) {
    .editor-container { overflow-y: visible; } /* Let body handle scroll on mobile */
}


/* 5. CONTENT STYLES - REFINED IDE LOOK */

h1, .hero-title { 
    font-family: 'Montserrat', sans-serif; 
    font-weight: 900; 
    font-size: clamp(28px, 4vw, 42px); /* Smaller, more elegant */
    color: #fff; 
    line-height: 1.1; 
    text-transform: uppercase;
    margin: 20px 0;
}

/* Base Text - Default to IDE Mono */
.editor-container {
    font-family: var(--ide-font-mono);
    font-size: var(--ide-font-size);
    color: var(--breeze-text);
}

/* Titles in code style */
h2, .section-title {
    font-family: var(--ide-font-mono);
    font-size: 16px;
    color: var(--asguard-orange);
    margin: 25px 0 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
}

/* Paragraphs in documents (like About) */
.code-document p, .code-document li {
    font-family: var(--ide-font-sans);
    font-size: 14px; /* Same as mono for visual balance */
    color: #ccc;
    line-height: 1.6;
}

/* Structural Elements */
.code-comment { color: var(--breeze-dim); font-style: italic; font-family: var(--ide-font-mono); }
.code-keyword { color: var(--asguard-orange); font-family: var(--ide-font-mono); }

.code-document h2::before { content: "// "; opacity: 0.5; }
.code-document p { margin-bottom: 20px; }
.code-document ul { margin: 0 0 20px 20px; list-style: none; }
.code-document ul li::before { content: "- [x] "; color: var(--asguard-blue); font-family: 'Fira Code'; margin-right: 10px; }
.code-document ol { margin: 0 0 20px 40px; font-family: 'Roboto', sans-serif; }
.code-document ol li { margin-bottom: 8px; }
.code-document ol li::marker { color: var(--asguard-orange); font-family: 'Fira Code', monospace; font-weight: bold; }

/* 5.5 WooCommerce Meta & Categories */
.product_meta {
    font-family: var(--ide-font-mono) !important;
    font-size: 13px !important;
    color: var(--breeze-dim) !important;
    margin-top: 20px;
    border-top: 1px dashed var(--border-color);
    padding-top: 15px;
}

.product_meta a {
    color: var(--asguard-orange) !important;
    text-decoration: none !important;
    background: rgba(247, 153, 43, 0.05);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid rgba(247, 153, 43, 0.2);
}

.product_meta a:hover {
    background: rgba(247, 153, 43, 0.15);
}
.woocommerce p.stars a {
    color: var(--asguard-orange) !important;
}

.woocommerce .star-rating span::before,
.woocommerce p.stars a::before {
    color: var(--asguard-orange) !important;
}

.woocommerce .star-rating::before {
    color: rgba(247, 153, 43, 0.3); /* Dim orange for empty stars */
}
.woocommerce-product-gallery, 
.woocommerce-product-gallery__image,
.woocommerce-LoopProduct-link img {
    max-width: 150px !important;
    height: auto !important;
    margin: 0 auto !important;
    border: 1px solid var(--border-color);
    padding: 5px;
    background: rgba(255,255,255,0.02);
}

.woocommerce-product-gallery {
    float: left !important;
    margin-right: 30px !important;
    margin-bottom: 20px !important;
}

/* Clearfix for product summary */
.single-product div.product .summary {
    overflow: hidden;
}
.woocommerce-MyAccount-content {
    font-family: var(--ide-font-sans);
    font-size: 14px;
    color: #ccc;
}

.woocommerce-MyAccount-content a {
    color: var(--asguard-orange) !important;
    text-decoration: none !important;
}

.woocommerce-MyAccount-content a:hover {
    text-decoration: underline !important;
}

.woocommerce-MyAccount-navigation ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.woocommerce-MyAccount-navigation ul li {
    margin-bottom: 5px !important;
}

.woocommerce-MyAccount-navigation ul li a {
    font-family: var(--ide-font-mono) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    color: var(--asguard-orange) !important;
    text-decoration: none !important;
    padding: 4px 10px !important;
    display: block !important;
    border-left: 2px solid transparent;
}

.woocommerce-MyAccount-navigation ul li a:hover,
.woocommerce-MyAccount-navigation ul li.is-active a {
    background: rgba(247, 153, 43, 0.1) !important;
    border-left-color: var(--asguard-orange) !important;
}

.woocommerce-MyAccount-navigation ul li a::before {
    content: "> ";
    opacity: 0.5;
}
.ide-faq-item { border: 1px solid var(--border-color); margin-bottom: 10px; background: rgba(0,0,0,0.2); }
.ide-faq-trigger { padding: 15px; cursor: pointer; display: flex; align-items: center; gap: 10px; font-family: 'Fira Code'; font-size: 14px; color: var(--asguard-blue); }
.ide-faq-trigger::before { content: "▼"; font-size: 10px; transition: 0.3s; }
.ide-faq-item.closed .ide-faq-trigger::before { transform: rotate(-90deg); }
.ide-faq-content { padding: 0 15px 15px 40px; color: #aaa; font-size: 14px; }
.ide-faq-item.closed .ide-faq-content { display: none; }

/* 5.3 JSON/Table Style */
.json-data { background: rgba(255,255,255,0.02); padding: 20px; border-radius: 4px; font-family: 'Fira Code', monospace; font-size: 13px; }
.json-key { color: var(--asguard-orange); }
.json-val { color: #27ae60; }

/* 5.4 File Explorer Style */
.file-explorer { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 15px; margin-top: 20px; }
.file-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; cursor: pointer; padding: 10px; border-radius: 4px; transition: 0.2s; text-decoration: none !important; }
.file-item:hover { background: rgba(255,255,255,0.05); }
.file-item i { font-size: 32px; color: var(--asguard-orange); }
.file-item span { font-size: 11px; color: #ccc; font-family: 'Fira Code'; }

/* 5.5 System Monitoring (Charts) */
.sys-monitor { border: 1px solid var(--border-color); padding: 20px; background: #000; margin-top: 20px; }
.chart-bar-container { display: flex; align-items: flex-end; gap: 4px; height: 60px; margin-top: 15px; }
.chart-bar { background: var(--asguard-blue); width: 15px; animation: pulse-height 2s ease-in-out infinite alternate; }
@keyframes pulse-height { from { height: 20%; } to { height: 100%; } }

.modules-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); /* Desktop: 4 columns */
    gap: 20px; 
    margin-top: 42px; 
}

@media (max-width: 1350px) { 
    .modules-grid { grid-template-columns: repeat(2, 1fr); } /* Tablet: 2 columns */
}

@media (max-width: 768px) {
    .modules-grid { grid-template-columns: 1fr; } 
    .editor-container { padding: 30px 20px !important; } 
    .ide-menu-toggle { display: block !important; }
    
/* MOBILE CHAT OVERLAY FIX */
.cyber-chat-window {
    position: fixed !important;
    top: 0 !important; 
    left: 0 !important;
    right: 0 !important;
    height: calc(100vh - calc(30px + env(safe-area-inset-bottom))) !important; /* Explicit height instead of bottom bounds */
    height: calc(100dvh - calc(30px + env(safe-area-inset-bottom))) !important;
    width: 100% !important;
    z-index: 500000 !important; 
    border: none !important;
    transform: translateY(150%) !important;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    overflow: hidden !important;
}

.cyber-chat-window.open {
    transform: translateY(0) !important;
}

.chat-trigger * {
    pointer-events: none !important; /* Ensure click goes to parent */
}
} /* Close @media (max-width: 768px) */


.module-card { background: rgba(255,255,255,0.03); border: 1px solid var(--border-color); padding: 30px; transition: 0.2s; display: flex; flex-direction: column; justify-content: space-between; }
.module-card:hover { border-color: #f7992b; background: rgba(247, 153, 43, 0.02); }
.module-card h3 { font-family: 'Fira Code', monospace; font-size: 16px; color: var(--asguard-orange) !important; margin: 0 0 15px; }
.btn-exe { display: inline-block; margin-top: 20px; color: var(--asguard-blue) !important; text-decoration: none; border: 1px solid var(--asguard-blue); padding: 5px 15px; font-size: 11px; align-self: flex-start; }

/* 6. STATUS BAR */
.ide-status-bar {
    background: var(--asguard-blue) !important; 
    color: #fff !important; 
    padding: 0;
    display: grid; 
    grid-template-columns: 1fr auto 1fr; 
    align-items: center;
    height: 30px; 
    min-height: 30px; 
    position: absolute; /* Absolute relative to .ide-window */
    bottom: 0; 
    left: 0;
    width: 100%; 
    z-index: 999999 !important; /* ABSOLUTE TOP */
    font-family: 'Fira Code', monospace; 
    font-size: 11px;
    padding-bottom: 0; /* Clear safe-area on desktop */
    box-sizing: content-box;
}

@media (max-width: 1350px) {
    .ide-status-bar {
        position: fixed !important;
        bottom: 0 !important;
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* LHC WIDGET SUPPRESSION (T96) */
#lhc_container_v2, .lhc-desktop, #lhc_status_widget_v2 {
    z-index: 999998 !important; /* MUST BE BELOW OUR STATUS BAR */
    pointer-events: none !important; /* Do not steal clicks from our bar */
}
#lhc_container_v2.lhc-open {
    pointer-events: auto !important; /* Allow interaction only when open */
}

@media (max-width: 768px) {
    .ide-status-bar {
        position: fixed !important; 
        bottom: 0 !important;
        left: 0 !important;
    }
}

.status-left { padding-left: 15px; display: flex; align-items: center; gap: 8px; }
.slogan { font-weight: 900; text-transform: uppercase; letter-spacing: 1px; text-align: center; white-space: nowrap; padding: 0 10px; }
.status-right { display: flex; justify-content: flex-end; align-items: center; height: 100%; white-space: nowrap; }
.chat-trigger { cursor: pointer; display: flex; align-items: center; justify-content: center; height: 30px; padding: 0 15px; }

/* 7. CHAT */
.cyber-chat-window {
    position: fixed; 
    bottom: 40px; 
    right: 40px; 
    width: 350px; 
    height: 500px;
    background: #000; 
    border: 1px solid var(--asguard-orange);
    display: none; 
    flex-direction: column; 
    font-family: 'Fira Code', monospace; 
    z-index: 100000;
}
.cyber-chat-window.open { display: flex !important; }

@media (max-width: 768px) {
    /* Mobile chat window is defined above, duplicate removed */
    
    /* FORCE MENU DISPLAY */
    #tabs-panel .ide-top-bar { display: none !important; }
    #tabs-panel.open .ide-top-bar { 
        display: flex !important; 
        flex-direction: column !important; 
        position: fixed !important; 
        top: 0 !important; 
        left: 45px !important; 
        right: 0 !important; 
        height: auto !important; 
        z-index: 150000 !important; /* Between chat and status bar */
        box-shadow: 10px 0 30px rgba(0,0,0,0.5); 
        background: #1b1e20 !important;
    }
}

/* 8. MEDIA QUERIES FOR UI */
@media (max-width: 1350px) {
    .ide-top-bar { display: none !important; }
    #tabs-panel.open .ide-top-bar { 
        display: flex !important; 
        flex-direction: column !important; 
        position: fixed !important; 
        top: 0 !important; 
        left: 45px !important; 
        right: 0 !important; 
        height: auto !important; 
        z-index: 150000 !important;
        box-shadow: 10px 0 30px rgba(0,0,0,0.5); 
        background: #1b1e20 !important;
    }
    .ide-menu-toggle { display: block !important; }
    .ide-tab, .ide-top-bar a { 
        width: 100% !important; 
        border-right: none !important; 
        border-bottom: 1px solid var(--border-color) !important; 
        height: 45px !important; 
        display: flex !important;
        align-items: center;
    }
}

@media (max-width: 800px) {
    .hide-mobile { display: none !important; }
    .ide-status-bar { grid-template-columns: 45px 1fr 45px !important; }
    .slogan { font-size: 9px; }
}

/* 8. WOOCOMMERCE BREEZE DARK ADAPTATION */
.woocommerce, .woocommerce-page { color: #ccc; font-family: 'Roboto', sans-serif; }
.woocommerce h1, .woocommerce h2, .woocommerce h3, .woocommerce h4, .woocommerce h5, .woocommerce h6, .woocommerce-loop-product__title { color: var(--asguard-orange) !important; font-family: 'Fira Code', monospace; margin-bottom: 15px; }
.woocommerce ul.products li.product a img { border: 1px solid var(--border-color); }
.woocommerce ul.products li.product::before { content: none !important; }
.woocommerce ul.products li.product .price { color: #27ae60 !important; font-family: 'Fira Code', monospace; }
.woocommerce div.product p.price { color: #27ae60 !important; font-family: 'Fira Code', monospace; font-size: 24px; }
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .woocommerce #respond input#submit {
    background: transparent !important;
    border: 1px solid var(--asguard-blue) !important;
    color: var(--asguard-blue) !important;
    font-family: 'Fira Code', monospace;
    border-radius: 0 !important;
    transition: 0.3s;
}
.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover, .woocommerce #respond input#submit:hover {
    background: var(--asguard-blue) !important;
    color: #000 !important;
}
.woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt {
    border-color: var(--asguard-orange) !important;
    color: var(--asguard-orange) !important;
}
.woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover {
    background: var(--asguard-orange) !important;
    color: #000 !important;
}
.woocommerce div.product .woocommerce-tabs ul.tabs { border-bottom: 1px solid var(--border-color) !important; padding: 0 !important; }
.woocommerce div.product .woocommerce-tabs ul.tabs li { background: #1b1e20 !important; border: 1px solid var(--border-color) !important; border-radius: 0 !important; margin: 0 !important; }
.woocommerce div.product .woocommerce-tabs ul.tabs li.active { background: var(--breeze-paper) !important; border-bottom-color: var(--asguard-orange) !important; }
.woocommerce div.product .woocommerce-tabs ul.tabs li a { color: var(--breeze-dim) !important; font-family: 'Fira Code', monospace; }
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a { color: var(--asguard-orange) !important; }
.woocommerce table.shop_table { border: 1px solid var(--border-color) !important; border-radius: 0 !important; color: #ccc; }
.woocommerce table.shop_table td, .woocommerce table.shop_table th { border-top: 1px solid var(--border-color) !important; }
.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea { background: #111 !important; border: 1px solid var(--border-color) !important; color: #fff !important; padding: 10px; font-family: 'Fira Code', monospace; }
.select2-container--default .select2-selection--single { background: #111 !important; border: 1px solid var(--border-color) !important; height: 40px !important; }
.select2-container--default .select2-selection--single .select2-selection__rendered { color: #fff !important; line-height: 40px !important; }
.woocommerce-message, .woocommerce-info, .woocommerce-error { background: #111 !important; border-top-color: var(--asguard-orange) !important; color: #fff !important; }
.woocommerce-message::before, .woocommerce-info::before { color: var(--asguard-orange) !important; }
.woocommerce-error::before { color: #e74c3c !important; }
.woocommerce-NoticeGroup { margin-bottom: 20px; }
.woocommerce-breadcrumb { color: var(--breeze-dim) !important; font-family: 'Fira Code', monospace; font-size: 12px !important; }
.woocommerce-breadcrumb a { color: var(--asguard-blue) !important; }

