/* Base Styles */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #818cf8;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --background-color: #f9fafb;
    --background-secondary: #f3f4f6;
    --surface-color: #ffffff;
    --text-color: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --input-bg: #ffffff;
    --input-border: #d1d5db;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --transition: all 0.2s ease-in-out;
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    transition: var(--transition);
}

/* Layout - Vertical Mode */
.page-wrapper {
    max-width: 900px !important;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex !important;
    flex-direction: column !important;
    gap: 2rem;
    min-height: 100vh;
}

.main-content {
    width: 100% !important;
    order: 1;
}

.sidebar {
    width: 100% !important;
    order: 2;
}

.navbar {
    order: 0;
}

/* Disable horizontal layout even on large screens */
@media (min-width: 1400px) {
    .page-wrapper {
        max-width: 1000px !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .main-content {
        width: 100% !important;
    }
    
    .sidebar {
        width: 100% !important;
    }
}

/* Cards */
.card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Navbar */
.navbar {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.nav-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    line-height: 1.2;
}

.nav-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 400;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 0.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
}

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

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

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--input-bg);
    background-clip: padding-box;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

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

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn-outline:hover {
    background-color: rgba(79, 70, 229, 0.05);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

body.dark-mode .btn-outline:hover {
    background-color: rgba(99, 102, 241, 0.1);
}

.btn-warning {
    background-color: #f59e0b;
    color: white;
    border: 1px solid #d97706;
}

.btn-warning:hover {
    background-color: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.3);
}

.btn-warning:active {
    transform: translateY(0);
}

body.dark-mode .btn-warning {
    background-color: #f59e0b;
    border-color: #f59e0b;
}

body.dark-mode .btn-warning:hover {
    background-color: #d97706;
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.4);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-hover);
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.back-to-top:active {
    transform: translateY(-2px);
}

body.dark-mode .back-to-top {
    background: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode .back-to-top:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }
}

/* Image Analysis Collapsible */
.analysis-content {
    position: relative;
}

.analysis-content.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, transparent, var(--card-bg));
    pointer-events: none;
}

.btn-text {
    transition: color 0.2s ease;
}

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

body.dark-mode .btn-text:hover {
    color: #818cf8;
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(to right, transparent, var(--surface-color));
}

.nav-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .page-wrapper {
        padding: 1rem;
        gap: 1.5rem;
    }
    
    .navbar {
        padding: 1rem 0;
        flex-wrap: wrap;
    }
    
    .nav-title {
        font-size: 1.5rem;
    }
    
    .nav-actions {
        gap: 0.5rem;
    }
}

