/*
Theme Name: MJ Terminal
Theme URI: https://aljasem.eu.org
Author: Mohamad AlJasem
Author URI: https://aljasem.eu.org
Description: A retro Blue Screen of Death inspired WordPress theme with CRT effects and modern WordPress customization options. Includes WPBakery Page Builder support with custom terminal elements.
Version: 1.1.76
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mj-terminal
Tags: retro, blue-screen, terminal, portfolio, research, custom-menu, featured-images, custom-post-types, page-builder, wpbakery
*/

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #000080; /* Navy blue - BSoD color */
    overflow-x: hidden;
    font-size: 20px;
    line-height: 25px;
    color: #ffffff;
    font-family: 'Courier New', monospace;
}

canvas {
    display: block;
    height: 100dvh;
    width: 100dvw;
    position: fixed;
    top: 0;
    z-index: 1;
    pointer-events: none;
}

pre {
    color: #ffff00; /* Yellow for ASCII art */
    font-size: 16px;
    line-height: 13px;
    font-family: 'Courier New', monospace;
    white-space: pre;
    overflow-x: auto;
}

/* Navigation */
.navbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background-color: #000080;
    position: relative;
}

.navbar .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.navbar-expand-lg {
    flex-flow: row nowrap;
    justify-content: flex-start;
}

/* Ensure navbar items are aligned on desktop */
@media screen and (min-width: 992px) {
    .navbar-expand-lg .navbar-nav {
        flex-direction: row;
        align-items: center;
    }
    
    .navbar-expand-lg .navbar-collapse {
        justify-content: flex-end;
    }
}

.navbar-dark {
    color: rgba(255, 255, 255, 0.55);
}

