:root {
    --primary-color: #05d9e8;   /* Bright Cyan */
    --accent-color: #ff2a6d;    /* Bright Pink */
    --purple-color: #a855f7;    /* Vibrant Purple */
    --blue-color: #3b82f6;      /* Bright Blue */
    --yellow-color: #eab308;    /* Gold */
    --red-alt-color: #f73939;   /* A proper red for alerts/highlights */
    --cyan-color: #06b6d4;
    --white-color: #d1f7ff;      /* Light Blue/White */
    --dark-accent: #005678;     /* Dark Cyan */
    --neon-green: #39ff14;    /* Neon Green */
    --pink-color: #ff006a;    /* Hot Pink */

    --background-color: #01012b;/* Deep Blue */
    --text-color: #d1f7ff;      /* Light Blue/White */
    --dark-accent: #005678;     /* Dark Cyan */

    --glow-color: rgba(255, 42, 109, 0.7); /* Pink Glow */
    --glow-color-neon: #39ff14; /* Neon Green Glow */
    --border-color: rgba(255, 42, 109, 0.4);
    --container-bg: rgba(0, 86, 120, 0.2);
    --light-bg: rgba(255, 42, 109, 0.1);
    --dark-bg: rgba(1, 1, 43, 0.8);
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Fira Code', 'Source Code Pro', monospace;
    margin: 0;
    padding: 0;
    overflow: hidden;
    touch-action: manipulation;
}

.hidden {
    display: none;
}

.mobile-only {
    display: none;
}

#digital-rain-cyberpunk {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
}

.container {
    position: absolute;
    top: 2vh;
    left: 2.5vw;
    right: 2vw;
    bottom: 2vh;
    width: 94vw; height: 96vh;
    border: 1px solid var(--border-color);
    box-shadow: 0 0 20px var(--glow-color), inset 0 0 25px var(--glow-color);
    background: var(--container-bg);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
}

.header {
    font-family: 'Audiowide', cursive;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--accent-color);
    text-shadow: 0 0 8px var(--glow-color);
    flex-shrink: 0;
    font-size: 0.95em;
    letter-spacing: 1px;
}
.header-dir { color: var(--primary-color); }
.header-separator { color: rgba(255, 42, 109, 0.5); }
.header-button {
    font-family: 'Audiowide', cursive;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--accent-color);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.header-button:hover {
    background: var(--light-bg);
    box-shadow: 0 0 8px var(--glow-color);
    opacity: 1;
}

.header-button:active {
    transform: scale(0.95);
}

.header-left, .header-right { display: flex; align-items: center; gap: 10px; }

.content {
    flex-grow: 1;
    padding: 15px;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
}

#output {
    flex-grow: 1;
    overflow-y: auto;
    font-size: 0.95em;
    line-height: 1.6;
}

#input-container { position: relative; flex-shrink: 0; }
#input-area { display: flex; align-items: baseline; margin-top: 10px; }
#command-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    caret-color: var(--accent-color);
    font-family: inherit;
    font-size: inherit;
    padding-left: 8px;
}

#suggestions {
    position: absolute;
    bottom: 100%; left: 0; right: 0;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-bottom: none;
    max-height: 150px;
    overflow-y: auto;
    z-index: 10;
}
.suggestion-item {
    font-family: 'Audiowide', cursive;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
}
.suggestion-item:hover { background-color: var(--light-bg); }
.suggestion-item .arrow { color: var(--accent-color); opacity: 0.7; margin-right: 8px; }


#prompt, .prompt-static {
    font-family: 'Audiowide', cursive;
    color: var(--accent-color);
    flex-shrink: 0;
}
.prompt-arrow { opacity: 0.7; margin-right: 4px; }
.prompt-user { text-shadow: 0 0 4px var(--glow-color); }
.prompt-sep { opacity: 0.7; margin: 0 4px; }
.prompt-dir { color: var(--primary-color); }

