/* ============================================
   Interface Styles
   ============================================ */

/* Common Interface Styles */
.loading-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
    color: var(--playground-text-secondary);
}

.error-state svg {
    color: var(--playground-error);
    margin-bottom: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--playground-border);
    border-top-color: var(--playground-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   Chat Interface
   ============================================ */

.chat-interface {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--playground-border);
    border-radius: 3px;
}

.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--playground-text-secondary);
}

.chat-welcome h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--playground-text-primary);
    margin-bottom: 8px;
}

.chat-welcome p {
    font-size: 14px;
}

.chat-message {
    display: flex;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

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

.chat-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-color: var(--playground-bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--playground-text-secondary);
    flex-shrink: 0;
}

.chat-message-user .chat-message-avatar {
    background-color: var(--playground-accent-light);
    color: var(--playground-accent);
}

.chat-message-content {
    flex: 1;
    padding: 12px 16px;
    background-color: var(--playground-bg-tertiary);
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--playground-text-primary);
    word-wrap: break-word;
}

.chat-user-attachments {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chat-user-attachment {
    border: 1px solid var(--playground-border);
    border-radius: 12px;
    overflow: hidden;
    width: 160px;
    height: 120px;
    background-color: var(--playground-bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chat-user-attachment img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-user-attachment video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #000;
}

.chat-user-attachment.video::after {
    content: '🎬';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 16px;
}

.video-attachment-chip {
    padding: 10px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background-color: var(--playground-bg-secondary);
}

.assistant-message {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.thinking-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--playground-border);
    background-color: var(--playground-bg-secondary);
}

.thinking-wrapper.hidden {
    display: none;
}

.thinking-indicator {
    display: flex;
    gap: 4px;
}

.thinking-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--playground-accent);
    animation: thinkingPulse 1.2s infinite ease-in-out;
}

.thinking-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes thinkingPulse {
    0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.reasoning-block {
    border: 1px solid var(--playground-border);
    border-radius: 10px;
    background-color: var(--playground-bg-secondary);
    padding: 0 12px 12px;
    transition: border-color var(--transition-speed) ease;
}

.reasoning-block.hidden {
    display: none;
}

.reasoning-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 0;
    cursor: pointer;
    gap: 8px;
    list-style: none;
    color: var(--playground-text-tertiary);
}

.reasoning-block summary::-webkit-details-marker {
    display: none;
}

.reasoning-header svg {
    transition: transform var(--transition-speed) ease;
}

.reasoning-block[open] .reasoning-header svg {
    transform: rotate(180deg);
}

.reasoning-content {
    font-size: 13px;
    color: var(--playground-text-secondary);
    white-space: pre-line;
}

.message-body {
    min-height: 24px;
}

.markdown-body {
    font-size: 14px;
    line-height: 1.7;
    color: var(--playground-text-primary);
}

.markdown-body p {
    margin: 0 0 12px;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 20px;
    margin: 0 0 12px;
}

.markdown-body pre {
    background-color: var(--playground-bg-tertiary);
    border: 1px solid var(--playground-border);
    border-radius: 8px;
    padding: 12px;
    overflow-x: auto;
    font-size: 13px;
}

.markdown-body code {
    background-color: rgba(148, 163, 184, 0.2);
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 13px;
}

.markdown-body pre code {
    background: none;
    padding: 0;
}

.markdown-body blockquote {
    border-left: 3px solid var(--playground-border);
    margin: 0 0 12px;
    padding-left: 12px;
    color: var(--playground-text-secondary);
    font-style: italic;
}

.chat-message-error-block {
    border: 1px solid var(--playground-error);
    background-color: rgba(239, 68, 68, 0.08);
}

.chat-message-error .chat-message-content {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--playground-error);
    border: 1px solid var(--playground-error);
}

.chat-input-container {
    border-top: 1px solid var(--playground-border);
    padding: 16px 24px;
    background-color: var(--playground-bg-primary);
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
    background-color: var(--playground-bg-secondary);
    border: 1px solid var(--playground-border);
    border-radius: 12px;
    padding: 8px;
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--playground-text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 200px;
    padding: 8px;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: var(--playground-accent);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    background-color: var(--playground-accent-hover);
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--playground-text-tertiary);
}

