/* Terminal Color Palette */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --text-primary: #00ff41;
    --text-secondary: #00b82e;
    --text-dim: #006622;
    --border-color: #00ff41;
    --highlight: #ffff00;
    --error: #ff0000;
    --selection: rgba(0, 255, 65, 0.3);
}

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

body {
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    overflow-x: hidden;
}

::selection {
    background-color: var(--selection);
    color: var(--text-primary);
}

/* Scanline Effect */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0, 0, 0, 0.1) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9999;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(4px);
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Terminal Header */
.terminal-header {
    border: 2px solid var(--border-color);
    border-bottom: none;
    padding: 1rem 1.5rem;
    background-color: var(--bg-secondary);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

.terminal-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 5px var(--text-primary);
}

.terminal-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Blinking Cursor */
.blink {
    animation: blink 1s step-end infinite;
}

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

/* Terminal Window */
.terminal-window {
    border: 2px solid var(--border-color);
    background-color: var(--bg-secondary);
    flex: 1;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.2);
}

.terminal-content {
    padding: 2rem;
}

/* ASCII Art */
.ascii-art {
    color: var(--text-primary);
    font-size: 0.85rem;
    margin-bottom: 2rem;
    text-align: center;
    text-shadow: 0 0 8px var(--text-primary);
    line-height: 1.2;
}

/* Prompt Line */
.prompt-line {
    margin: 2rem 0 0.5rem 0;
    font-weight: bold;
}

.prompt {
    color: var(--text-secondary);
    text-shadow: 0 0 3px var(--text-secondary);
}

/* Output */
.output {
    margin-bottom: 1rem;
    padding-left: 1rem;
}

.output p {
    margin: 0.3rem 0;
}

.highlight {
    color: var(--highlight);
    text-shadow: 0 0 5px var(--highlight);
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
    max-width: 400px;
}

.terminal-button {
    background-color: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
    text-shadow: 0 0 3px var(--text-primary);
}

.terminal-button:hover {
    background-color: var(--text-primary);
    color: var(--bg-primary);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
    text-shadow: none;
}

.terminal-button:active {
    transform: translateY(2px);
}

.button-prompt {
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.terminal-button:hover .button-prompt {
    color: var(--bg-primary);
}

.logout-btn {
    max-width: 200px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin: 2rem 0 1rem 0;
    border-bottom: 2px solid var(--text-dim);
}

.tab {
    background-color: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -2px;
}

.tab:hover {
    color: var(--text-primary);
    background-color: rgba(0, 255, 65, 0.05);
}

.tab.active {
    color: var(--text-primary);
    border-bottom: 2px solid var(--text-primary);
    text-shadow: 0 0 5px var(--text-primary);
}

/* Example Tabs */
.example-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.example-tab {
    background-color: var(--bg-primary);
    border: 1px solid var(--text-dim);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.example-tab:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.example-tab.active {
    background-color: var(--text-dim);
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* Code Examples */
.examples-container {
    margin-bottom: 2rem;
}

.code-example {
    margin-bottom: 1.5rem;
}

.code-header {
    background-color: var(--bg-primary);
    border: 1px solid var(--text-dim);
    border-bottom: none;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
}

.copy-btn {
    background-color: transparent;
    border: 1px solid var(--text-dim);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background-color: rgba(0, 255, 65, 0.1);
}

.copy-btn:active {
    background-color: var(--text-primary);
    color: var(--bg-primary);
}

.code-example pre {
    margin: 0;
    background-color: var(--bg-primary);
    border: 1px solid var(--text-dim);
    padding: 1.5rem;
    overflow-x: auto;
    font-size: 0.9rem;
}

.code-example code {
    color: var(--text-primary);
    font-family: inherit;
}

.workspace-placeholder {
    color: var(--highlight);
    font-weight: bold;
    text-shadow: 0 0 5px var(--highlight);
}

/* Workspace List */
#workspace-list {
    margin-top: 0.5rem;
}

.workspace-item {
    padding: 0.5rem 0;
    border-left: 2px solid var(--text-dim);
    padding-left: 1rem;
    margin: 0.5rem 0;
}

.workspace-id {
    color: var(--highlight);
    font-weight: bold;
}

/* Subscription Info */
#subscription-info {
    margin-top: 0.5rem;
    padding-left: 1rem;
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
}

#subscription-info p {
    margin: 0.3rem 0;
}