/* Dark Mode */
body.dark-mode {
    --primary-color: #6366f1;
    --primary-hover: #818cf8;
    --primary-light: #a5b4fc;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --error-color: #f87171;
    --background-color: #0f172a;
    --background-secondary: #1e293b;
    --surface-color: #1e293b;
    --text-color: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --border-light: #293548;
    --input-bg: #1e293b;
    --input-border: #475569;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

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

:root {
    --success-color: #28a745;
    --warning-color: #ffc107;
    --error-color: #dc3545;
    --background-color: #f4f7f6;
    --text-color: #333;
    --container-bg: white;
    --card-bg: #fff;
    --button-bg: #007bff;
    --button-text: white;
    --border-color: #eee;
    --h1-color: #4a4a4a;
    --input-bg: #f8f9fa;
    --input-border: #ccc;
    --warning-bg: #fffbe6;
    --warning-text: #8a6d3b;
    --warning-border: #ffeeba;
    --warning-code-bg: #fcf8e3;
}

body.dark-mode {
    --background-color: #121212;
    --text-color: #e0e0e0;
    --container-bg: #1e1e1e;
    --card-bg: #2c2c2c;
    --button-bg: #0056b3;
    --button-text: #e0e0e0;
    --border-color: #444;
    --h1-color: #e0e0e0;
    --input-bg: #333;
    --input-border: #555;
    --warning-bg: #2c2a22;
    --warning-text: #d4b886;
    --warning-border: #5a4a2e;
    --warning-code-bg: #3a3830;
}

.container {
    background: var(--container-bg);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 1200px;
    margin: auto;
    position: relative;
}

.history-panel {
    position: fixed;
    right: -300px;
    top: 80px;
    width: 280px;
    background: var(--container-bg);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    transition: transform 0.3s ease;
    z-index: 100;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.history-panel.show {
    transform: translateX(-320px);
}

.history-toggle-btn {
    position: fixed;
    top: 20px;
    right: 80px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    opacity: 0.9;
}

.history-toggle-btn:hover {
    transform: scale(1.1);
}

.empty-history {
    color: var(--text-color);
    opacity: 0.6;
    text-align: center;
    padding: 1rem 0;
    font-style: italic;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.history-header h3 {
    margin: 0;
    color: var(--h1-color);
    font-size: 1.1rem;
}

.clear-history-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.clear-history-btn:hover {
    opacity: 1;
}

.history-list {
    max-height: 500px;
    overflow-y: auto;
}

.history-item {
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.history-item:hover {
    background-color: var(--input-bg);
}

.history-item .prompt {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.history-item .metadata {
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.7;
}

.history-item .star-btn {
    float: right;
    background: none;
    border: none;
    color: #ffd700;
    cursor: pointer;
    padding: 0;
    font-size: 1.2rem;
    opacity: 0.3;
    transition: opacity 0.2s;
}

.history-item .star-btn:hover,
.history-item .star-btn.starred {
    opacity: 1;
}

.header {
    text-align: center;
    margin-bottom: 1rem;
}


/* Theme Switcher - Modern Design */
.theme-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.theme-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-switch .slider {
    position: relative;
    width: 52px;
    height: 28px;
    background: var(--border-color);
    border-radius: 14px;
    transition: var(--transition);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.theme-switch .slider:before {
    content: "🌙";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: var(--shadow-sm);
}

.theme-switch input:checked + .slider {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.theme-switch input:checked + .slider:before {
    transform: translateX(24px);
    content: "☀️";
}

.theme-switch:hover .slider {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(79, 70, 229, 0.1);
}

body.dark-mode .theme-switch .slider:before {
    background: var(--surface-color);
}

.card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.api-warning {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-left: 4px solid var(--warning-color);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.api-warning .card-title {
    color: var(--warning-color);
    margin-bottom: 0.75rem;
}

.api-warning p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.api-warning code {
    background: rgba(251, 191, 36, 0.15);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--text-color);
}

.api-info {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(99, 102, 241, 0.03) 100%);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.api-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.api-info strong {
    color: var(--primary-color);
    font-weight: 600;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: left;
    font-size: 0.9rem;
}

body.dark-mode .api-key-info {
    background-color: #1e3a4a;
    color: #8ed8f8;
    border-color: #2c6384;
}

h1 {
    margin-top: 0;
    color: var(--h1-color);
    text-align: center;
}

h2 {
    margin-top: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--h1-color);
}

p {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.main-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 2rem;
    align-items: stretch;
    width: 100%;
}

textarea {
    width: 100%;
    height: 100px;
    padding: 0.5rem;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    margin-bottom: 1rem;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    background-color: var(--input-bg);
    color: var(--text-color);
}

.selectors-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.selector {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    margin-bottom: 1rem;
}

.text-emphasis-wrapper {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-bottom: 10px;
}

.text-emphasis-wrapper input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 14px;
}

.text-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.text-control-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.text-control-group {
    flex: 1;
    min-width: 120px;
}

.text-control-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.8rem;
    color: var(--text-color);
}

.text-control-group select {
    width: 100%;
    padding: 6px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 13px;
}

/* Collapsible text controls */
.text-controls {
    position: relative;
}

.text-controls-toggle {
    position: absolute;
    top: -25px;
    right: 0;
    font-size: 0.8rem;
    color: var(--button-bg);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 5px;
    text-decoration: underline;
}

.text-controls.collapsed .text-control-row:not(:first-child) {
    display: none;
}

@media (max-width: 768px) {
    .text-control-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .text-control-group {
        width: 100%;
    }
}

/* Model info styling */
.model-info {
    margin: 10px 0 15px;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.4;
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.dark-mode .model-info {
    background-color: #2c2c2c;
    border-left: 4px solid #0056b3;
}

.model-info strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1rem;
}

.model-info em {
    display: block;
    margin-top: 5px;
    font-style: italic;
    opacity: 0.8;
}

/* Model-specific styling */
.flux-model {
    border-left-color: #3498db;
}

.qwen-model {
    border-left-color: #2ecc71;
}

.nunchaku-model {
    border-left-color: #e74c3c;
}

.selector label {
    margin-bottom: 5px;
    color: var(--text-color);
    font-size: 0.9rem;
}

input[type="file"], input[type="text"], select, textarea {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    box-sizing: border-box;
    background-color: var(--input-bg);
    color: var(--text-color);
}

button {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    width: 100%;
    margin-top: 0.5rem;
}

button:hover {
    opacity: 0.8;
}

#result-container {
    margin-top: 2rem;
    text-align: left;
    background-color: var(--container-bg);
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    display: none; /* Hidden by default */
}

pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-color);
    font-size: 0.95rem;
}

.image-analysis-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.drop-zone {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    background: var(--input-bg);
    border: 2px dashed var(--input-border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.3s, background-color 0.3s;
    position: relative;
}

.drop-zone.is-dragover {
    border-color: var(--button-bg);
    background-color: rgba(0, 123, 255, 0.05);
}

.drop-zone-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.drop-zone-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.drop-zone-text {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.drop-zone-prompt {
    color: var(--text-color);
    font-size: 1.1rem;
}

.drop-zone-hint {
    color: var(--text-color);
    opacity: 0.6;
    font-size: 0.9rem;
}

/* Audio Analysis Results */
.audio-analysis-results {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--background-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.audio-analysis-results .analysis-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
}

.audio-analysis-results .analysis-title svg {
    color: var(--primary-color);
}

.audio-analysis-results .analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
}

.audio-analysis-results .analysis-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.audio-analysis-results .analysis-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.audio-analysis-results .analysis-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
}

.audio-analysis-results .analysis-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.25rem;
}

