:root {
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-color: #ffffff;
    --input-bg: rgba(255, 255, 255, 0.15);
    --error-color: #ff4444;
    --accent-color: #00aaff;
    --success-color: #44bb44;
    --warning-color: #ffaa00;
    --tab-inactive: rgba(255, 255, 255, 0.5);
    --tab-active: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    height: 100vh; /* fallback for older browsers */
    height: -webkit-fill-available;
    min-height: -webkit-fill-available;
    overflow: hidden;
    color: var(--text-color);
    position: fixed;
    width: 100%;
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.background-video {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 1s ease-in-out;
}

.glass-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    background: rgba(0, 0, 0, 0.3);
}

.content-container {
    height: 100vh;
    height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Enables momentum scrolling on iOS */
}

/* Terminal Display styles */
.conversation-display {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 15px;
    backdrop-filter: blur(15px);
    width: 100%;
    max-width: 500px;
    max-height: 55vh; /* Reduced for better mobile fit */
    max-height: calc(var(--vh, 1vh) * 55); /* Mobile viewport fix */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Enable smooth scrolling on iOS */
    margin-bottom: 15px;
    margin-top: 25px; /* Reduced top margin for mobile */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

/* UNIX Terminal Styling */
.crt {
    position: relative;
    color: #fff; /* White text for UNIX terminals */
    font-family: 'Courier New', 'Courier', monospace; /* Teletype font */
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
    animation: flicker 0.3s infinite alternate; /* Slowed down animation for less flickering */
    overflow: hidden;
}

/* Screen-door effect - nearly imperceptible for UNIX terminal */
.crt::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(rgba(255, 255, 255, 0.01) 0, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.01) 0, transparent 1px);
    background-size: 3px 3px;
    opacity: 0.05;
    z-index: 2;
    pointer-events: none;
}

/* Scan lines effect - extremely subtle for UNIX terminal */
.crt::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(
            transparent 50%, 
            rgba(0, 0, 0, 0.05) 50%
        );
    background-size: 100% 4px;
    opacity: 0.1;
    z-index: 2;
    pointer-events: none;
}

/* Vignette effect - more subtle for UNIX terminal */
.terminal-display::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.2) 80%,
        rgba(0, 0, 0, 0.5) 100%
    );
    z-index: 1;
    pointer-events: none;
}

/* Flicker animation - very subtle */
@keyframes flicker {
    0%,100% { opacity: 1; }
    95% { opacity: 1; }
    85% { opacity: 0.98; }
}

/* Terminal theme styling */
.terminal-display {
    background: rgba(0, 0, 0, 0.85); /* More transparent background */
    border: 0.5px solid rgba(180, 180, 180, 0.7); /* Thinner, gray border */
    box-shadow: 0 0 5px rgba(180, 180, 180, 0.25);
    font-family: 'Courier New', 'Courier', monospace; /* More teletype-like font */
    position: relative;
    overflow: hidden;
    border-radius: 0; /* Square corners */
    aspect-ratio: 4 / 3; /* Classic 4:3 aspect ratio */
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    backdrop-filter: blur(3px); /* Glass effect */
    -webkit-backdrop-filter: blur(3px);
}

.terminal-header {
    border-bottom: 0.5px solid rgba(180, 180, 180, 0.7);
    background: rgba(0, 0, 0, 0.9);
    padding: 8px 15px;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.terminal-header h3 {
    color: #fff;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
    font-size: 16px;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.5);
}

/* Turn counter styles */
#turnCounterDisplay {
    font-weight: bold;
}

#turnCounterDisplay.unlimited {
    color: var(--success-color);
    animation: pulse-highlight 2s infinite;
}

@keyframes pulse-highlight {
    0%, 100% { text-shadow: 0 0 5px var(--success-color); }
    50% { text-shadow: 0 0 15px var(--success-color); }
}

.terminal-content {
    color: #fff;
    padding: 10px;
    display: flex;
    flex-direction: column;
    height: calc(100% - 36px); /* Subtract header height */
    position: relative;
    overflow: hidden;
}

/* Terminal input container (to be added at the bottom of terminal content) */
.terminal-input-container {
    display: flex;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.3);
    position: sticky;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 2;
    padding: 8px 0 2px 0;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
}

.conversation-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-color);
    font-weight: 500;
    letter-spacing: 1px;
}