.chat-model-badge {
    padding: 4px 8px;
    background-color: var(--playground-accent-light);
    color: var(--playground-accent);
    border-radius: 4px;
    font-weight: 500;
}

.chat-attachments-panel {
    border: 1px solid var(--playground-border);
    border-radius: 12px;
    margin: 16px 24px 0;
    padding: 16px;
    background-color: var(--playground-bg-secondary);
}

.chat-attachments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.chat-attachments-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.chat-attachments-header p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--playground-text-tertiary);
}

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

.ghost-button.small {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attachment-placeholder {
    margin: 0;
    font-size: 13px;
    color: var(--playground-text-tertiary);
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--playground-border);
    border-radius: 10px;
    padding: 10px;
    background-color: var(--playground-bg-primary);
}

.attachment-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--playground-bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.attachment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #000;
}

.attachment-meta {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    color: var(--playground-text-secondary);
}

.attachment-meta strong {
    font-size: 13px;
    color: var(--playground-text-primary);
}

/* ============================================
   Image Interface
   ============================================ */

.image-interface {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: clamp(20px, 3vw, 36px);
}

body.image-playground-active .image-interface {
    border: 1px solid var(--playground-border);
    border-radius: 28px;
    background: var(--playground-bg-secondary);
    box-shadow: var(--playground-shadow-lg);
}

.image-visual-column {
    display: flex;
    flex-direction: column;
    gap: clamp(18px, 2vw, 30px);
}

.image-comparison-card {
    border-radius: 24px;
    border: 1px solid var(--playground-border);
    background: linear-gradient(145deg, var(--playground-bg-primary), var(--playground-bg-secondary));
    padding: clamp(20px, 2.5vw, 32px);
    box-shadow: var(--playground-shadow-md);
}

.image-output-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.image-output-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    color: var(--playground-text-tertiary);
    margin: 0 0 6px;
}

.image-output-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--playground-text-primary);
}

.image-output-helper {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--playground-text-secondary);
}

.image-chip {
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: var(--playground-accent);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.image-viewport {
    position: relative;
    width: 100%;
    min-height: clamp(360px, 58vh, 820px);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background:
        radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.12), transparent 55%),
        radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.12), transparent 45%),
        var(--playground-bg-primary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.image-viewport::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08), transparent 70%);
    pointer-events: none;
}

.viewport-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.viewport-layer img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: var(--playground-bg-primary);
}

.viewport-layer--overlay {
    width: var(--slider-position, 60%);
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.4);
    transition: width 0.1s ease;
}

.image-viewport[data-slider-enabled="false"] .viewport-layer--overlay {
    border-right-color: transparent;
}

.image-viewport-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(6px);
    z-index: 3;
}

.image-viewport-empty[hidden] {
    display: none;
}

.image-placeholder {
    text-align: center;
    color: var(--playground-text-tertiary);
    padding: 40px;
    max-width: 360px;
    margin: 0 auto;
}

.image-placeholder svg,
.image-placeholder .spinner {
    margin-bottom: 16px;
}

.image-placeholder.error {
    color: var(--playground-error);
}

.image-slider-handle {
    position: absolute;
    top: 16px;
    bottom: 16px;
    left: 60%;
    width: 54px;
    margin-left: -27px;
    border: none;
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(59, 130, 246, 0.2), rgba(16, 185, 129, 0.05)),
        rgba(15, 23, 42, 0.85);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 0;
    cursor: ew-resize;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.3);
    z-index: 2;
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
    backdrop-filter: blur(6px);
}

.image-slider-handle .handle-track {
    width: 2px;
    flex: 1;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.2));
    border-radius: 999px;
}

.image-slider-handle .handle-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.7);
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.45);
}

.image-slider-handle:focus-visible {
    outline: 2px solid var(--playground-accent);
    outline-offset: 2px;
}

.handle-chevron {
    width: 16px;
    height: 16px;
    border-top: 2px solid rgba(255, 255, 255, 0.8);
    border-right: 2px solid rgba(255, 255, 255, 0.8);
    opacity: 0.8;
}

.handle-chevron--left {
    transform: rotate(225deg);
}

.handle-chevron--right {
    transform: rotate(45deg);
}

.image-viewport[data-slider-enabled="false"] .image-slider-handle {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) scale(0.85);
}

.viewport-hint {
    margin: 14px 0 0;
    font-size: 13px;
    color: var(--playground-text-tertiary);
}