/* --- Content Styling --- */
.font-display { font-family: 'Audiowide', cursive; }
.text-primary { color: var(--primary-color); }
.text-accent { color: var(--accent-color); }
.text-secondary { color: var(--blue-color); }
.text-tertiary { color: var(--cyan-color); }
.text-purple { color: var(--purple-color); }
.text-yellow { color: var(--yellow-color); }
.text-blue { color: var(--blue-color); }
.text-cyan { color: var(--cyan-color); }
.text-red-alt { color: var(--red-alt-color); }
.text-dark-accent { color: var(--dark-accent); }
.text-white { color: var(--white-color); }
.text-green { color: var(--neon-green); }
.text-neon-green { color: #39ff14; text-shadow: 0 0 5px #39ff14, 0 0 10px #39ff14, 0 0 20px #39ff14; }
.text-neon-white { color: #d1f7ff; text-shadow: 0 0 5px #d1f7ff, 0 0 10px #d1f7ff, 0 0 20px #d1f7ff; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }

.font-bold { font-weight: bold; }
.font-medium { font-weight: 500; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

.card {
    background-color: rgba(1,1,20,0.5);
    border: 1px solid var(--dark-accent);
    padding: 1rem;
    border-radius: 4px;
}
.card-border-left { border-left: 4px solid var(--primary-color); }
.card-border-left-blue { border-left: 4px solid var(--blue-color); }
.card-border-left-purple { border-left: 4px solid var(--purple-color); }
.card-border-left-red { border-left: 4px solid var(--red-alt-color); }
.card-border-left-yellow { border-left: 4px solid var(--yellow-color); }
.card-border-left-accent { border-left: 4px solid var(--accent-color); }
.card-border-left-cyan { border-left: 4px solid var(--cyan-color); }
.card-border-left-green { border-left: 4px solid var(--neon-green); }
.card-border-left-white { border-left: 4px solid var(--white-color); }
.card-border-left-secondary { border-left: 4px solid var(--blue-color); }
.card-border-left-pink { border-left: 4px solid var(--pink-color); }
.card-border-left-red-alt { border-left: 4px solid var(--red-alt-color); }


.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    background-color: var(--container-bg);
    border: 1px solid var(--dark-accent);
    color: var(--primary-color);
}
.tag-blue { background-color: rgba(59, 130, 246, 0.1); color: var(--blue-color); }
.tag-purple { background-color: rgba(168, 85, 247, 0.1); color: var(--purple-color); }
.tag-yellow { background-color: rgba(234, 179, 8, 0.1); color: var(--yellow-color); }
.tag-accent { background-color: rgba(255, 42, 109, 0.1); color: var(--accent-color); }
.tag-red-alt { background-color: rgb(233, 78, 78); color: var(--red-alt-color); }


ul.list-disc { list-style-type: disc; padding-left: 1.5rem; }
.flex-container { display: flex; align-items: center; gap: 0.75rem; }
.flex-center { justify-content: center; }

.icon-circle {
    padding: 0.5rem;
    border-radius: 9999px;
    background-color: var(--light-bg);
    color: var(--primary-color);
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* --- Scrollbar --- */
#output::-webkit-scrollbar, #suggestions::-webkit-scrollbar { width: 4px; }
#output::-webkit-scrollbar-track, #suggestions::-webkit-scrollbar-track { background: rgb(255, 0, 0); }
#output::-webkit-scrollbar-thumb, #suggestions::-webkit-scrollbar-thumb { background: var(--accent-color); border-radius: 4px; }
#output::-webkit-scrollbar-thumb:hover, #suggestions::-webkit-scrollbar-thumb:hover { background: #f50045; }

/* --- ADD THIS CODE BLOCK --- */
.sidebar-right {
    position: absolute;
    top: 50%;
    /* Position it just outside the container's right edge (container is at 2vw + 96vw = 98vw) */
    left: calc(97.25vw);
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 20; /* Ensure it's above the container */
}

.sidebar-right button {
    background: none;
    border: none;
    color: var(--white-color);
    opacity: 1;
    font-size: 1.5em;
    cursor: pointer;
    transition: transform 0.2s, text-shadow 0.2s, opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-right button:hover {
    transform: scale(1.2);
    text-shadow: 0 0 10px var(--glow-color);
    opacity: 1;
}

.sidebar-right button:active {
    transform: scale(1.1);
}

.sidebar-right button.selected {
    background-color: var(--accent-color);
    color: #000;
    box-shadow: 0 0 10px var(--glow-color);
}

/*
@media (max-width: 768px) {
    .sidebar-right {
        display: none;  Hide sidebars on smaller screens
    }
    .container {
        padding-left: 0;  Reset padding on smaller screens
        padding-right: 0;
    }
}
*/

.banner-name {
  /*font-family: "Island Moments", cursive; */
  font-family: "Kumar One Outline", system-ui;
  font-weight: 400;
  font-style: normal;
}

/* On-screen Keyboard */
.keyboard {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-width: 90vw;
    justify-content: center;
    z-index: 10;
    opacity: 0.95;
    background-color: rgba(1, 1, 20, 0.85);
    padding: 10px 15px;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 0 15px var(--glow-color);
}

.keyboard-row {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.key {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 12px;
    color: var(--text-color);
    font-size: 12px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    min-width: 60px;
    user-select: none;
}

.key-wide {
    min-width: 60px;
}

.key-tab {
    min-width: 50px;
}

.key-caps {
    min-width: 70px;
}

.key-enter {
    min-width: 70px;
}

.key-shift {
    min-width: 80px;
}

.key-space {
    flex: 1;
    max-width: 400px;
    padding: 8px;
}

.key.active {
    background-color: var(--accent-color);
    color: #000;
    box-shadow: 0 0 10px var(--glow-color);
}

.key-hover:hover {
    background-color: var(--light-bg);
    box-shadow: 0 0 8px var(--glow-color);
}

/* Keyboard toggle button */
#keyboard-toggle {
    position: fixed;
    bottom: 260px;
    right: 10px;
    z-index: 30;
    background-color: transparent;
    color: var(--accent-color);
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Audiowide', cursive;
    font-size: 0.9rem;
    box-shadow: 0 0 10px var(--glow-color);
    transition: background-color 0.3s ease;
}

#keyboard-toggle:hover {
    background-color: --var(--light-bg);
    box-shadow: 0 0 15px var(--glow-color);
}

/* Mobile Menu Backdrop */
.mobile-menu-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 24;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-backdrop.active {
    display: block;
    opacity: 1;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 80px;
    right: 290px;
    background: rgba(1, 1, 43, 0.98);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 6px;
    z-index: 25;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(255, 42, 109, 0.3);
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-menu button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--white-color);
    padding: 12px 16px;
    text-align: left;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    font-family: 'Audiowide', cursive;
    font-size: 0.9em;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-menu button i {
    font-size: 1.1em;
    width: 20px;
    text-align: center;
}

.mobile-menu button:hover,
.mobile-menu button:active {
    background: var(--light-bg);
    box-shadow: 0 0 10px var(--glow-color);
    transform: translateX(4px);
}

.mobile-menu.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* Container adjustment when keyboard visible */
.container.keyboard-visible {
    transform: translateY(-200px); /* Move container up when keyboard is visible */
    transition: transform 0.3s ease;
}

/* Cat command content styling */
.cat-content {
    font-size: 1.2em;
}

.markdown-body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #e5e7eb;
  word-wrap: break-word;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  border-bottom: 1px solid #374151;
  padding-bottom: 0.3em;
  margin-top: 1em;
  margin-bottom: 0.6em;
}

.markdown-body pre {
  background: #1f2937;
  padding: 0.75rem;
  border-radius: 6px;
  overflow-x: auto;
  white-space: pre-wrap; /* wrap long lines */
}

.markdown-body code {
  background: #374151;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.95em;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

@media (max-width: 768px) {
    /* Hide desktop sidebar */
    .sidebar-right {
        display: none;
    }

    /* Show mobile-only elements */
    .mobile-only {
        display: inline-flex !important;
    }

    /* Container - Full screen on mobile */
    .container {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh; /* Use dynamic viewport height to account for browser chrome */
        border: none;
        box-shadow: none;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    /* Header adjustments - Fixed positioning on mobile */
    .header {
        position: sticky;
        position: -webkit-sticky;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        font-size: 0.75em;
        padding: 8px 12px;
        flex-wrap: wrap;
        background: rgba(1, 1, 43, 0.95);
        backdrop-filter: blur(10px);
        flex-shrink: 0;
    }

    .header-title {
        font-size: 0.85em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;
    }

    .header-left {
        gap: 6px;
    }

    .header-right {
        gap: 8px;
    }

    .header-button {
        padding: 6px 8px;
        font-size: 0.85em;
        min-height: 44px;
    }

    .header-button .btn-text {
        display: none;
    }

    .header-button i {
        margin: 0;
    }

    /* Hide time on mobile */
    #current-time {
        display: none;
    }

    /* Content padding */
    .content {
        padding: 12px;
    }

    /* Output font size */
    #output {
        font-size: 0.85em;
        line-height: 1.5;
    }

    /* Grid adjustments */
    .grid-container {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    /* Banner adjustments */
    .banner-name {
        font-size: 1.8rem !important;
        line-height: 1.2;
    }

    /* Text size adjustments */
    .text-lg {
        font-size: 1rem;
    }

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

    /* Card adjustments */
    .card {
        padding: 0.75rem;
    }

    /* Tag adjustments */
    .tag {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }

    /* Icon adjustments */
    .icon-circle {
        width: 16px;
        height: 16px;
        padding: 0.4rem;
    }

    /* Keyboard toggle positioning */
    .keyboard-toggle-btn {
        bottom: 20px;
        right: 15px;
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .keyboard-toggle-btn .btn-text {
        display: none;
    }

    /* Keyboard adjustments */
    .keyboard {
        max-width: 100vw;
        padding: 8px 10px;
        gap: 4px;
    }

    .keyboard-row {
        gap: 3px;
    }

    .key {
        padding: 6px 8px;
        font-size: 6px;
        min-width: 30px;
    }

    .key-wide {
        min-width: 48px;
    }

    .key-tab {
        min-width: 40px;
    }

    .key-caps {
        min-width: 55px;
    }

    .key-enter {
        min-width: 55px;
    }

    .key-shift {
        min-width: 60px;
    }

    /* Container shift when keyboard visible */
    .container.keyboard-visible {
        transform: translateY(-150px);
    }

    /* Mobile menu position adjustment */
    .mobile-menu {
        top: 48px;
        right: 8px;
        left: 8px;
        max-width: none;
        max-height: calc(100vh - 60px);
    }

    /* Suggestions adjustments */
    #suggestions {
        max-height: 120px;
    }

    .suggestion-item {
        padding: 10px;
        font-size: 0.85em;
    }

    /* Input area adjustments */
    #input-area {
        font-size: 0.9em;
    }

    #prompt {
        font-size: 0.85em;
    }
}

/* Extra small devices (phones in portrait, less than 400px) */
@media (max-width: 400px) {
    .header {
        font-size: 0.7em;
        padding: 6px 8px;
    }

    .header-title {
        font-size: 0.75em;
        max-width: 140px;
    }

    .header-button {
        padding: 5px 6px;
        font-size: 0.8em;
    }

    .content {
        padding: 10px;
    }

    #output {
        font-size: 0.8em;
    }

    .banner-name {
        font-size: 1.5rem !important;
    }

    .text-lg {
        font-size: 0.95rem;
    }

    .card {
        padding: 0.6rem;
    }

    .grid-container {
        gap: 0.5rem;
    }

    .mobile-menu button {
        padding: 10px 12px;
        font-size: 0.85em;
        min-height: 44px;
    }

    .key {
        padding: 5px 6px;
        font-size: 9px;
        min-width: 20px;
    }
}

/* Landscape mode on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .container {
        height: 100vh;
    }

    .banner-name {
        font-size: 1.5rem !important;
    }

    .mobile-menu {
        max-height: calc(100vh - 50px);
    }

    .keyboard {
        padding: 6px 8px;
    }

    .key {
        padding: 4px 6px;
        font-size: 9px;
    }
}