/* ========================================
   AI Chat Assistant - Main Styles
   Color Theme: ChatGPT Official Colors
   ======================================== */

:root {
    /* ChatGPT Color Palette */
    --bg-primary: #212121;
    --bg-secondary: #171717;
    --bg-tertiary: #2f2f2f;
    --bg-hover: #3a3a3a;
    --bg-active: #424242;
    
    --text-primary: #ececec;
    --text-secondary: #b4b4b4;
    --text-muted: #8e8e8e;
    
    --accent-primary: #10a37f;
    --accent-secondary: #1a7f64;
    --accent-hover: #0d8c6d;
    
    --border-color: #424242;
    --border-light: #2f2f2f;
    
    --user-message-bg: #2f2f2f;
    --ai-message-bg: transparent;
    
    --code-bg: #1e1e1e;
    --code-header-bg: #2d2d2d;
    
    --success: #10a37f;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s ease;
    
    --sidebar-width: 260px;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    outline: none;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-active);
}

/* ========================================
   App Container
   ======================================== */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal), width var(--transition-normal);
    border-right: 1px solid var(--border-light);
}

.sidebar.collapsed {
    transform: translateX(-100%);
    width: 0;
    overflow: hidden;
}

.sidebar-header {
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
}

.new-chat-btn {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.new-chat-btn:hover {
    background-color: var(--bg-hover);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.history-section {
    margin-bottom: 16px;
}

.history-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding: 0 8px;
}

.chat-item {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color var(--transition-fast);
    margin-bottom: 2px;
}

.chat-item:hover {
    background-color: var(--bg-tertiary);
}

.chat-item.active {
    background-color: var(--bg-tertiary);
}

.chat-item-icon {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.chat-item-text {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item.active .chat-item-text {
    color: var(--text-primary);
}

.chat-item-delete {
    opacity: 0;
    color: var(--text-muted);
    transition: opacity var(--transition-fast);
    padding: 4px;
}

.chat-item:hover .chat-item-delete {
    opacity: 1;
}

.chat-item-delete:hover {
    color: var(--danger);
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.user-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.logout-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--danger);
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.main-header {
    height: 56px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--border-light);
    background-color: var(--bg-primary);
}

.sidebar-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.chat-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.model-selector {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-selector label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.model-selector select {
    padding: 6px 12px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.model-selector select:hover {
    border-color: var(--accent-primary);
}

.model-selector select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(16, 163, 127, 0.2);
}

/* ========================================
   Chat Container
   ======================================== */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

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

.welcome-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 163, 127, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 15px rgba(16, 163, 127, 0);
    }
}

.welcome-icon i {
    font-size: 2.5rem;
    color: white;
}

.welcome-screen h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.welcome-screen p {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.suggestion-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 600px;
    width: 100%;
}

.suggestion-card {
    padding: 16px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition-fast);
}