.audio-analysis-results .analysis-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.audio-analysis-results .analysis-description {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Mood/Energy color indicators */
.analysis-value.mood-happy { color: #10b981; }
.analysis-value.mood-energetic { color: #f59e0b; }
.analysis-value.mood-emotional { color: #8b5cf6; }
.analysis-value.mood-calm { color: #3b82f6; }
.analysis-value.mood-neutral { color: var(--text-muted); }

.analysis-value.energy-high { color: #ef4444; }
.analysis-value.energy-medium { color: #f59e0b; }
.analysis-value.energy-low { color: #3b82f6; }

.analysis-value.vocals-yes { color: #10b981; }
.analysis-value.vocals-no { color: var(--text-muted); }

#image-result-container {
    display: flex;
    margin-top: 1rem;
    gap: 1rem;
    align-items: flex-start;
}

#image-preview {
    max-width: 150px;
    max-height: 150px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    object-fit: cover;
}

#image-description-box {
    text-align: left;
    flex: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .selectors-container {
        flex-direction: column;
    }
}

#scroll-to-top-btn {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: var(--button-bg);
    color: var(--button-text);
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    font-size: 18px;
    width: 50px;
    height: 50px;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#scroll-to-top-btn:hover {
    background-color: #0056b3;
}

/* --- Button Enhancements --- */

.textarea-container {
    position: relative;
    width: 100%;
}

.char-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.7;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 2px 6px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

body.dark-mode .char-counter {
    background-color: rgba(50, 50, 50, 0.7);
}

.char-counter.near-limit {
    color: #ff9800;
    font-weight: bold;
    opacity: 1;
}

.char-counter.at-limit {
    color: #f44336;
    font-weight: bold;
    opacity: 1;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.model-limit-info {
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-top: 5px;
    display: flex;
    justify-content: space-between;
}

.model-limit-info .limit-warning {
    color: #f44336;
    font-weight: bold;
    display: none;
}

.model-limit-info.warning .limit-warning {
    display: block;
}

.clear-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 0;
    width: auto;
    margin: 0;
    line-height: 1;
    opacity: 0.5;
}

.clear-btn:hover {
    opacity: 1;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.result-header h2 {
    margin: 0;
    border: none;
    padding: 0;
}

.button-group {
    display: flex;
    gap: 0.5rem;
}

.copy-btn, .share-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.9rem;
    width: auto;
    margin: 0;
}

.share-btn {
    background-color: #2e8b57;
}

.share-btn:hover {
    background-color: #1d6e42;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

body.dark-mode button:disabled {
    background-color: #555;
}

.loader {
    border: 4px solid #f3f3f3; /* Light grey */
    border-top: 4px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.loader-small {
    border: 2px solid #f3f3f3; /* Light grey */
    border-top: 2px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

/* Upload Progress Styles */
.upload-progress-container {
    margin: 10px 0;
    width: 100%;
}

.upload-progress-bar {
    height: 10px;
    background-color: #f3f3f3;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}

.upload-progress-fill {
    height: 100%;
    background-color: #3498db;
    width: 0%;
    transition: width 0.3s ease;
}

.upload-progress-text {
    font-size: 0.8rem;
    color: var(--text-color);
    text-align: center;
}

.error-message {
    color: #dc3545;
    padding: 10px;
    border-left: 3px solid #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
    margin: 10px 0;
}

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

/* --- Keyboard Shortcuts --- */
.shortcuts-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 100;
    transition: transform 0.2s;
}

.shortcuts-btn:hover {
    transform: scale(1.1);
}

.shortcuts-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.shortcuts-overlay.show {
    display: flex;
}

.shortcuts-content {
    background: var(--container-bg);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
}

.shortcuts-content h3 {
    margin-top: 0;
    color: var(--h1-color);
    text-align: center;
    margin-bottom: 1.5rem;
}

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

.view-toggle {
    display: flex;
    gap: 5px;
}

.view-btn {
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.view-btn.active {
    background: var(--button-bg);
    color: var(--button-text);
}

.result-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.action-button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background-color: var(--button-bg);
    color: var(--button-text);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.action-button:hover {
    opacity: 0.8;
    background-color: var(--button-bg);
}

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

.view-mode {
    display: none;
}

.view-mode.active {
    display: block;
}

/* Negative prompt panel (LTX2) */
.negative-prompt-panel {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
}

.negative-prompt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.negative-prompt-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-color);
}

.negative-prompt-header h4 i {
    color: #e74c3c;
    margin-right: 6px;
}

.negative-prompt-header .copy-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 0.8rem;
    transition: background 0.15s;
}

.negative-prompt-header .copy-btn:hover {
    background: var(--border-color);
}

.negative-prompt-text {
    font-family: 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary, #aaa);
    white-space: pre-wrap;
    word-break: break-word;
}

.quality-panel {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
}

.quality-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.quality-panel-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-color);
}

.quality-overall-score {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--button-bg);
}

.quality-metrics {
    display: grid;
    gap: 8px;
}

.quality-metric {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) 2fr auto;
    align-items: center;
    gap: 10px;
}

.quality-metric-label,
.quality-metric-value {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.quality-metric-value {
    font-weight: 600;
    color: var(--text-color);
}

.quality-metric-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--border-color);
    overflow: hidden;
}

.quality-metric-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
}