.image-reference-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--playground-border);
    border-radius: 20px;
    padding: 14px 18px;
    background: var(--playground-bg-primary);
    box-shadow: var(--playground-shadow-sm);
}

.reference-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--playground-border);
    background: var(--playground-bg-secondary);
    color: var(--playground-text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.reference-upload-btn:hover {
    border-color: var(--playground-accent);
    color: var(--playground-accent);
}

.reference-preview-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    border-radius: 18px;
    border: 1px dashed var(--playground-border);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.reference-preview-chip.has-reference {
    border-style: solid;
    background: var(--playground-bg-secondary);
}

.chip-thumb {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--playground-bg-tertiary);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chip-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chip-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.chip-copy strong {
    font-size: 13px;
    color: var(--playground-text-primary);
}

.chip-copy span {
    font-size: 12px;
    color: var(--playground-text-secondary);
}

.reference-url-inline {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reference-url-inline input {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--playground-border);
    background: var(--playground-bg-tertiary);
    color: var(--playground-text-primary);
    padding: 10px 12px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.reference-url-inline input:focus {
    outline: none;
    border-color: var(--playground-accent);
    box-shadow: 0 0 0 3px var(--playground-accent-light);
}

.reference-inline-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ghost-button {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--playground-border);
    background-color: transparent;
    color: var(--playground-text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.ghost-button-small {
    padding: 6px 10px;
    font-size: 12px;
}

.ghost-button:hover:not(:disabled) {
    border-color: var(--playground-accent);
    color: var(--playground-accent);
}

.ghost-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.image-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .image-actions {
        justify-content: flex-start;
    }
}

body.image-playground-active .image-actions {
    justify-content: flex-start;
    padding-top: 12px;
    border-top: 1px solid var(--playground-border);
    margin-top: 12px;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: none;
}

.action-button.primary {
    background-color: var(--playground-accent);
    color: white;
}

.action-button.primary:hover:not(:disabled) {
    background-color: var(--playground-accent-hover);
}

.action-button.secondary {
    background-color: var(--playground-bg-tertiary);
    color: var(--playground-text-primary);
    border: 1px solid var(--playground-border);
}

.action-button.secondary:hover:not(:disabled) {
    background-color: var(--playground-bg-hover);
    border-color: var(--playground-border-hover);
}

.action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* ============================================
   Video Interface
   ============================================ */

.video-interface {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: clamp(20px, 3vw, 36px);
}

.video-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr);
    gap: clamp(18px, 2.5vw, 32px);
}

@media (max-width: 1100px) {
    .video-layout {
        grid-template-columns: 1fr;
    }
}

.video-layout--single {
    grid-template-columns: 1fr;
}

.video-display-card {
    border: 1px solid var(--playground-border);
    border-radius: 24px;
    background: linear-gradient(140deg, var(--playground-bg-primary), var(--playground-bg-secondary));
    padding: clamp(20px, 2.2vw, 32px);
    box-shadow: var(--playground-shadow-md);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.video-display-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.video-display-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    color: var(--playground-text-tertiary);
    margin: 0 0 6px;
}

.video-display-header h4 {
    margin: 0;
    color: var(--playground-text-primary);
    font-size: 1.15rem;
}

.video-display-header p {
    margin: 6px 0 0;
    color: var(--playground-text-secondary);
    font-size: 13px;
}