.subscription-status {
    font-weight: bold;
}

.subscription-trial {
    color: var(--highlight);
    text-shadow: 0 0 5px var(--highlight);
}

.subscription-active {
    color: var(--text-primary);
    text-shadow: 0 0 5px var(--text-primary);
}

.subscription-cancelled {
    color: #ff9900;
    text-shadow: 0 0 5px #ff9900;
}

.subscription-inactive {
    color: var(--error);
    text-shadow: 0 0 5px var(--error);
}

.subscription-tier {
    color: var(--text-primary);
    font-weight: bold;
}

.subscription-date {
    color: var(--text-secondary);
}

.bandwidth-usage {
    color: var(--text-primary);
    font-weight: bold;
}

.bandwidth-percentage {
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* Subscription Actions */
.subscription-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 600px;
}

.subscription-button {
    background-color: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
    text-shadow: 0 0 3px var(--text-primary);
}

.subscription-button:hover {
    background-color: var(--text-primary);
    color: var(--bg-primary);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
    text-shadow: none;
}

.subscription-button:active {
    transform: translateY(2px);
}

.subscription-button .button-prompt {
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.subscription-button:hover .button-prompt {
    color: var(--bg-primary);
}

.subscription-button-danger {
    border-color: var(--error);
    color: var(--error);
    text-shadow: 0 0 3px var(--error);
}

.subscription-button-danger:hover {
    background-color: var(--error);
    color: var(--bg-primary);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

.subscription-notice {
    color: var(--highlight);
    padding: 0.75rem;
    border: 1px solid var(--text-dim);
    background-color: rgba(255, 255, 0, 0.05);
    margin-bottom: 0.5rem;
    text-align: center;
}

@media (max-width: 768px) {
    .subscription-actions {
        max-width: 100%;
    }

    .subscription-button {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }
}

/* Footer */
.terminal-footer {
    border: 2px solid var(--border-color);
    border-top: none;
    padding: 0.75rem 1.5rem;
    background-color: var(--bg-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
    margin-top: auto;
}

.status-ready {
    color: var(--text-primary);
    animation: pulse 2s ease-in-out infinite;
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-dim);
    border: 1px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .terminal-content {
        padding: 1rem;
    }

    .ascii-art {
        font-size: 0.6rem;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .example-tabs {
        flex-wrap: wrap;
    }

    .code-example pre {
        font-size: 0.75rem;
        padding: 1rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
}

.loading::after {
    content: '...';
    animation: loading 1.5s steps(4, end) infinite;
}

@keyframes loading {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
}

/* Statistics Section */
.stats-container {
    margin: 2rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.stat-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--text-dim);
    padding: 1.5rem;
}

.stat-header {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-align: center;
    border-bottom: 1px solid var(--text-dim);
    padding-bottom: 0.5rem;
}

.chart-container {
    position: relative;
    height: 200px;
    margin-bottom: 1rem;
}

.stat-details {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
}

.stat-details p {
    margin: 0.3rem 0;
    display: flex;
    justify-content: space-between;
}

.stat-value {
    color: var(--text-primary);
    font-weight: bold;
}

.stat-highlight {
    color: var(--highlight);
}

/* Responsive Stats */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 180px;
    }
}

/* Threshold Control */
.threshold-control {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--text-dim);
}

.fader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.threshold-info {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.threshold-value {
    color: var(--highlight);
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0 0 5px var(--highlight);
    transition: text-shadow 0.3s ease;
}

/* Mixer Channel */
.mixer-channel {
    background-color: #1a1a1a;
    border: 2px solid var(--text-dim);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    min-height: 400px;
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.5),
        0 0 10px rgba(0, 255, 65, 0.1);
}

.channel-label {
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 2px;
    color: var(--text-dim);
    text-align: center;
    border-bottom: 1px solid var(--text-dim);
    padding-bottom: 0.5rem;
    width: 100%;
}

/* Fader Wrapper */
.fader-wrapper {
    display: flex;
    gap: 1rem;
    align-items: stretch;
    flex: 1;
}

/* LED Indicators */
.fader-leds {
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    justify-content: space-between;
}