.navbar-brand {
    background-color: rgb(0, 17, 65);
    color: white !important;
    font-size: 30px;
    padding: 10px;
    margin-left: 10px;
    margin-right: 1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.navbar-brand .site-logo {
    max-height: 50px;
    width: auto;
    display: block;
}

.navbar-nav {
    display: flex;
    flex-direction: row;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.nav-item {
    margin: 0 5px;
}

.nav-link {
    display: block;
    padding: 0.5rem 1rem;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.nav-link:hover,
.nav-link:focus {
    color: rgba(255, 255, 255, 0.75);
}

.navbar-collapse {
    flex-basis: 100%;
    flex-grow: 1;
    align-items: center;
    display: flex;
}

/* Desktop: Logo and menu on same level */
@media screen and (min-width: 992px) {
    .navbar-collapse {
        flex-basis: auto;
        flex-grow: 1;
        display: flex !important;
    }
    
    .navbar .container {
        flex-wrap: nowrap;
    }
}

.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

.fixed-top {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1030;
}

/* Position navbar below WordPress admin bar when logged in */
body.admin-bar .fixed-top,
body.admin-bar .navbar.fixed-top,
body.admin-bar .site-header.sticky-header {
    top: 32px; /* WordPress admin bar height on desktop */
}

/* Mobile admin bar is taller */
@media screen and (max-width: 782px) {
    body.admin-bar .fixed-top,
    body.admin-bar .navbar.fixed-top,
    body.admin-bar .site-header.sticky-header {
        top: 46px; /* WordPress admin bar height on mobile */
    }
}

/* Ensure navbar doesn't interfere with maximized terminal windows */
body:has(.mj-terminal-window.mj-window-maximized) .site-header,
body:has(.mj-terminal-window.mj-window-maximized) header,
body:has(.mj-terminal-window.mj-window-maximized) .navbar,
body:has(.mj-terminal-window.mj-window-maximized) .navbar.fixed-top,
body:has(.mj-terminal-window.mj-window-maximized) .site-header.sticky-header {
    z-index: 1000 !important; /* Lower than maximized window (99999) */
}

/* Ensure navbar is below admin bar but above content */
#wpadminbar {
    z-index: 9999 !important; /* Admin bar should be above navbar */
}

body.admin-bar .navbar.fixed-top,
body.admin-bar .site-header.sticky-header {
    z-index: 1030; /* Below admin bar (9999) but above content */
}

/* Add top margin to content when header is fixed */
body:has(.fixed-top) .site-main,
body:has(.sticky-header) .site-main {
    padding-top: 80px;
}

/* Adjust padding when admin bar is present */
body.admin-bar:has(.fixed-top) .site-main,
body.admin-bar:has(.sticky-header) .site-main {
    padding-top: 112px; /* 80px navbar + 32px admin bar */
}

/* Adjust padding on mobile for fixed navbar */
@media screen and (max-width: 991.98px) {
    body:has(.fixed-top) .site-main,
    body:has(.sticky-header) .site-main {
        padding-top: 70px; /* Slightly less on mobile */
    }
    
    /* Mobile with admin bar */
    body.admin-bar:has(.fixed-top) .site-main,
    body.admin-bar:has(.sticky-header) .site-main {
        padding-top: 116px; /* 70px navbar + 46px admin bar */
    }
}

/* First row spacing */
body:has(.fixed-top) .site-main > *:first-child,
body:has(.sticky-header) .site-main > *:first-child {
    margin-top: 0;
}

/* WPBakery first row spacing */
body:has(.fixed-top) .vc_row:first-of-type,
body:has(.sticky-header) .vc_row:first-of-type,
body:has(.fixed-top) .wpb_row:first-of-type,
body:has(.sticky-header) .wpb_row:first-of-type {
    margin-top: 80px;
}

.bg-primary {
    background-color: #000080 !important;
}

/* Navbar Toggler Button */
.navbar-toggler {
    padding: 0.25rem 0.75rem;
    font-size: 1.25rem;
    line-height: 1;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
    transition: box-shadow 0.15s ease-in-out;
    cursor: pointer;
    display: none; /* Hidden by default, shown on mobile */
}

.navbar-toggler:focus {
    text-decoration: none;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

.navbar-toggler-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    background-image: none;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
}

.navbar-toggler-icon i {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.5rem;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Mobile Responsive Styles */
@media screen and (max-width: 991.98px) {
    .navbar-toggler {
        display: block;
        order: 2; /* Show after brand */
    }

    .navbar-brand {
        font-size: 24px;
        padding: 8px;
        margin-left: 0;
        order: 1; /* Show first */
        flex: 0 0 auto;
    }

    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #000080;
        z-index: 1000;
        padding: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        order: 3; /* Show last, full width */
        flex-basis: 100%;
        width: 100%;
        margin-top: 0.5rem;
    }
    
    /* Ensure mobile menu is below admin bar */
    body.admin-bar .navbar-collapse {
        z-index: 1029; /* Just below navbar but above content */
    }

    .navbar-collapse.collapse {
        display: none;
    }

    .navbar-collapse.collapse.show {
        display: block;
    }

    .navbar-nav {
        flex-direction: column;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .nav-item {
        margin: 0;
        width: 100%;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        display: block;
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    pre {
        font-size: 9px;
        line-height: 7px;
    }

    /* Fix container padding on mobile */
    .navbar .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media screen and (min-width: 992px) {
    .navbar-toggler {
        display: none;
    }

    .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
        flex-grow: 1;
    }
    
    .navbar .container {
        flex-wrap: nowrap;
        align-items: center;
    }
    
    .navbar-brand {
        margin-right: 2rem;
        flex-shrink: 0;
    }
    
    .navbar-nav {
        margin-left: auto;
    }
}

/* Footer */
.site-footer {
    background-color: #00ffff !important; /* Aqua */
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    min-height: auto;
    visibility: visible !important; /* Ensure footer is always visible */
    opacity: 1 !important; /* Ensure footer is not transparent */
}

.site-footer .container {
    text-align: center;
    padding: 5px 0;
}

.site-footer span {
    margin-top: 2px;
    margin-bottom: 2px;
    margin-left: 10px;
    font-size: 14px !important;
    color: #000;
    line-height: 1.2;
}

.site-footer a {
    color: rgb(53, 3, 3);
    margin-right: 5px;
    text-decoration: none;
    font-size: 16px;
    display: inline-block;
    vertical-align: middle;
}

.site-footer a:hover {
    color: red;
    background-color: aqua;
}

/* Main Content */
.site-main {
    position: relative;
    z-index: 2;
    padding-bottom: 100px; /* Space for fixed footer */
    padding-top: 80px; /* Space for fixed header */
    min-height: auto; /* Ensure content doesn't force full height */
    overflow: visible; /* Ensure header/footer aren't clipped */
}

/* Ensure html maintains proper structure */
html {
    height: auto;
    min-height: 100%;
}

/* Ensure main content doesn't break layout with full-height sections */
.site-main > .vc_row[data-vc-full-width],
.site-main > .wpb_row[data-vc-full-width] {
    min-height: auto !important;
}

/* Prevent WPBakery full-width rows from breaking layout */
.site-main .vc_row[data-vc-full-width="true"],
.site-main .wpb_row[data-vc-full-width="true"] {
    min-height: auto !important;
    height: auto !important;
}

/* Ensure WPBakery sections don't break layout */
.site-main .vc_section,
.site-main .wpb_section {
    min-height: auto !important;
    height: auto !important;
}

/* Prevent full-height wrappers from breaking layout */
.site-main [style*="height: 100vh"],
.site-main [style*="min-height: 100vh"],
.site-main [style*="height: 100%"] {
    height: auto !important;
    min-height: auto !important;
}

/* Add top margin to first row to account for fixed header */
.site-main > .container:first-child,
.site-main > .vc_row:first-child,
.site-main > .wpb_row:first-child,
.site-main > .row:first-child {
    margin-top: 80px;
}

/* If site-main already has padding-top, reduce margin */
.site-main > .container:first-child,
.site-main > .vc_row:first-child,
.site-main > .wpb_row:first-child {
    margin-top: 0;
}

.asci-art-title {
    margin-top: 80px;
}

/* Portfolio Styles */
.portfolio-items {
    text-align: center;
}

.portfolio-item {
    height: 300px;
    background-color: rgba(0, 0, 128, 0.548);
    border: 3px solid white;
    margin: 10px;
    transition: all 0.3s ease;
}

.portfolio-item:hover {
    background-color: rgb(8, 138, 138);
}

.portfolio-item-image {
    background-color: red;
    height: 175px;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.portfolio-item ul {
    text-align: left;
    padding: 10px;
    padding-left: 30px;
    margin: 0px;
    margin-top: -10px;
}

/* Links */
article a,
.entry-content a {
    color: white;
    font-size: larger;
    text-decoration: underline;
}

article a:hover,
.entry-content a:hover {
    background: none;
    color: yellow;
}

/* Project Boxes */
.red-title {
    color: red;
    background: none;
    font-size: xx-large;
    margin-top: 30px;
    margin-bottom: 30px;
    padding: 0;
    text-indent: 0;
}

.projects img {
    height: 200px;
    margin-top: 40px;
    margin-bottom: 30px;
    max-width: 100%;
}

.project-box {
    border: solid 2px white;
    background-color: rgba(5, 6, 65, 0.486);
    margin: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.project-box:hover {
    background-color: rgba(5, 56, 65, 0.671);
    color: yellow !important;
    border: yellow solid 3px;
}

.project-box:hover h3 {
    color: yellow !important;
}

.project-logo {
    text-align: center;
}

.projects h3 {
    font-size: x-large;
    color: white;
}

.project-box a {
    color: aqua;
    text-align: center;
    display: block;
    text-decoration: underline;
}

.project-box a:hover {
    color: rgb(255, 173, 135);
}

.instagram-follow {
    background: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d);
    font-size: large;
    padding: 5px;
    border-radius: 10px;
}

/* Contact Page */
.contact-item {
    text-align: center;
    margin-bottom: 30px;
}

.contact-item a {
    color: white;
    text-decoration: none;
    display: block;
}

.contact-item a:hover {
    color: yellow;
}

.contact-item i {
    font-size: 90px;
    display: block;
    margin-bottom: 20px;
}

.contact-item span {
    display: block;
    font-size: 30px;
    margin-top: 20px;
}

/* WordPress Specific */
.wp-block-group {
    margin-bottom: 2em;
}

.wp-block-image {
    margin: 1em 0;
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col,
.col-12,
.col-sm-12,
.col-lg-4 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

@media (min-width: 992px) {
    .col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    .col-lg-8 {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
    }
}

/* WPBakery Custom Elements Styles */
.mj-ascii-art {
    margin: 20px 0;
}

.mj-ascii-art pre {
    margin: 0;
    padding: 10px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    white-space: pre;
    line-height: 1.2;
    word-wrap: normal;
    overflow-wrap: normal;
    display: inline-block;
}

/* RGB animated gradient support */
.mj-ascii-rgb-animated pre {
    background-size: 200% 200%;
    animation: mj-ascii-rgb-shift 3s ease infinite;
}

@keyframes mj-ascii-rgb-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.mj-terminal-typing {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    line-height: 1.6;
    margin: 20px 0;
    min-height: 30px;
}

.mj-terminal-typing .typing-text {
    display: inline-block;
}

.mj-terminal-typing .typing-cursor {
    display: inline-block;
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.mj-terminal-prompt {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    line-height: 1.8;
    margin: 20px 0;
    padding: 0;
    background-color: transparent;
    border-left: none;
}

.mj-terminal-prompt .terminal-prompt {
    font-weight: bold;
    margin-right: 10px;
    display: inline-block;
}

.mj-terminal-prompt.typing-complete .terminal-prompt {
    display: block;
    margin-top: 10px;
    margin-right: 0;
}

.mj-terminal-prompt .terminal-command {
    display: inline-block;
}

.mj-terminal-prompt.typing-complete .terminal-command {
    display: block;
}

.mj-terminal-prompt .command-cursor {
    display: inline-block;
    animation: blink 1s infinite;
    margin-left: 2px;
}

/* Header Sticky and Transparent Styles */
.site-header.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    visibility: visible !important; /* Ensure header is always visible */
    opacity: 1 !important; /* Ensure header is not transparent */
}

/* Ensure regular header (non-sticky) is also visible */
.site-header:not(.sticky-header) {
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 1000;
}

.site-header.transparent-header {
    background: transparent !important;
    box-shadow: none;
}

.site-header.transparent-header.scrolled {
    background: rgba(0, 0, 0, 0.9) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.has-sticky-header {
    padding-top: 0;
}

body.has-sticky-header .site-header.sticky-header {
    padding-top: 0;
}

/* WPBakery Compatibility */
.vc_row {
    margin-bottom: 0;
}

.vc_column_container {
    padding-left: 15px;
    padding-right: 15px;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 2rem;
}

.mt-4 {
    margin-top: 2rem;
}

.space {
    height: 50px;
}

/* Advanced WPBakery Elements Styles */

/* Terminal Window */
.mj-terminal-window {
    border: 2px solid #333;
    border-radius: 4px;
    overflow: visible; /* Changed from hidden to allow resize handles */
    margin: 0 !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    position: fixed !important;
    z-index: 1000 !important;
    min-width: 300px;
    min-height: 200px;
    background-color: transparent !important; /* Transparent background - will be overridden by inline style */
    display: flex;
    flex-direction: column;
}

/* jQuery UI Resizable handles styling */
.mj-terminal-window .ui-resizable-handle {
    position: absolute;
    font-size: 0.1px;
    display: block !important; /* Show resize handles */
    -ms-touch-action: none;
    touch-action: none;
    z-index: 90;
    background: transparent;
    opacity: 0;
    transition: opacity 0.2s;
}

/* Show resize handles on hover */
.mj-terminal-window:hover .ui-resizable-handle {
    opacity: 0.3;
    background: rgba(255, 255, 255, 0.1);
}

.mj-terminal-window .ui-resizable-n {
    cursor: n-resize;
    height: 7px;
    width: 100%;
    top: -5px;
    left: 0;
}

.mj-terminal-window .ui-resizable-s {
    cursor: s-resize;
    height: 7px;
    width: 100%;
    bottom: -5px;
    left: 0;
}

.mj-terminal-window .ui-resizable-e {
    cursor: e-resize;
    width: 7px;
    right: -5px;
    top: 0;
    height: 100%;
}

.mj-terminal-window .ui-resizable-w {
    cursor: w-resize;
    width: 7px;
    left: -5px;
    top: 0;
    height: 100%;
}

.mj-terminal-window .ui-resizable-se {
    cursor: se-resize;
    width: 12px;
    height: 12px;
    right: -5px;
    bottom: -5px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.mj-terminal-window .ui-resizable-sw {
    cursor: sw-resize;
    width: 12px;
    height: 12px;
    left: -5px;
    bottom: -5px;
}

.mj-terminal-window .ui-resizable-ne {
    cursor: ne-resize;
    width: 12px;
    height: 12px;
    right: -5px;
    top: -5px;
}

.mj-terminal-window .ui-resizable-nw {
    cursor: nw-resize;
    width: 12px;
    height: 12px;
    left: -5px;
    top: -5px;
}

.mj-terminal-window .ui-resizable-handle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.terminal-window-header {
    background: linear-gradient(to bottom, #2d2d2d, #1a1a1a);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #000;
}

.terminal-window-controls {
    display: flex;
    gap: 6px;
    margin-right: 10px;
}

.terminal-window-controls .control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

/* macOS style (default) */
.mj-controls-style-mac .terminal-window-controls .control,
.terminal-window-controls .control {
    border-radius: 50%;
}

.mj-controls-style-mac .terminal-window-controls .control.close,
.terminal-window-controls .control.close {
    background-color: #ff5f56;
}

.mj-controls-style-mac .terminal-window-controls .control.minimize,
.terminal-window-controls .control.minimize {
    background-color: #ffbd2e;
}

.mj-controls-style-mac .terminal-window-controls .control.maximize,
.terminal-window-controls .control.maximize {
    background-color: #27c93f;
}

/* Windows style */
.mj-controls-style-windows .terminal-window-controls .control {
    border-radius: 0;
    width: 46px;
    height: 32px;
    margin-right: 2px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    position: relative;
}

.mj-controls-style-windows .terminal-window-controls .control.close {
    background-color: #e81123;
    border-color: #c50e1f;
}

.mj-controls-style-windows .terminal-window-controls .control.close:hover {
    background-color: #f1707a;
}

.mj-controls-style-windows .terminal-window-controls .control.minimize {
    background-color: #3c3c3c;
}

.mj-controls-style-windows .terminal-window-controls .control.minimize:hover {
    background-color: #505050;
}

.mj-controls-style-windows .terminal-window-controls .control.maximize {
    background-color: #3c3c3c;
}

.mj-controls-style-windows .terminal-window-controls .control.maximize:hover {
    background-color: #505050;
}

.mj-controls-style-windows .terminal-window-controls .control.close::after {
    content: '✕';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    line-height: 1;
}

.mj-controls-style-windows .terminal-window-controls .control.minimize::after {
    content: '−';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ccc;
    font-size: 14px;
    line-height: 1;
}

.mj-controls-style-windows .terminal-window-controls .control.maximize::after {
    content: '□';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ccc;
    font-size: 10px;
    line-height: 1;
}

/* Ubuntu style */
.mj-controls-style-ubuntu .terminal-window-controls .control {
    border-radius: 3px;
    width: 14px;
    height: 14px;
    background-color: #2d2d2d;
    border: 1px solid #444;
}

.mj-controls-style-ubuntu .terminal-window-controls .control.close {
    background-color: #fc5753;
    border-color: #e0433f;
}

.mj-controls-style-ubuntu .terminal-window-controls .control.minimize {
    background-color: #fdbc40;
    border-color: #e5a02a;
}

.mj-controls-style-ubuntu .terminal-window-controls .control.maximize {
    background-color: #34c84a;
    border-color: #2aad3d;
}

/* Linux style (text-based) */
.mj-controls-style-linux .terminal-window-controls {
    gap: 8px;
}

.mj-controls-style-linux .terminal-window-controls .control {
    width: auto;
    height: auto;
    border-radius: 0;
    background-color: transparent;
    border: none;
    padding: 2px 6px;
    font-size: 10px;
    color: #ccc;
    font-family: monospace;
}

.mj-controls-style-linux .terminal-window-controls .control.close::before {
    content: '[X]';
}

.mj-controls-style-linux .terminal-window-controls .control.minimize::before {
    content: '[_]';
}

.mj-controls-style-linux .terminal-window-controls .control.maximize::before {
    content: '[□]';
}

/* None style (hidden) */
.mj-controls-style-none .terminal-window-controls {
    display: none;
}

.terminal-window-controls .control:hover {
    opacity: 0.8;
}

.terminal-window-title {
    flex: 1;
    text-align: center;
    font-size: 12px;
    color: #ccc;
    font-weight: bold;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: default;
}

.terminal-window-body {
    padding: 15px;
    font-family: 'Courier New', monospace;
    height: 100% !important;
    overflow-y: auto;
    background: none !important;
}

/* Draggable window styles */
.mj-terminal-window {
    position: absolute !important;
    cursor: default;
    z-index: 1000 !important;
}

/* Ensure terminal windows are above all other content */
.mj-terminal-window,
body .mj-terminal-window,
.vc_row .mj-terminal-window,
.vc_column .mj-terminal-window,
.wpb_column .mj-terminal-window,
.wpb_row .mj-terminal-window {
    position: fixed !important;
    z-index: 10000 !important;
    margin: 0 !important;
}

/* Allow terminal windows to be dragged beyond parent boundaries */
.vc_column .mj-terminal-window,
.vc_row .mj-terminal-window,
.wpb_column .mj-terminal-window,
.wpb_row .mj-terminal-window,
.vc_column_inner .mj-terminal-window,
.vc_row_inner .mj-terminal-window {
    position: fixed !important;
    z-index: 10000 !important;
    margin: 0 !important;
}

/* Ensure terminal window body can contain WPBakery elements */
.terminal-window-body {
    position: relative;
    z-index: 1;
    height: 100% !important;
    background: none !important;
}

.terminal-window-body .vc_row,
.terminal-window-body .vc_column,
.terminal-window-body .wpb_row,
.terminal-window-body .wpb_column {
    position: relative;
    z-index: auto;
}

/* WPBakery backend editor support */
.vc_container_for_children {
    min-height: 50px;
}

.vc_editor .mj-terminal-window .terminal-window-body {
    padding: 20px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

.mj-terminal-window.mj-window-minimized {
    display: none !important;
}

.mj-terminal-window.mj-window-maximized {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 99999 !important; /* Much higher than navbar (1030) to ensure it's above */
    margin: 0 !important;
    /* Create a new stacking context above the navbar */
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    isolation: isolate !important; /* Create a new stacking context */
}

/* Force navbar below maximized windows */
body:has(.mj-terminal-window.mj-window-maximized) .site-header,
body:has(.mj-terminal-window.mj-window-maximized) header,
body:has(.mj-terminal-window.mj-window-maximized) .navbar,
body:has(.mj-terminal-window.mj-window-maximized) .navbar.fixed-top,
body:has(.mj-terminal-window.mj-window-maximized) .site-header.sticky-header {
    z-index: 1000 !important; /* Lower than maximized window (99999) */
}

/* Ensure maximized window header and controls are above everything */
.mj-terminal-window.mj-window-maximized .terminal-window-header {
    z-index: 1 !important;
    position: relative;
}

.mj-terminal-window.mj-window-maximized .terminal-window-controls {
    z-index: 2 !important;
    position: relative;
}

/* Taskbar styles - integrated into footer */
.site-footer #mj-terminal-taskbar {
    order: -1; /* Ensure taskbar appears first (at top of footer) */
}

.mj-terminal-taskbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 255, 255, 0.2); /* Match footer theme with transparency */
    border-top: 1px solid rgba(0, 0, 0, 0.2);
    min-height: 40px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

.mj-taskbar-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    color: #000;
    font-weight: 500;
}

.mj-taskbar-item:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 0, 0, 0.6);
    transform: translateY(-1px);
}

.mj-taskbar-item .taskbar-icon {
    font-size: 14px;
}

.mj-taskbar-item .taskbar-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* BSoD Error */
.mj-bsod-error {
    background-color: #000080;
    color: #ffffff;
    padding: 30px;
    margin: 20px 0;
    border: 2px solid #ffffff;
    font-family: 'Courier New', monospace;
}

.bsod-error-code {
    font-size: 24px;
    font-weight: bold;
    color: #ffff00;
    margin-bottom: 20px;
}

.bsod-error-message {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.bsod-error-details {
    font-size: 14px;
    color: #cccccc;
    margin-top: 20px;
    white-space: pre-line;
}

/* Terminal Progress Bar */
.mj-terminal-progress {
    margin: 20px 0;
    font-family: 'Courier New', monospace;
}

.progress-label {
    margin-bottom: 10px;
    font-size: 14px;
    color: #00ff00;
}

.progress-bar-container {
    position: relative;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ff00;
    height: 30px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #00ff00;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-weight: bold;
    font-size: 12px;
    z-index: 1;
}

/* Glitch Text Effect */
.mj-glitch-text {
    position: relative;
    display: inline-block;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.mj-glitch-text .glitch-text {
    position: relative;
    z-index: 1;
}

.mj-glitch-text .glitch-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.mj-glitch-text.glitch-active .glitch-layer-1 {
    animation: glitch-1 0.3s;
}

.mj-glitch-text.glitch-active .glitch-layer-2 {
    animation: glitch-2 0.3s;
}

.glitch-subtle .glitch-layer {
    transform: translate(0);
}

.glitch-medium .glitch-layer {
    transform: translate(-2px, 2px);
}

.glitch-strong .glitch-layer {
    transform: translate(-5px, 5px);
}

@keyframes glitch-1 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes glitch-2 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(2px, -2px); }
    40% { transform: translate(2px, 2px); }
    60% { transform: translate(-2px, -2px); }
    80% { transform: translate(-2px, 2px); }
}

.mj-glitch-text.glitch-active .glitch-layer-1 {
    opacity: 0.8;
    color: #ff0000;
}

.mj-glitch-text.glitch-active .glitch-layer-2 {
    opacity: 0.8;
    color: #00ffff;
}

/* Terminal Code Block */
.mj-terminal-code {
    margin: 20px 0;
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
    font-family: 'Courier New', monospace;
}

.mj-terminal-code .code-language {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 5px 15px;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    border-bottom: 1px solid #333;
}

.mj-terminal-code pre {
    margin: 0;
    padding: 15px;
    overflow-x: auto;
    color: #00ff00;
    font-size: 14px;
    line-height: 1.6;
}

.mj-terminal-code code {
    font-family: 'Courier New', monospace;
}

/* Command Palette */
.mj-command-palette {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    max-width: 90%;
    background-color: rgba(0, 0, 0, 0.95);
    border: 2px solid #00ff00;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: none;
    font-family: 'Courier New', monospace;
}

.mj-command-palette.active {
    display: block;
}

.palette-input-wrapper {
    padding: 15px;
    border-bottom: 1px solid #333;
}

.palette-input {
    width: 100%;
    background: transparent;
    border: none;
    color: #00ff00;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    outline: none;
}

.palette-input::placeholder {
    color: #666;
}

.palette-results {
    max-height: 300px;
    overflow-y: auto;
}

.palette-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #222;
    display: flex;
    justify-content: space-between;
    transition: background-color 0.2s;
}

.palette-item:hover {
    background-color: rgba(0, 255, 0, 0.1);
}

.palette-cmd {
    color: #00ff00;
    font-weight: bold;
}

.palette-desc {
    color: #999;
    font-size: 14px;
}

.palette-no-results {
    padding: 20px;
    text-align: center;
    color: #666;
}

/* Boot Sequence */
.mj-boot-sequence {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
}

.boot-content {
    color: #00ff00;
    font-size: 18px;
    line-height: 2;
}

.boot-line {
    animation: boot-fade-in 0.5s;
}

@keyframes boot-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .mj-command-palette {
        width: 95%;
    }
    
    .mj-glitch-text {
        font-size: 32px !important;
    }
    
    .terminal-window-body {
        font-size: 14px;
    }
}
/* CRT Screen Effects - Retro Blue Screen of Death Style */

@keyframes flicker {
    0% {
        opacity: 0.27861;
    }
    5% {
        opacity: 0.34769;
    }
    10% {
        opacity: 0.23604;
    }
    15% {
        opacity: 0.90626;
    }
    20% {
        opacity: 0.18128;
    }
    25% {
        opacity: 0.83891;
    }
    30% {
        opacity: 0.65583;
    }
    35% {
        opacity: 0.67807;
    }
    40% {
        opacity: 0.26559;
    }
    45% {
        opacity: 0.84693;
    }
    50% {
        opacity: 0.96019;
    }
    55% {
        opacity: 0.08594;
    }
    60% {
        opacity: 0.20313;
    }
    65% {
        opacity: 0.71988;
    }
    70% {
        opacity: 0.53455;
    }
    75% {
        opacity: 0.37288;
    }
    80% {
        opacity: 0.71428;
    }
    85% {
        opacity: 0.70419;
    }
    90% {
        opacity: 0.7003;
    }
    95% {
        opacity: 0.36108;
    }
    100% {
        opacity: 0.24387;
    }
}

@keyframes textShadow {
    0% {
        text-shadow: 0.4389924193300864px 0 1px rgba(0, 30, 255, 0.5), -0.4389924193300864px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
    5% {
        text-shadow: 2.7928974010788217px 0 1px rgba(0, 30, 255, 0.5), -2.7928974010788217px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
    10% {
        text-shadow: 0.02956275843481219px 0 1px rgba(0, 30, 255, 0.5), -0.02956275843481219px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
    15% {
        text-shadow: 0.40218538552878136px 0 1px rgba(0, 30, 255, 0.5), -0.40218538552878136px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
    20% {
        text-shadow: 3.4794037899852017px 0 1px rgba(0, 30, 255, 0.5), -3.4794037899852017px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
    25% {
        text-shadow: 1.6125630401149584px 0 1px rgba(0, 30, 255, 0.5), -1.6125630401149584px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
    30% {
        text-shadow: 0.7015590085143956px 0 1px rgba(0, 30, 255, 0.5), -0.7015590085143956px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
    35% {
        text-shadow: 3.896914047650351px 0 1px rgba(0, 30, 255, 0.5), -3.896914047650351px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
    40% {
        text-shadow: 3.870905614848819px 0 1px rgba(0, 30, 255, 0.5), -3.870905614848819px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
    45% {
        text-shadow: 2.231056963361899px 0 1px rgba(0, 30, 255, 0.5), -2.231056963361899px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
    50% {
        text-shadow: 0.08084290417898504px 0 1px rgba(0, 30, 255, 0.5), -0.08084290417898504px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
    55% {
        text-shadow: 2.3758461067427543px 0 1px rgba(0, 30, 255, 0.5), -2.3758461067427543px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
    60% {
        text-shadow: 2.202193051050636px 0 1px rgba(0, 30, 255, 0.5), -2.202193051050636px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
    65% {
        text-shadow: 2.8638780614874975px 0 1px rgba(0, 30, 255, 0.5), -2.8638780614874975px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
    70% {
        text-shadow: 0.48874025155497314px 0 1px rgba(0, 30, 255, 0.5), -0.48874025155497314px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
    75% {
        text-shadow: 1.8948491305757957px 0 1px rgba(0, 30, 255, 0.5), -1.8948491305757957px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
    80% {
        text-shadow: 0.0833037308038857px 0 1px rgba(0, 30, 255, 0.5), -0.0833037308038857px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
    85% {
        text-shadow: 0.09769827255241735px 0 1px rgba(0, 30, 255, 0.5), -0.09769827255241735px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
    90% {
        text-shadow: 3.443339761481782px 0 1px rgba(0, 30, 255, 0.5), -3.443339761481782px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
    95% {
        text-shadow: 2.1841838852799786px 0 1px rgba(0, 30, 255, 0.5), -2.1841838852799786px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
    100% {
        text-shadow: 2.6208764473832513px 0 1px rgba(0, 30, 255, 0.5), -2.6208764473832513px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px;
    }
}

.crt::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    animation: flicker 3s infinite;
}

.crt::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.crt {
    animation: textShadow 1000s infinite;
}

/* Bundled CSS - includes crt-effects.css */
/* stylelint-disable */
/* jQuery UI Resizable - minimal styles for terminal windows */
.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}