.reset-btn {
    background: none;
    border: none;
    color: #fff;
    padding: 5px 10px;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.reset-btn:hover {
    background: #333;
    opacity: 1;
}

.conversation-history {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    -ms-overflow-style: none; /* Hide scrollbar for IE and Edge */
    -webkit-overflow-scrolling: touch; /* Enable smooth scrolling on iOS */
    flex-grow: 1;
    padding-right: 5px;
    position: relative;
    scroll-behavior: smooth; /* Smooth scrolling for better experience */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.conversation-history::-webkit-scrollbar {
    display: none;
}

.conversation-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin: 10px 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    animation: pulse 2s infinite;
}

.conversation-loading .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.conversation-loading .message {
    color: var(--accent-color);
    font-style: italic;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.message {
    padding: 8px 12px;
    max-width: 100%;
    animation: fadeIn 0.3s ease-in-out;
    font-family: 'Courier New', 'Courier', monospace; /* Teletype font */
    line-height: 1.5;
    margin-bottom: 5px;
    position: relative;
    transition: all 0.3s ease;
    letter-spacing: 0.5px; /* Improve readability for monospace font */
}

.message.user {
    align-self: flex-start;
    color: #fff;
    border: none;
    background: transparent;
    border-left: 0.5px solid rgba(180, 180, 180, 0.6); /* Thinner, gray border */
}

.message.user::before {
    content: "USER> ";
    color: rgba(220, 220, 220, 0.9); /* Slightly desaturated white */
    font-weight: normal;
    opacity: 0.9;
}

.message.assistant {
    align-self: flex-start;
    background: transparent;
    color: #fff;
    border: none;
    border-left: 0.5px solid rgba(180, 180, 180, 0.6); /* Thinner, gray border */
}

.message.assistant::before {
    content: "WAVE> ";
    color: rgba(220, 220, 220, 0.9); /* Slightly desaturated white */
    font-weight: normal;
    opacity: 0.9;
}

.message-content {
    margin: 0;
    word-break: break-word;
    display: inline;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
}

/* Typewriter effect class */
.typewriter {
    overflow: visible;
    white-space: pre-wrap;
    margin: 0 auto;
    position: relative; 
    display: inline;
}

/* Special styling for asterisk content */
.asterisk-content {
    display: block; /* Make it a block element to add line breaks */
    font-style: italic;
    color: #9bf8ff; /* Bright cyan color to stand out */
    text-shadow: 0 0 3px rgba(155, 248, 255, 0.4);
    margin: 8px 0;
    font-weight: normal;
    line-height: 1.5;
    max-width: 95%;
}

.cursor {
    display: inline-block;
    width: 0.6em;
    height: 1.2em;
    background-color: #fff;
    margin-left: 1px;
    vertical-align: middle;
    animation: blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
    from, to { opacity: 1 }
    50% { opacity: 0 }
}

.message-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-top: 5px;
    opacity: 0.7;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.audio-controls {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 25px;
    backdrop-filter: blur(15px);
    width: 100%;
    max-width: 500px;
    margin-bottom: 10px; /* Added to ensure space at bottom on mobile */
}

.status-indicator {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #ff0000;
    border-radius: 50%;
    margin-right: 10px;
    animation: pulse 2s infinite;
}

.status-text {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.input-container {
    display: flex;
    gap: 10px;
    position: relative;
}

/* Terminal input styling */
input[type="text"] {
    flex: 1;
    padding: 15px;
    border: 1px solid #fff;
    border-radius: 0;
    background: #000;
    color: #fff;
    font-size: 16px;
    font-family: 'VT323', 'Courier New', monospace;
    font-weight: 500;
    box-shadow: none;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
    caret-color: #fff;
}

input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-family: 'VT323', 'Courier New', monospace;
}

input[type="text"]:focus {
    outline: none;
    border-color: #fff;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

/* Terminal input styling for the integrated look */
.terminal-input-container {
    display: flex;
    align-items: center;
    margin-top: 15px;
    border-top: 0.5px solid rgba(180, 180, 180, 0.5);
    padding-top: 10px;
}

/* Terminal input - specific styles for inside the terminal */
.terminal-input {
    background: transparent;
    border: none;
    outline: none;
    caret-color: #fff;
    color: #fff;
    font-family: 'Courier New', 'Courier', monospace; /* Teletype font */
    font-size: 16px;
    padding: 5px 0;
    width: 100%;
    letter-spacing: 0.5px; /* Improve readability */
}

/* Terminal prompt character before input */
.terminal-input-container::before {
    content: ">";
    color: rgba(220, 220, 220, 0.9); /* Slightly desaturated white */
    font-family: 'Courier New', 'Courier', monospace; /* Teletype font */
    font-size: 18px;
    margin-right: 8px;
    font-weight: normal;
}

#submitButton {
    display: none; /* Hide the standard submit button */
}

/* Terminal submit button style - minimalist and integrated */
.terminal-submit {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    padding: 0 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.terminal-submit:hover {
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.terminal-submit:active {
    transform: translateY(1px);
}

/* Generic button style for other buttons */
button {
    padding: 15px 25px;
    border: none;
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background: rgba(255, 255, 255, 0.25);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    gap: 10px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: var(--text-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.error-message {
    color: var(--error-color);
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-message.visible {
    opacity: 1;
}

.rate-limit-message {
    color: var(--warning-color);
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rate-limit-message.visible {
    opacity: 1;
    animation: pulse 2s infinite;
}

.hidden {
    display: none;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    /* Adjust content container to use more screen space */
    .content-container {
        padding: 15px 12px;
    }

    /* Mobile terminal stays with 4:3 aspect ratio */
    .terminal-display {
        aspect-ratio: 4 / 3; /* Maintain aspect ratio on mobile */
        max-width: 100%; /* Full width on mobile */
        margin: 0 auto;
    }
    
    /* All conversation content is contained within the terminal */
    .conversation-history {
        flex-grow: 1; /* Fill available space */
        overflow-y: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    /* Hide scrollbar for mobile too */
    .conversation-history::-webkit-scrollbar {
        display: none;
    }
    
    .conversation-header h3 {
        font-size: 16px; /* Smaller header text on mobile */
    }
    
    /* More compact controls on mobile */
    .audio-controls {
        padding: 16px;
    }
    
    .status-indicator {
        margin-bottom: 15px;
    }
    
    .status-text {
        font-size: 12px;
        letter-spacing: 1px;
    }

    input[type="text"] {
        padding: 12px;
        font-size: 18px; /* Larger text on mobile */
        background: rgba(0, 0, 0, 0.6); /* Even darker background on mobile */
        font-weight: 600; /* Bolder text for mobile */
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); /* Text shadow for better readability */
    }

    button {
        padding: 12px 16px; /* Slightly narrower to save space */
    }
    
    /* Increase size of agent buttons on mobile for better touch targets */
    .agent-button {
        width: 65px;
        height: 50px;
        font-size: 22px;
    }
    
    /* Smaller gap between agent buttons on mobile */
    .agent-buttons {
        gap: 10px;
    }
    
    /* Make agent label smaller on mobile */
    .quick-select-label {
        font-size: 12px;
        margin-bottom: 5px;
    }
    
    /* Smaller gap below agent buttons */
    .agent-quick-select {
        margin-top: 12px;
    }
    
    /* Smaller spacing for loading/error messages */
    .loading-indicator, .error-message, .rate-limit-message {
        margin-top: 12px;
        font-size: 13px;
    }
}

.floating-text-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.floating-text {
    position: absolute;
    color: var(--text-color);
    font-size: 18px;
    opacity: 0;
    pointer-events: none;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    animation: floatUp 4s ease-out forwards;
}

@keyframes floatUp {
    0% {
        transform: translateY(0);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-200px);
        opacity: 0;
    }
}

/* New Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 25px;
    margin: auto;
    width: 90%;
    max-width: 500px;
    backdrop-filter: blur(15px);
}

.modal.show .modal-content {
    transform: translateY(0);
}

/* Out of tokens overlay */
.out-of-tokens-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.out-of-tokens-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* iOS Compatibility Overlay */
.ios-compatibility-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1002; /* Higher than other overlays */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.ios-compatibility-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.ios-message {
    color: #ffffff;
    font-size: 28px;
    margin-bottom: 20px;
    text-align: center;
    max-width: 80%;
    line-height: 1.4;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 170, 255, 0.5);
}

.ios-sub-message {
    color: #cccccc;
    font-size: 18px;
    margin: 20px 0;
    text-align: center;
    max-width: 85%;
    line-height: 1.5;
}

.try-anyway-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: rgba(0, 170, 255, 0.3);
    border: 1px solid rgba(0, 170, 255, 0.5);
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.try-anyway-button:hover {
    background-color: rgba(0, 170, 255, 0.5);
}

.out-of-tokens-message {
    color: #ffffff;
    font-size: 32px;
    margin-bottom: 20px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    animation: pulse 2s infinite;
}

.tokens-message {
    color: #ffffff;
    font-size: 18px;
    margin: 20px 0;
    text-align: center;
    max-width: 600px;
    line-height: 1.5;
}

.access-code-container {
    display: flex;
    margin: 30px 0;
    width: 100%;
    max-width: 400px;
}

.access-code-container input {
    flex: 1;
    padding: 15px;
    border: 2px solid var(--accent-color);
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    border-radius: 8px 0 0 8px;
    font-size: 18px;
}

.access-code-container button {
    padding: 15px 25px;
    background: var(--accent-color);
    color: #ffffff;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.access-code-container button:hover {
    background: var(--success-color);
}

.reload-instructions {
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    margin-top: 40px;
    text-align: center;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: var(--text-color);
}

.close-button {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 15px;
}

#systemPrompt {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: none;
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 16px;
    resize: vertical;
    font-family: inherit;
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
}

.icon-button {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.icon-button:hover {
    opacity: 1;
}

/* Form Controls */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 14px;
}

.range-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: var(--glass-border);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--text-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.range-value {
    min-width: 40px;
    color: var(--text-color);
    font-size: 14px;
}

select {
    width: 100%;
    padding: 8px 12px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

select option {
    background: #1a1a1a;
    color: var(--text-color);
}

/* Tab Navigation */
.tabs-container {
    margin-top: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.tab-navigation {
    display: flex;
    border-bottom: 1px solid var(--glass-border);
}

.tab-button {
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--tab-inactive);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.tab-button.active {
    color: var(--tab-active);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--tab-active);
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

/* Agent Management */
.agent-selector {
    margin-bottom: 15px;
    width: 100%;
    padding: 10px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-color);
}

.agents-list-container {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.agent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.agent-item.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 8px rgba(0, 170, 255, 0.4);
}

.agent-info {
    flex: 1;
}

.agent-info h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
}

.agent-info p {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
}

.agent-actions {
    display: flex;
    gap: 8px;
}

.agent-actions button {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.agent-edit-btn {
    background: var(--warning-color);
}

.agent-delete-btn {
    background: var(--error-color);
}

.agent-select-btn {
    background: var(--success-color);
}

#createAgentBtn {
    background: var(--accent-color);
    width: 100%;
    margin-top: 10px;
}

.agent-form-container {
    max-height: 500px;
    overflow-y: auto;
}

.agent-form-title {
    margin-bottom: 20px;
    font-size: 18px;
}

#agentPrompt {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-color);
    font-family: inherit;
    resize: vertical;
    margin-bottom: 15px;
}

.agent-form-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

#saveAgentBtn {
    background: var(--success-color);
}

#cancelAgentBtn {
    background: var(--error-color);
}

.agent-form-group {
    margin-bottom: 15px;
}

.agent-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}

.agent-form-group input[type="text"], 
.agent-form-group textarea {
    width: 100%;
    padding: 10px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 14px;
}

.current-agent-indicator {
    display: inline-block;
    padding: 6px 12px;
    background: var(--accent-color);
    border-radius: 15px;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Quick Agent Selection Styles */
.agent-quick-select {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 15px;
    width: 100%;
}

.quick-select-label {
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 8px;
    opacity: 0.9;
}

.agent-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.agent-button {
    width: 60px;
    height: 48px;
    border-radius: 24px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 0 5px;
}

.agent-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.2);
}