.suggestion-card:hover {
    background-color: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.suggestion-card i {
    font-size: 1.25rem;
    color: var(--accent-primary);
}

.suggestion-card span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Messages Container */
.messages-container {
    max-width: 800px;
    margin: 0 auto;
}

.message {
    display: flex;
    gap: 16px;
    padding: 20px 0;
    animation: slideIn 0.3s ease;
}

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

.message + .message {
    border-top: 1px solid var(--border-light);
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.message.user-message .message-avatar {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.message.assistant-message .message-avatar {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.message.user-message .message-text {
    color: var(--text-primary);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: var(--text-muted);
    border-radius: var(--radius-full);
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* ========================================
   Code Blocks (VS Code Style)
   ======================================== */
.code-block {
    margin: 16px 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: var(--code-bg);
    border: 1px solid var(--border-color);
}

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

.code-header .language {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

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

.copy-btn.copied {
    color: var(--success);
}

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

.code-block code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #d4d4d4;
}

/* Inline Code */
.inline-code {
    padding: 2px 6px;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85em;
    color: #e06c75;
}

/* ========================================
   Input Area
   ======================================== */
.input-area {
    padding: 16px 20px 24px;
    background: linear-gradient(to top, var(--bg-primary) 80%, transparent);
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: flex-end;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px 12px;
    transition: all var(--transition-fast);
}

.input-container:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(16, 163, 127, 0.2);
}

.input-container textarea {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
    resize: none;
    max-height: 200px;
    padding: 4px 0;
}

.input-container textarea::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 36px;
    height: 36px;
    background-color: var(--accent-primary);
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

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

.send-btn:disabled {
    background-color: var(--bg-hover);
    color: var(--text-muted);
    cursor: not-allowed;
}

.input-footer {
    text-align: center;
    margin-top: 12px;
}

.input-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========================================
   Markdown Styles
   ======================================== */
.message-text h1,
.message-text h2,
.message-text h3,
.message-text h4,
.message-text h5,
.message-text h6 {
    margin: 16px 0 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.message-text h1 { font-size: 1.5rem; }
.message-text h2 { font-size: 1.35rem; }
.message-text h3 { font-size: 1.2rem; }

.message-text p {
    margin: 8px 0;
}

.message-text ul,
.message-text ol {
    margin: 8px 0;
    padding-left: 24px;
}

.message-text li {
    margin: 4px 0;
}

.message-text blockquote {
    border-left: 3px solid var(--accent-primary);
    padding-left: 16px;
    margin: 12px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.message-text a {
    color: var(--accent-primary);
    text-decoration: underline;
}

.message-text a:hover {
    color: var(--accent-hover);
}

.message-text strong {
    font-weight: 600;
    color: var(--text-primary);
}

.message-text em {
    font-style: italic;
}

.message-text code:not(.code-block code) {
    padding: 2px 6px;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-family: 'Consolas', monospace;
    font-size: 0.85em;
    color: #e06c75;
}

.message-text hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 16px 0;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .suggestion-cards {
        grid-template-columns: 1fr;
    }

    .model-selector label {
        display: none;
    }

    .welcome-screen h2 {
        font-size: 1.25rem;
    }

    .welcome-icon {
        width: 60px;
        height: 60px;
    }

    .welcome-icon i {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .input-container {
        padding: 6px 10px;
    }

    .message {
        gap: 12px;
    }

    .message-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
}

/* ========================================
   Loading Spinner
   ======================================== */
.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--bg-hover);
    border-top-color: var(--accent-primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

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

/* ========================================
   Error State
   ======================================== */
.error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: var(--danger);
    font-size: 0.875rem;
    margin: 12px 0;
}

.error-message i {
    font-size: 1rem;
}

/* ========================================
   Overlay for mobile sidebar
   ======================================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* ========================================
   Sidebar Logo
   ======================================== */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 8px 0;
}

.logo-img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ========================================
   Sidebar Navigation Tabs
   ======================================== */
.sidebar-nav {
    display: flex;
    padding: 8px 12px;
    gap: 4px;
    border-bottom: 1px solid var(--border-light);
}

.nav-tab {
    flex: 1;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-tab:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-tab.active {
    background-color: var(--bg-tertiary);
    color: var(--accent-primary);
}

.nav-tab i {
    font-size: 0.85rem;
}

/* ========================================
   Tools List
   ======================================== */
.tools-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tool-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.tool-item:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.tool-item i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
}

.tool-item[data-downloader] i {
    color: var(--accent-primary);
}

.tool-item[data-tool] i {
    color: var(--warning);
}

/* ========================================
   Hidden Utility
   ======================================== */
.hidden {
    display: none !important;
}

/* ========================================
   Header Brand
   ======================================== */
.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
}

/* ========================================
   Welcome Icon with Image
   ======================================== */
.welcome-icon {
    width: 100px;
    height: 100px;
    background: transparent;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    animation: pulse 2s infinite;
}

.welcome-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ========================================
   Tool Interface
   ======================================== */
.tool-interface {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.back-to-chat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.back-to-chat:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.tool-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tool-content {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.tool-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.tool-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.tool-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-form label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.tool-form input,
.tool-form select,
.tool-form textarea {
    padding: 12px 16px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.tool-form input:focus,
.tool-form select:focus,
.tool-form textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.15);
}

.tool-form input::placeholder,
.tool-form textarea::placeholder {
    color: var(--text-muted);
}

.tool-execute-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.tool-execute-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.4);
}

.tool-execute-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   Tool Result
   ======================================== */
.tool-result {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    animation: slideIn 0.3s ease;
}

.tool-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.tool-result-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-result-header h3 i {
    color: var(--success);
}

.tool-result-content {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.tool-result-content pre {
    background-color: var(--code-bg);
    padding: 16px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 12px 0;
}

.tool-result-content code {
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
    color: #d4d4d4;
}

/* ========================================
   Image/Video Preview
   ======================================== */
.media-preview {
    margin: 16px 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: var(--bg-tertiary);
}

.media-preview img,
.media-preview video {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    display: block;
}

.media-preview a {
    display: block;
    padding: 12px;
    text-align: center;
    background-color: var(--bg-hover);
    color: var(--accent-primary);
    font-weight: 500;
    transition: background-color var(--transition-fast);
}

.media-preview a:hover {
    background-color: var(--bg-active);
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-radius: var(--radius-md);
    font-weight: 500;
    margin-top: 12px;
    transition: all var(--transition-fast);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.4);
}

/* ========================================
   Data Result Table
   ======================================== */
.data-result {
    margin: 16px 0;
}

.data-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.data-row:last-child {
    border-bottom: none;
}

.data-label {
    width: 140px;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.data-value {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    word-break: break-word;
}

/* ========================================
   OTP Grid
   ======================================== */
.otp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin: 16px 0;
}

.otp-item {
    padding: 10px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
    color: var(--accent-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.otp-item:hover {
    background-color: var(--bg-hover);
    border-color: var(--accent-primary);
}

.otp-item.copied {
    background-color: rgba(16, 163, 127, 0.2);
    border-color: var(--success);
    color: var(--success);
}

/* ========================================
   Modal Styles
   ======================================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    animation: modalSlide 0.3s ease;
}

.modal-content.modal-lg {
    max-width: 700px;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ========================================
   Button Styles
   ======================================== */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.4);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

/* ========================================
   Loading State
   ======================================== */
.loading-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(33, 33, 33, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 10;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========================================
   Image Generation Result
   ======================================== */
.image-result {
    text-align: center;
    padding: 20px;
}

.image-result img {
    max-width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.image-result .image-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}