.video-chip {
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: var(--playground-accent);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.video-output-shell {
    position: relative;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background-color: var(--playground-bg-primary);
    padding: clamp(12px, 1.5vw, 18px);
}

.video-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.video-output {
    width: 100%;
    min-height: clamp(320px, 45vh, 640px);
    background-color: var(--playground-bg-tertiary);
    border: 2px dashed var(--playground-border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-output.video-output--filled {
    border-color: transparent;
    background-color: #020617;
}

.video-placeholder {
    text-align: center;
    color: var(--playground-text-tertiary);
    padding: 40px;
}

.video-placeholder svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.generated-video {
    width: 100%;
    max-height: 100%;
    border-radius: 12px;
    object-fit: contain;
    background-color: #000;
    display: block;
}

.video-output img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: contain;
}

.video-input-panel {
    border: 1px solid var(--playground-border);
    border-radius: 24px;
    padding: clamp(18px, 2vw, 28px);
    background: var(--playground-bg-secondary);
    box-shadow: var(--playground-shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.video-guide-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.video-input-card {
    border: 1px dashed var(--playground-border);
    border-radius: 18px;
    padding: 16px;
    background-color: var(--playground-bg-primary);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.video-input-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.video-input-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    color: var(--playground-text-tertiary);
    margin: 0 0 4px;
}

.video-input-card h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--playground-text-primary);
}

.video-input-card--guide .video-guide-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.video-guide-list li {
    background-color: var(--playground-bg-secondary);
    border: 1px solid var(--playground-border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.video-guide-list span {
    font-size: 12px;
    color: var(--playground-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.video-guide-list strong {
    font-size: 16px;
    color: var(--playground-text-primary);
}

.video-guide-note {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--playground-text-secondary);
}

.video-actions--stacked {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.video-interface .upload-area {
    border: 1px dashed var(--playground-border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    background-color: var(--playground-bg-tertiary);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.video-interface .upload-area:hover {
    border-color: var(--playground-accent);
    background-color: var(--playground-bg-hover);
}

.video-interface .upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--playground-text-secondary);
    font-size: 14px;
}

.video-interface .upload-area .upload-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background-color: var(--playground-bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--playground-accent);
}

.video-interface .upload-text {
    font-weight: 600;
    color: var(--playground-text-primary);
}

.video-interface .upload-url-input {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--playground-border);
    background-color: var(--playground-bg-tertiary);
    padding: 10px 12px;
    font-size: 14px;
    color: var(--playground-text-primary);
    transition: border-color var(--transition-speed) ease;
}

.video-interface .upload-url-input:focus {
    outline: none;
    border-color: var(--playground-accent);
    box-shadow: 0 0 0 3px var(--playground-accent-light);
}

.video-interface .help-text {
    font-size: 12px;
    color: var(--playground-text-tertiary);
    margin: 0;
}

.video-interface .upload-area {
    border: 1px dashed var(--playground-border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    background-color: var(--playground-bg-tertiary);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.video-interface .upload-area:hover {
    border-color: var(--playground-accent);
    background-color: var(--playground-bg-hover);
}

.video-interface .upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--playground-text-secondary);
    font-size: 14px;
}

.video-interface .upload-area .upload-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background-color: var(--playground-bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--playground-accent);
}

.video-interface .upload-text {
    font-weight: 600;
    color: var(--playground-text-primary);
}

.video-interface .upload-url-input {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--playground-border);
    background-color: var(--playground-bg-tertiary);
    padding: 10px 12px;
    font-size: 14px;
    color: var(--playground-text-primary);
    transition: border-color var(--transition-speed) ease;
}

.video-interface .upload-url-input:focus {
    outline: none;
    border-color: var(--playground-accent);
    box-shadow: 0 0 0 3px var(--playground-accent-light);
}

.video-interface .help-text {
    font-size: 12px;
    color: var(--playground-text-tertiary);
    margin: 0;
}

@media (max-width: 900px) {
    .image-preview-grid {
        grid-template-columns: 1fr;
    }
}

.video-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.video-actions--solo {
    justify-content: flex-start;
}

.info-badge {
    padding: 6px 12px;
    background-color: var(--playground-accent-light);
    color: var(--playground-accent);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

/* ============================================
   Audio Interface
   ============================================ */

.audio-interface {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px;
    gap: 24px;
}

.audio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.audio-card {
    border: 1px solid var(--playground-border);
    border-radius: 16px;
    background-color: var(--playground-bg-secondary);
    box-shadow: var(--playground-shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.audio-card-header {
    padding: 20px 20px 0;
}

.audio-card-header h3 {
    margin: 4px 0 6px;
}

.audio-card-header p {
    margin: 0;
    color: var(--playground-text-secondary);
}

.audio-card-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    color: var(--playground-text-tertiary);
    margin: 0;
}

.audio-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.audio-upload-section {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.audio-input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.audio-reference-panel {
    border: 1px solid var(--playground-border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: var(--playground-bg-tertiary);
}

.audio-reference-panel h4 {
    margin: 0 0 4px;
}

.audio-reference-panel p {
    margin: 0;
    color: var(--playground-text-secondary);
    font-size: 13px;
}

.audio-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background-color: var(--playground-bg-tertiary);
    border: 1px solid var(--playground-border);
    border-radius: 8px;
    color: var(--playground-text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.audio-upload-btn:hover {
    background-color: var(--playground-bg-hover);
    border-color: var(--playground-border-hover);
}

.or-divider {
    color: var(--playground-text-tertiary);
    font-size: 13px;
}

.record-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background-color: var(--playground-bg-tertiary);
    border: 1px solid var(--playground-border);
    border-radius: 8px;
    color: var(--playground-text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.record-btn:hover {
    background-color: var(--playground-bg-hover);
}

.record-btn.recording {
    background-color: var(--playground-error);
    color: white;
    border-color: var(--playground-error);
    animation: pulse 2s ease-in-out infinite;
}

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

.audio-player-section {
    display: flex;
    justify-content: center;
    padding: 16px;
    background-color: var(--playground-bg-tertiary);
    border-radius: 8px;
}

.audio-player-section.hidden,
.audio-output-section.hidden {
    display: none;
}

.audio-player-section audio,
.audio-output-section audio {
    width: 100%;
    max-width: 500px;
}

.audio-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.audio-interface .upload-status-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--playground-border);
    background-color: var(--playground-bg-tertiary);
}

.audio-interface .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--playground-text-tertiary);
    flex-shrink: 0;
}

.audio-interface .upload-status-card[data-state="local"] .status-dot,
.audio-interface .upload-status-card[data-state="uploading"] .status-dot {
    background-color: var(--playground-warning);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

.audio-interface .upload-status-card[data-state="ready"] .status-dot {
    background-color: var(--playground-success);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

.audio-interface .upload-status-card[data-state="error"] .status-dot {
    background-color: var(--playground-error);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

.audio-interface .status-label {
    margin: 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--playground-text-tertiary);
}

.audio-interface .status-message {
    margin: 2px 0 0;
    font-size: 14px;
    color: var(--playground-text-primary);
}

.audio-interface .upload-status-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}


.audio-examples-card {
    margin-top: 8px;
}

.audio-examples-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.transcription-output {
    flex: 1;
    padding: 20px;
    background-color: var(--playground-bg-tertiary);
    border: 1px solid var(--playground-border);
    border-radius: 12px;
    min-height: 200px;
    color: var(--playground-text-primary);
    font-size: 14px;
    line-height: 1.6;
    overflow-y: auto;
}

.transcription-output .placeholder-text {
    color: var(--playground-text-tertiary);
    text-align: center;
    padding: 60px 20px;
}

.tts-input-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tts-input {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--playground-bg-tertiary);
    border: 1px solid var(--playground-border);
    border-radius: 8px;
    color: var(--playground-text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}

.tts-input:focus {
    outline: none;
    border-color: var(--playground-accent);
    box-shadow: 0 0 0 3px var(--playground-accent-light);
}

.audio-output-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    padding: 20px;
    background-color: var(--playground-bg-tertiary);
    border-radius: 12px;
}

/* ============================================
   API View
   ============================================ */

.api-view-content {
    padding: 24px;
}

.api-header {
    margin-bottom: 24px;
}

.api-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--playground-text-primary);
    margin-bottom: 8px;
}

.api-header p {
    font-size: 14px;
    color: var(--playground-text-secondary);
    line-height: 1.5;
}

.api-examples {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.code-example {
    border: 1px solid var(--playground-border);
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--playground-bg-secondary);
}

.code-example-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: var(--playground-bg-tertiary);
    border-bottom: 1px solid var(--playground-border);
}

.code-language {
    font-size: 12px;
    font-weight: 600;
    color: var(--playground-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.copy-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: var(--playground-bg-secondary);
    border: 1px solid var(--playground-border);
    border-radius: 6px;
    color: var(--playground-text-primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.copy-button:hover {
    background-color: var(--playground-bg-hover);
    border-color: var(--playground-border-hover);
}

.code-example pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
}

.code-example code {
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--playground-text-primary);
}

.code-example pre::-webkit-scrollbar {
    height: 8px;
}

.code-example pre::-webkit-scrollbar-track {
    background: var(--playground-bg-tertiary);
}

.code-example pre::-webkit-scrollbar-thumb {
    background: var(--playground-border);
    border-radius: 4px;
}

.code-example pre::-webkit-scrollbar-thumb:hover {
    background: var(--playground-border-hover);
}