.quality-improvements-block {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.quality-improvements-block h5 {
    margin: 0 0 6px;
    font-size: 0.85rem;
    color: var(--text-color);
}

.quality-improvements {
    margin: 0;
    padding-left: 18px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: grid;
    gap: 4px;
}

.compare-container {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.compare-column {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

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

.compare-header h4 {
    margin: 0;
    font-size: 1rem;
}

.compare-content {
    padding: 15px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.compare-info {
    text-align: center;
    font-style: italic;
    color: var(--text-muted);
    margin-top: 10px;
}

.small-btn {
    padding: 3px 6px;
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.8rem;
}

.small-btn:hover {
    color: #f44336;
}

#import-label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.shortcut {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: var(--input-bg);
    border-radius: 5px;
}

.shortcut kbd {
    background: var(--button-bg);
    color: var(--button-text);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
}

.shortcut span {
    color: var(--text-color);
}

/* Editor Components */
.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.editor-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.editor-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--background-secondary);
    padding: 0.25rem;
    border-radius: var(--radius-md);
}

.editor-tab {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.editor-tab.active {
    background: var(--surface-color);
    color: var(--text-color);
    box-shadow: var(--shadow-sm);
}

.editor-tab:hover {
    color: var(--text-color);
    background: var(--surface-color);
}

.editor-content {
    min-height: 400px;
}

.tab-pane {
    display: none;
}

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

.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--background-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.model-selector {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.model-selector label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.model-selector select {
    padding: 0.5rem;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 0.875rem;
    min-width: 120px;
}

.editor-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.prompt-input-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-header label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
}

.input-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.textarea-container {
    position: relative;
}

.textarea-container textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    padding-right: 3rem;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    background: var(--input-bg);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
    transition: var(--transition);
}

.textarea-container textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
}

.btn-ghost.btn-sm {
    padding: 0.25rem;
    width: 28px;
    height: 28px;
}

.enhancement-panel {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--background-secondary);
}

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

.panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.panel-content {
    padding: 1rem;
}

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

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.setting-group select {
    padding: 0.5rem;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 0.875rem;
}

/* Templates Tab */
.templates-library {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.templates-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.templates-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.template-search input {
    padding: 0.5rem;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 0.875rem;
    width: 250px;
}

.template-categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.category-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--transition);
}

.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

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

.template-card {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    cursor: pointer;
    transition: var(--transition);
}

.template-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.template-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 0.5rem 0;
}

.template-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

/* History Tab */
.history-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 500px;
    overflow-y: auto;
}

.history-item {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    cursor: pointer;
    transition: var(--transition);
}

.history-item:hover {
    box-shadow: var(--shadow-sm);
    background: var(--background-secondary);
}