.agent-button.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-color);
}

.agent-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.8);
    pointer-events: none;
    box-shadow: none;
}

/* Pulse animation for agent buttons */
@keyframes pulse-effect {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.pulse-animation {
    animation: pulse-effect 0.5s ease;
}

/* Highlight animation for newly activated agent buttons */
@keyframes highlight-pulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.highlight-animation {
    animation: highlight-pulse 1s cubic-bezier(0.215, 0.610, 0.355, 1.000) infinite;
    position: relative;
    z-index: 10;
}

/* Documentation for Agent Button Symbols:
 * ¤¶§ - SUPERWORLD! - Default quirky agent
 * ಠ_ಠ - TUTORIAL: The Great and Powerful - Wise, authoritative guide
 * ඞ - Stef from Spencer's Office - Sarcastic, witty colleague
 * (⌐■_■) - Spencer Llyod, Founder & CEO of SUPERWORLD! - Friendly, thoughtful tech professional
 * 彡★ - A Quick Commercial Break - Enthusiastic infomercial spokesperson
 */
.close-overlay-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-overlay-button:hover {
    opacity: 1;
}

/* Start button container */
.start-button-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    text-align: center;
}

/* Start button styling */
.start-button {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 3px solid var(--accent-color);
    color: var(--text-color);
    font-size: 54px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.6);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.start-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(0, 170, 255, 0.9);
}

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

/* Swirl emoji animation */
.swirl-emoji {
    display: inline-block;
    animation: spin 4s linear infinite;
}

/* Terminal display transitions */
#terminalDisplay {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Start button container transitions */
#startButtonContainer {
    opacity: 1;
    transition: opacity 0.3s ease;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