.fader-led {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background-color: var(--bg-primary);
    border: 1px solid var(--text-dim);
    transition: all 0.2s ease;
}

.fader-led.active {
    background-color: var(--text-primary);
    border-color: var(--text-primary);
    box-shadow:
        0 0 8px rgba(0, 255, 65, 0.8),
        inset 0 0 4px rgba(0, 255, 65, 0.4);
}

/* Fader Track */
.fader-track {
    position: relative;
    width: 40px;
    height: 280px;
    background: linear-gradient(to bottom,
        var(--bg-primary) 0%,
        var(--bg-secondary) 50%,
        var(--bg-primary) 100%);
    border: 2px solid var(--text-dim);
    border-radius: 2px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Fader Handle */
.fader-handle {
    position: absolute;
    width: 50px;
    height: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(to bottom,
        #2a2a2a 0%,
        var(--bg-secondary) 50%,
        #0a0a0a 100%);
    border: 2px solid var(--text-primary);
    border-radius: 3px;
    cursor: grab;
    transition: box-shadow 0.2s ease;
    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.5),
        0 0 10px rgba(0, 255, 65, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.fader-handle:hover {
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.6),
        0 0 15px rgba(0, 255, 65, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.fader-handle:active {
    cursor: grabbing;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.7),
        0 0 20px rgba(0, 255, 65, 0.7),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Fader Grip Lines */
.fader-grip {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
}

.fader-grip::before,
.fader-grip::after {
    content: '';
    width: 70%;
    height: 2px;
    background-color: var(--text-dim);
    border-radius: 1px;
}

/* Threshold Labels */
.threshold-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    color: var(--text-dim);
    font-size: 0.75rem;
    letter-spacing: 1px;
    gap: 0.5rem;
}

.threshold-labels span:first-child {
    font-weight: bold;
    color: var(--text-secondary);
}

.threshold-description {
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
}

@media (max-width: 768px) {
    .threshold-control {
        padding: 1rem;
    }

    .fader-container {
        max-width: 100%;
    }

    .mixer-channel {
        padding: 1rem 0.75rem;
        min-height: 350px;
    }

    .fader-track {
        height: 240px;
    }
}

/* Top Cache Hits Section */
.top-cache-hits-container {
    margin-top: 1rem;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    background-color: var(--bg-secondary);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

.cache-hits-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cache-hit-item {
    padding: 1rem;
    border: 1px solid var(--text-dim);
    background-color: var(--bg-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cache-hit-item:hover {
    border-color: var(--text-primary);
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
    transform: translateX(5px);
}

.cache-hit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.cache-hit-rank {
    color: var(--highlight);
    font-weight: bold;
    margin-right: 1rem;
}

.cache-hit-count {
    color: var(--text-primary);
    font-weight: bold;
}

.cache-hit-preview {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cache-hit-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 2rem;
}

.modal-content {
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.4);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--text-dim);
}

.modal-header h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    text-shadow: 0 0 5px var(--text-primary);
}

.modal-close {
    background: none;
    border: 1px solid var(--text-dim);
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.75rem;
    transition: all 0.2s ease;
}

.modal-close:hover {
    border-color: var(--text-primary);
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

.modal-body {
    padding: 1.5rem;
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-label {
    color: var(--highlight);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.detail-content {
    color: var(--text-secondary);
    background-color: var(--bg-primary);
    padding: 1rem;
    border: 1px solid var(--text-dim);
    border-radius: 4px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 400px;
    overflow-y: auto;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.detail-meta-item {
    background-color: var(--bg-primary);
    padding: 0.75rem;
    border: 1px solid var(--text-dim);
}

.detail-meta-item .label {
    color: var(--text-dim);
    font-size: 0.85rem;
}

.detail-meta-item .value {
    color: var(--text-primary);
    font-weight: bold;
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .modal {
        padding: 1rem;
    }

    .modal-content {
        max-height: 95vh;
    }

    .cache-hit-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cache-hit-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .detail-meta-grid {
        grid-template-columns: 1fr;
    }
}

/* Recent Hit Prompts List */
.recent-hits-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.recent-hit-item {
    background-color: var(--bg-primary);
    padding: 0.75rem;
    border: 1px solid var(--text-dim);
    border-radius: 4px;
}

.recent-hit-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.recent-hit-number {
    color: var(--highlight);
    font-weight: bold;
}

.recent-hit-similarity {
    color: var(--text-primary);
    font-weight: bold;
}

.recent-hit-time {
    color: var(--text-dim);
    margin-left: auto;
}

.recent-hit-prompt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
}

/* Legal Links */
.legal-links {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
}

.legal-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.legal-links a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.legal-links .separator {
    color: var(--text-dim);
    margin: 0 1rem;
}

/* Legal Modals */
.legal-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.legal-modal-content {
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.legal-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-primary);
}

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

.legal-modal-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.legal-modal-close:hover {
    color: var(--highlight);
}

.legal-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.legal-modal-body h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.legal-modal-body h3:first-of-type {
    margin-top: 0;
}

.legal-modal-body p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.legal-modal-body strong {
    color: var(--text-primary);
}

.legal-modal-body ul {
    list-style: none;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.legal-modal-body ul li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    position: relative;
}

.legal-modal-body ul li:before {
    content: ">";
    position: absolute;
    left: -1.5rem;
    color: var(--text-primary);
}

/* Scrollbar styling for modal */
.legal-modal-body::-webkit-scrollbar {
    width: 10px;
}

.legal-modal-body::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.legal-modal-body::-webkit-scrollbar-thumb {
    background: var(--text-dim);
    border: 1px solid var(--border-color);
}

.legal-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Responsive design for modals */
@media (max-width: 768px) {
    .legal-modal {
        padding: 1rem;
    }

    .legal-modal-content {
        max-height: 90vh;
    }

    .legal-modal-header {
        padding: 1rem;
    }

    .legal-modal-header h2 {
        font-size: 1.2rem;
    }

    .legal-modal-body {
        padding: 1rem;
    }

    .legal-links .separator {
        margin: 0 0.5rem;
    }
}

/* API Key Management Styles - Compact List */
.api-keys-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.api-key-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.api-key-row:hover {
    background-color: rgba(0, 255, 65, 0.05);
}

.api-key-row.revoked {
    opacity: 0.6;
}

.api-key-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.status-badge {
    font-size: 0.75rem;
    flex-shrink: 0;
}

.status-badge.active {
    color: var(--highlight);
}

.status-badge.revoked {
    color: var(--text-dim);
}

.api-key-name {
    color: var(--text-primary);
    font-weight: bold;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.api-key-prefix {
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    background-color: var(--bg-primary);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    white-space: nowrap;
}

.api-key-separator {
    color: var(--text-dim);
    font-size: 0.8rem;
}

.api-key-details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dim);
    font-size: 0.85rem;
    white-space: nowrap;
}

.api-key-detail {
    color: var(--text-dim);
}

.api-key-revoke-btn {
    background: none;
    border: 1px solid var(--text-dim);
    color: var(--text-dim);
    padding: 0.35rem 0.75rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.api-key-revoke-btn:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.1);
}

.api-key-revoked-text {
    color: var(--text-dim);
    font-size: 0.85rem;
    font-style: italic;
    padding: 0.35rem 0.75rem;
}

.api-key-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Form Inputs */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.terminal-input,
.terminal-select {
    width: 100%;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    border-radius: 3px;
}

.terminal-input:focus,
.terminal-select:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: 0 0 5px rgba(0, 255, 65, 0.3);
}

.terminal-input::placeholder {
    color: var(--text-dim);
}

/* API Key Display */
.api-key-display {
    background-color: var(--bg-primary);
    border: 2px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 4px;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.api-key-code {
    flex: 1;
    font-family: 'Courier New', monospace;
    color: var(--highlight);
    font-size: 0.9rem;
    word-break: break-all;
    padding: 0.5rem;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

/* Modal Overrides for API Key Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
    max-width: 600px;
    width: 100%;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-primary);
}

.modal-header h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    color: var(--highlight);
}

.modal-body {
    padding: 2rem;
}

/* Responsive API Key List */
@media (max-width: 768px) {
    .api-key-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .api-key-info {
        width: 100%;
        flex-wrap: wrap;
    }

    .api-key-details {
        width: 100%;
        font-size: 0.8rem;
    }

    .api-key-revoke-btn,
    .api-key-revoked-text {
        width: 100%;
        text-align: center;
    }

    .api-key-display {
        flex-direction: column;
    }
}