.history-item .prompt {
    font-size: 0.875rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.history-item .metadata {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Compare Tab */
.compare-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.compare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compare-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.compare-container {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.compare-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.compare-column h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.compare-text {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}

.compare-divider {
    width: 1px;
    background: var(--border-color);
    height: 100%;
    min-height: 200px;
}
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-notification {
    background-color: #fff;
    color: #333;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.5s, transform 0.5s;
    border-left: 5px solid;
    min-width: 250px;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-notification.hide {
    opacity: 0;
    transform: translateX(100%);
}

.toast-notification.success {
    border-left-color: #28a745;
}

.toast-notification.error {
    border-left-color: #dc3545;
}

.toast-notification.info {
    border-left-color: #17a2b8;
}

body.dark-mode .toast-notification {
    background-color: #333;
    color: #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .toast-notification.success {
    border-left-color: #34c759;
}

body.dark-mode .toast-notification.error {
    border-left-color: #ff453a;
}

body.dark-mode .toast-notification.info {
    border-left-color: #64d2ff;
}

/* Image Analysis Styles */
.image-result-container {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--surface-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease-out;
}

.image-preview-container {
    margin-bottom: 1rem;
    text-align: center;
}

.image-preview-container img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

#image-description {
    padding: 1rem;
    background: rgba(67, 97, 238, 0.05);
    border-left: 3px solid var(--primary-color);
    border-radius: var(--radius-sm);
}

#image-description h4 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

#image-description-text {
    margin: 0;
    color: var(--text-color);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.upload-progress-container {
    padding: 1rem;
    background: rgba(67, 97, 238, 0.05);
    border-radius: var(--radius-sm);
}

.upload-progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #6366f1);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.upload-progress-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.error-message {
    color: var(--error-color);
    padding: 0.75rem;
    background: rgba(220, 53, 69, 0.1);
    border-left: 3px solid var(--error-color);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
}

body.dark-mode #image-description {
    background: rgba(67, 97, 238, 0.15);
}

body.dark-mode .upload-progress-container {
    background: rgba(67, 97, 238, 0.15);
}

body.dark-mode .error-message {
    background: rgba(255, 69, 58, 0.15);
}

/* Enhanced Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-color);
}

h2 {
    font-size: 1.5rem;
    margin: 0 0 1.5rem 0;
}

h3 {
    font-size: 1.25rem;
    margin: 0 0 1rem 0;
}

code {
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.875em;
}

/* Improved Link Styling */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

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

/* Professional Select Styling */
select {
    cursor: pointer;
}

select:hover {
    border-color: var(--primary-color);
}

/* Enhanced Button States */
.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Smooth Transitions for Dark Mode */
* {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Real-time Suggestions */
.realtime-suggestions {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}

.suggestion-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    transition: background-color var(--transition);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: var(--background-secondary);
}

.suggestion-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.suggestion-icon {
    font-size: 1.2rem;
}

.suggestion-category {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.category-technical { background-color: #dbeafe; color: #1e40af; }
.category-descriptive { background-color: #dcfce7; color: #166534; }
.category-artistic { background-color: #fef3c7; color: #92400e; }
.category-general { background-color: #f3f4f6; color: #374151; }

.dark-mode .category-technical { background-color: #1e3a8a; color: #dbeafe; }
.dark-mode .category-descriptive { background-color: #14532d; color: #dcfce7; }
.dark-mode .category-artistic { background-color: #78350f; color: #fef3c7; }
.dark-mode .category-general { background-color: #374151; color: #f3f4f6; }

.suggestion-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.suggestion-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.apply-suggestion-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition);
}

.apply-suggestion-btn:hover {
    background: var(--primary-hover);
}

.suggestion-loading {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

.no-suggestions {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
}

.suggestion-error {
    padding: 1rem;
    text-align: center;
    color: var(--error-color);
}

/* Enhanced prompt input container for suggestions */
.prompt-input-container {
    position: relative;
}

/* Artistic Style Information */
.style-analysis {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin: 1rem 0;
    box-shadow: var(--shadow-lg);
}

.style-analysis h4 {
    color: white;
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.style-analysis h4::before {
    content: "🎨";
    font-size: 1.5rem;
}

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

.style-info-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}

.style-info-item strong {
    display: block;
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.style-info-item span {
    font-size: 1rem;
    font-weight: 500;
}

.style-keywords {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.style-keywords strong {
    display: block;
    margin-bottom: 0.5rem;
}

.keyword-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    margin: 0.125rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark-mode .style-analysis {
    background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 100%);
}
