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

:root {
    /* @tweakable light mode primary color */
    --light-primary: #ff6b35;
    /* @tweakable light mode secondary color */
    --light-secondary: #ff8c42;
    /* @tweakable light mode accent color */
    --light-accent: #ffa726;
    /* @tweakable light mode primary background */
    --light-bg-primary: #fef9f5;
    /* @tweakable light mode secondary background */
    --light-bg-secondary: #fff3e0;
    /* @tweakable light mode primary text color */
    --light-text-primary: #2c2c2c;
    /* @tweakable light mode secondary text color */
    --light-text-secondary: #666666;
    /* @tweakable light mode border color */
    --light-border: #e0e0e0;
    
    /* @tweakable dark mode primary color */
    --dark-primary: #ff6b35;
    /* @tweakable dark mode secondary color */
    --dark-secondary: #d84315;
    /* @tweakable dark mode accent color */
    --dark-accent: #ff8a50;
    /* @tweakable dark mode primary background */
    --dark-bg-primary: #1a1a1a;
    /* @tweakable dark mode secondary background */
    --dark-bg-secondary: #2c2c2c;
    /* @tweakable dark mode primary text color */
    --dark-text-primary: #e0e0e0;
    /* @tweakable dark mode secondary text color */
    --dark-text-secondary: #b0b0b0;
    /* @tweakable dark mode border color */
    --dark-border: #404040;
    
    /* @tweakable gradient animation speed */
    --gradient-speed: 15s;
    /* @tweakable gradient background size */
    --gradient-size: 400%;
    
    /* @tweakable theme transition duration */
    --theme-transition: 0.3s;
    
    /* Dynamic color variables (will be updated by theme) */
    --primary-color: var(--light-primary);
    --secondary-color: var(--light-secondary);
    --accent-color: var(--light-accent);
    --bg-primary: var(--light-bg-primary);
    --bg-secondary: var(--light-bg-secondary);
    --text-primary: var(--light-text-primary);
    --text-secondary: var(--light-text-secondary);
    --border-color: var(--light-border);
    
    /* Original variables maintained for compatibility */
    --primary-dark: #d84315;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --bg-dark: #111827; /* @tweakable dark code background */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    /* @tweakable global border radius */
    --radius: 8px;
    /* @tweakable default sans-serif font stack */
    --font-sans: 'DM Sans', 'Inter', system-ui, -apple-system, sans-serif;
    /* @tweakable default display font stack */
    --font-display: 'Poppins', system-ui, sans-serif;
    /* @tweakable default monospace font stack */
    --font-mono: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
    /* @tweakable header height */
    --header-height: 80px;
    /* @tweakable footer minimum height */
    --footer-min-height: 200px; /* Adjusted for better content display */
    --nav-width: 280px;
    /* @tweakable default content padding */
    --content-padding: 2rem;
    /* @tweakable card inner padding */
    --card-padding: 1.5rem;
    /* @tweakable section spacing */
    --section-gap: 3rem;
    /* @tweakable sidebar width in expanded state */
    --sidebar-width: 300px;
    /* @tweakable sidebar width in collapsed state */
    --sidebar-collapsed-width: 60px;
    /* @tweakable chat section minimum height */
    --chat-min-height: 250px;
    /* @tweakable code viewer minimum height */
    --code-viewer-min-height: 400px;
    /* @tweakable gap between workspace panels */
    --workspace-gap: 20px;
    /* @tweakable sidebar background with transparency */
    --sidebar-bg: rgba(255, 255, 255, 0.95);
    /* @tweakable workspace panel shadow */
    --workspace-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    /* @tweakable separator line color */
    --separator-color: rgba(0, 0, 0, 0.1);
    /* @tweakable general hover transition */
    --hover-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    /* @tweakable syntax highlighting comment color */
    --syntax-comment: #6b7280;
    /* @tweakable syntax highlighting keyword color */
    --syntax-keyword: #8b5cf6;
    /* @tweakable syntax highlighting string color */
    --syntax-string: #10b981;
    /* @tweakable syntax highlighting number color */
    --syntax-number: #f59e0b;
}

/* Dark theme overrides */
[data-theme="dark"] {
    --primary-color: var(--dark-primary);
    --secondary-color: var(--dark-secondary);
    --accent-color: var(--dark-accent);
    --bg-primary: var(--dark-bg-primary);
    --bg-secondary: var(--dark-bg-secondary);
    --text-primary: var(--dark-text-primary);
    --text-secondary: var(--dark-text-secondary);
    --border-color: var(--dark-border);
    --sidebar-bg: rgba(45, 45, 45, 0.95);
    --workspace-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --separator-color: rgba(255, 255, 255, 0.1);
    /* Dark mode code background specific */
    --bg-dark: #0a0a0a; 
}

/* Load Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=Poppins:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

body {
    font-family: var(--font-sans);
    /* @tweakable light mode gradient background */
    background: linear-gradient(-45deg, #ff6b35, #ffa726, #ff8c42, #ffcc80, #fff3e0, #fef9f5);
    background-size: var(--gradient-size) var(--gradient-size);
    animation: gradientBG var(--gradient-speed) ease infinite;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 400;
    display: flex;
    flex-direction: column;
    transition: background var(--theme-transition), color var(--theme-transition);
}

/* @tweakable dark mode gradient background */
[data-theme="dark"] body {
    background: linear-gradient(-45deg, #1a1a1a, #2c2c2c, #ff6b35, #d84315, #424242, #1a1a1a);
    background-size: var(--gradient-size) var(--gradient-size);
    animation: gradientBG var(--gradient-speed) ease infinite;
}

/* Ensure main content takes available space */
main {
    flex: 1 0 auto;
    padding: var(--section-gap) 0;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: background var(--theme-transition), border-color var(--theme-transition);
}

[data-theme="dark"] .header {
    background: rgba(26, 26, 26, 0.95);
    border-bottom-color: var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
    gap: 2rem;
}

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

.logo i {
    font-size: 2.25rem;
    color: var(--primary-color);
    filter: drop-shadow(0 2px 4px rgba(255, 107, 53, 0.3));
    transition: color var(--theme-transition);
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 600;
    font-family: var(--font-display);
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.01em;
    transition: background var(--theme-transition);
}

.nav {
    display: flex;
    gap: 0.25rem;
    background: rgba(255, 107, 53, 0.1);
    border-radius: 8px;
    padding: 0.25rem;
    transition: background var(--theme-transition);
}

[data-theme="dark"] .nav {
    background: rgba(255, 107, 53, 0.2);
}

.nav-btn {
    padding: 0.75rem 1.25rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-family: var(--font-sans);
    color: var(--text-secondary);
}

.nav-btn:hover,
.nav-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

/* Theme Controls */
.theme-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    /* @tweakable theme toggle button size */
    width: 44px;
    height: 44px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all var(--theme-transition);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* Theme toggle icon animation */
.theme-toggle i {
    transition: transform var(--theme-transition);
}

[data-theme="dark"] .theme-toggle i {
    transform: rotate(180deg);
}

/* Main Content */
.main {
    padding: var(--section-gap) 0;
    min-height: calc(100vh - var(--header-height) - var(--footer-min-height)); /* Adjusted */
}

.section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    padding: var(--content-padding);
    margin-bottom: var(--section-gap);
    display: none;
    animation: fadeIn 0.3s ease-in-out;
    border: 1px solid var(--border-color);
    transition: background var(--theme-transition), border-color var(--theme-transition), box-shadow var(--theme-transition);
}

[data-theme="dark"] .section {
    background: rgba(26, 26, 26, 0.95);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.section.active {
    display: block;
}

/* Section transition animations */
.section.section-enter {
    animation: slideInFromRight 0.3s forwards;
}

.section.section-exit {
    animation: fadeOutAndSlideOutLeft 0.3s forwards;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOutAndSlideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
        display: none; /* Hide element completely after animation */
    }
}

.section-header {
    text-align: center;
    margin-bottom: var(--section-gap);
    position: relative;
    padding-bottom: 1rem;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.section-header h2 {
    font-size: 2.25rem;
    font-weight: 600;
    font-family: var(--font-display);
    margin-bottom: 0.75rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.01em;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* Enhanced Settings Styles */
.settings-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
}

.settings-category {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: var(--hover-transition);
    position: relative;
    transition: all 0.3s ease;
}

.settings-category:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.settings-category h3 {
    color: var(--color-primary, var(--primary-color));
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.4rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
    padding-bottom: 12px;
}

.settings-list {
    display: grid;
    gap: 1rem;
}

.setting-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    position: relative;
}

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

.setting-item:hover {
    background: rgba(102, 126, 234, 0.02);
    border-radius: 8px;
    padding: 16px 12px;
    margin: 0 -12px;
}

.setting-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.setting-label span {
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-primary);
}

.setting-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.setting-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.setting-control input[type="checkbox"] {
    appearance: none;
    width: 40px;
    height: 20px;
    background: var(--border-color);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
}

.setting-control input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

.setting-control input[type="checkbox"]:checked {
    background: var(--primary-color);
}

.setting-control input[type="checkbox"]:checked::before {
    transform: translateX(20px);
}

.setting-control select,
.setting-control input[type="text"],
.setting-control input[type="number"] {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    min-width: 120px;
}

.setting-control select:focus,
.setting-control input[type="text"]:focus,
.setting-control input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Enhanced Error Handling Styles */
.initialization-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    color: white;
    font-family: var(--font-sans);
}

.error-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.error-icon {
    color: var(--error-color);
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

.error-title {
    color: var(--error-color);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    font-family: var(--font-display);
}

.error-message {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.error-details {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    text-align: left;
    word-break: break-word;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.error-contact {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.error-contact a {
    color: var(--primary-color);
    text-decoration: none;
}

.error-contact a:hover {
    text-decoration: underline;
}

/* Enhanced FAQ and Guide Modal Styles */
.guide-content h4,
.guide-content h5,
.faq-content h5 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
    font-family: var(--font-display);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-content h4 {
    font-size: 1.4rem;
    margin-top: 0;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.guide-content h5,
.faq-content h5 {
    font-size: 1.2rem;
}

.guide-content p,
.faq-content p {
    line-height: 1.6;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.guide-content ul,
.faq-content ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.guide-content li,
.faq-content li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.guide-content strong,
.faq-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

.guide-content em,
.faq-content em {
    color: var(--text-secondary);
    font-style: italic;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.faq-item {
    background: rgba(102, 126, 234, 0.05);
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.faq-item:hover {
    background: rgba(102, 126, 234, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

/* Generator Section */
.generator-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: var(--workspace-gap);
    align-items: start;
    min-height: calc(100vh - var(--header-height) - 100px);
    transition: var(--hover-transition);
}

.generator-container.sidebar-collapsed {
    grid-template-columns: var(--sidebar-collapsed-width) 1fr;
}

.input-panel,
.output-panel {
    background: rgba(248, 250, 252, 0.7);
    backdrop-filter: blur(5px);
    padding: var(--card-padding);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.input-panel {
    position: sticky;
    top: calc(var(--header-height) + 1rem);
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-family: var(--font-sans);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: var(--font-sans);
    transition: all 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Services Selector */
.services-selector {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 40px;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 2px dashed var(--border-color);
}

.service-tag {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideIn 0.3s ease;
}

.remove-service {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.common-services {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.service-suggestion {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.service-suggestion:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* Buttons */
.btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-family: var(--font-sans);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    background: var(--secondary-color);
}

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

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
    color: white;
}

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

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

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.btn-icon {
    padding: 0.5rem;
    min-width: auto;
}

.btn-with-loader {
    min-width: 120px;
}

.btn-loader {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Code Output */
.code-output {
    background: var(--bg-dark);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.code-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9), rgba(118, 75, 162, 0.9));
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-weight: 500;
    font-family: var(--font-sans);
}

.code-actions {
    display: flex;
    gap: 0.5rem;
}

.code-actions .btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.code-actions .btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

#generatedCode {
    background: var(--bg-dark);
    color: #e5e7eb;
    padding: 1rem;
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
}

/* Suggestions */
.suggestions {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(59, 130, 246, 0.05));
    border: 2px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.5s ease-in-out;
}

.suggestions h3 {
    color: var(--success-color);
    margin-bottom: 1rem;
    font-family: var(--font-display);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.suggestion-item {
    background: rgba(255, 255, 255, 0.7);
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--success-color);
    animation: slideIn 0.3s ease-out;
    animation-fill-mode: both;
    transition: all 0.2s ease;
}

.suggestion-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(5px);
}

/* Free Fields */
.free-fields {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(147, 51, 234, 0.05));
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.free-fields h3 {
    color: var(--primary-color);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
}

.fields-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.field-input {
    background: rgba(255, 255, 255, 0.8);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid rgba(59, 130, 246, 0.1);
    backdrop-filter: blur(5px);
}

.field-input .field-title {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-family: var(--font-sans);
    font-size: 0.95rem;
}

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

.field-input input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
}

/* Chat Section */
.chat-section {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(59, 130, 246, 0.05));
    border: 2px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.chat-section h3 {
    color: var(--success-color);
    margin-bottom: 1rem;
    font-family: var(--font-display);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-messages {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
}

.chat-message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    animation: slideIn 0.3s ease;
}

.chat-message.user {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    margin-left: 2rem;
}

.chat-message.ai {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-primary);
    margin-right: 2rem;
    border: 1px solid var(--border-color);
}

.message-header {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    opacity: 0.8;
}

.chat-input-container {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chat-input-container input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-sans);
}

/* Footer */
.footer {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    height: var(--footer-min-height); /* Adjusted */
    flex-shrink: 0;
    transition: background var(--theme-transition), border-color var(--theme-transition);
}

[data-theme="dark"] .footer {
    background: rgba(10, 10, 10, 0.95);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 3rem 0;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.loading-spinner {
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.loading-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.loading-logo i {
    font-size: 4rem;
    color: var(--primary-color);
    animation: pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.5));
}

.loading-logo h2 {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: var(--font-display);
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.spinner-wheel {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(102, 126, 234, 0.3);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.loading-text {
    font-size: 1.2rem;
    font-weight: 500;
    color: white;
    font-family: var(--font-sans);
    opacity: 0.9;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transform: translateX(100%);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: shimmer 2s infinite;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    transform-origin: left;
    opacity: 0.7;
}

.toast.toast-enter {
    transform: translateX(0);
}

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

.toast-success {
    border-left-color: var(--success-color);
}

.toast-error {
    border-left-color: var(--error-color);
}

.toast-warning {
    border-left-color: var(--warning-color);
}

.toast-info {
    border-left-color: var(--primary-color);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.toast-content i {
    font-size: 1.2rem;
}

.toast-success .toast-content i {
    color: var(--success-color);
}

.toast-error .toast-content i {
    color: var(--error-color);
}

.toast-warning .toast-content i {
    color: var(--warning-color);
}

.toast-info .toast-content i {
    color: var(--primary-color);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(102, 126, 234, 0.2);
    z-index: 999;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

.progress-text {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.8rem;
    z-index: 1000;
}

/* Blocks Grid */
.blocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.block-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.block-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.block-card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.block-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.block-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.block-tags {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.tag {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
}

.block-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.block-card:hover .block-actions {
    opacity: 1;
}

/* Files List */
.files-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.file-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.file-item:hover {
    background: var(--bg-primary);
    transform: translateX(5px);
}

.file-info h3 {
    margin-bottom: 0.25rem;
    color: var(--primary-color);
}

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

.file-meta {
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--border-color);
    transition: background var(--theme-transition), border-color var(--theme-transition);
}

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

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

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

.modal-body {
    padding: 1.5rem;
}

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

/* Enhanced Generator Section */
.workspace-sidebar {
    background: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: var(--workspace-shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--hover-transition);
    position: sticky;
    top: calc(var(--header-height) + 20px);
    max-height: calc(100vh - var(--header-height) - 40px);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--separator-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: var(--hover-transition);
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.sidebar-content {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - var(--header-height) - 140px);
}

.sidebar-collapsed .sidebar-content {
    padding: 10px 5px;
}

.sidebar-collapsed .sidebar-header h3,
.sidebar-collapsed .block-name,
.sidebar-collapsed .block-description {
    display: none;
}

.sidebar-block-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--hover-transition);
    position: relative;
    overflow: hidden;
}

.sidebar-block-card:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: var(--workspace-shadow);
}

.sidebar-block-card.collapsed {
    padding: 12px 8px;
    text-align: center;
}

.block-icon {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.block-name {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
    color: var(--text-primary);
}

.block-description {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.3;
    margin-bottom: 8px;
}

.block-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.mini-tag {
    background: var(--primary-color);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
}

.main-workspace {
    display: flex;
    flex-direction: column;
    gap: var(--workspace-gap);
    min-height: calc(100vh - var(--header-height) - 100px);
}

.input-panel {
    background: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--workspace-shadow);
    order: 1;
}

.output-panel {
    background: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--workspace-shadow);
    overflow: hidden;
    order: 2;
    flex: 1;
}

.code-output {
    background: var(--bg-dark);
    border-radius: 12px;
    overflow: hidden;
    margin: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    min-height: var(--code-viewer-min-height);
    display: flex;
    flex-direction: column;
    transition: background var(--theme-transition);
}

[data-theme="dark"] .code-output {
    background: #0a0a0a;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.code-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.code-stats {
    font-size: 12px;
    opacity: 0.8;
    display: flex;
    gap: 12px;
}

#generatedCode {
    background: var(--bg-dark);
    color: #e5e7eb;
    padding: 24px;
    margin: 0;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    overflow: auto;
    white-space: pre-wrap;
    flex: 1;
    min-height: calc(var(--code-viewer-min-height) - 80px);
    --syntax-comment: #6b7280;
    --syntax-keyword: #8b5cf6;
    --syntax-string: #10b981;
    --syntax-number: #f59e0b;
}

.chat-section {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(59, 130, 246, 0.05));
    border: 2px solid rgba(16, 185, 129, 0.2);
    border-radius: 16px;
    margin: 20px;
    overflow: hidden;
    min-height: var(--chat-min-height);
    display: flex;
    flex-direction: column;
}

.chat-header {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    padding: 16px 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    min-height: 180px;
    max-height: 300px;
    background: rgba(255, 255, 255, 0.3);
}

.chat-message {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    animation: slideIn 0.3s ease;
    max-width: 85%;
    word-wrap: break-word;
}

.chat-message.user {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.chat-message.ai {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.chat-input-container {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.7);
    border-top: 1px solid var(--separator-color);
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-input-container input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-family: var(--font-sans);
    background: rgba(255, 255, 255, 0.9);
    transition: var(--hover-transition);
}

.chat-input-container input:focus {
    outline: none;
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.chat-send-btn {
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: var(--hover-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    background: #059669;
    transform: scale(1.05);
}

.free-fields {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(147, 51, 234, 0.05));
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    margin: 20px;
    overflow: hidden;
}

.fields-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 16px 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fields-container {
    padding: 20px;
}

.field-input {
    background: rgba(255, 255, 255, 0.9);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid rgba(59, 130, 246, 0.1);
    transition: var(--hover-transition);
}

.field-input:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(59, 130, 246, 0.3);
}

.suggestions {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(59, 130, 246, 0.05));
    border: 2px solid rgba(16, 185, 129, 0.2);
    border-radius: 16px;
    margin: 20px;
    overflow: hidden;
}

.suggestions-header {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    padding: 16px 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggestions-content {
    padding: 20px;
}

.suggestion-item {
    background: rgba(255, 255, 255, 0.8);
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 12px;
    border-left: 4px solid var(--success-color);
    transition: var(--hover-transition);
    cursor: pointer;
}

.suggestion-item:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
}

/* Settings Actions */
.settings-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 32px;
    padding: 24px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.settings-actions .btn {
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    font-family: var(--font-sans);
    position: relative;
    overflow: hidden;
}

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

.settings-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.settings-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.settings-actions .btn-primary:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.database-config {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-top: 16px;
    transition: all 0.3s ease;
}

.database-config .setting-item {
    margin-bottom: 12px;
}

.database-config input {
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* Value display styles */
#fontSizeValue,
#lineHeightValue,
#notificationDurationValue {
    background: var(--color-primary, var(--primary-color));
    color: white;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 45px;
    text-align: center;
    font-family: var(--font-mono);
}

/* Tooltip styles */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: normal;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: 117%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tooltip:hover::after,
.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* High contrast mode improvements */
@media (prefers-contrast: high) {
    .nav-btn,
    .btn,
    .form-group input,
    .form-group select,
    .form-group textarea {
        border-width: 2px;
    }
    
    .section {
        border: 2px solid var(--border-color);
    }
}

/* Animations */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

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

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(102, 126, 234, 0); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

/* Animation Classes */
.fade-in-animation {
    animation: fadeIn 0.5s ease-in-out;
}

.slide-in-animation {
    animation: slideIn 0.3s ease-out;
}

.pulse-animation {
    animation: enhancedPulse 1s ease-in-out;
}

@keyframes enhancedPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

.feedback-success {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.feedback-error {
    animation: errorShake 0.6s ease-in-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* @tweakable enhanced visual feedback animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes themeFlash {
    0% { opacity: 0; }
    50% { opacity: 0.3; }
    100% { opacity: 0; }
}

/* @tweakable enhanced button feedback */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease, transform 0.15s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    background: var(--secondary-color);
}

.btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
    transition: transform 0.1s ease;
}

/* @tweakable loading button states */
.btn[aria-busy="true"] {
    pointer-events: none;
    position: relative;
}

.btn[aria-busy="true"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* @tweakable enhanced form feedback */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    transform: scale(1.02);
    transition: all 0.3s ease;
}

.form-group input.success,
.form-group select.success,
.form-group textarea.success {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    background: rgba(16, 185, 129, 0.02);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    background: rgba(239, 68, 68, 0.02);
}

/* @tweakable enhanced loading states */
.loading-overlay {
    backdrop-filter: blur(8px);
}

.loading-spinner {
    animation: floatIn 0.5s ease-out;
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* @tweakable settings specific feedback */
.settings-category {
    transition: all 0.3s ease;
    position: relative;
}

.settings-category:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.setting-item {
    transition: all 0.2s ease;
    position: relative;
}

.setting-item:hover {
    transform: translateX(5px);
}

/* @tweakable enhanced tooltips */
.enhanced-tooltip {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    line-height: 1.4;
    max-width: 200px;
    white-space: normal;
    word-wrap: break-word;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.enhanced-tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

/* @tweakable progress bar enhancements */
.progress-bar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.progress-fill::after {
    animation: shimmer 1.5s infinite;
}

/* @tweakable modal enhancements */
.modal {
    backdrop-filter: blur(8px);
}

.modal-content {
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* @tweakable enhanced micro-interactions */
.nav-btn {
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.nav-btn:hover::before {
    left: 100%;
}

/* @tweakable block and file item enhancements */
.block-card,
.file-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.block-card::before,
.file-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.block-card:hover::before,
.file-item:hover::before {
    opacity: 1;
}

/* @tweakable enhanced focus indicators */
*:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* @tweakable enhanced checkbox and radio styling */
input[type="checkbox"],
input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

input[type="checkbox"]:checked::before {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 12px;
}

input[type="radio"] {
    border-radius: 50%;
}

input[type="radio"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* @tweakable enhanced slider styling */
input[type="range"] {
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* @tweakable enhanced color input styling */
input[type="color"] {
    appearance: none;
    width: 50px;
    height: 35px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="color"]:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* @tweakable enhanced animation classes */
.pulse-animation {
    animation: enhancedPulse 1s ease-in-out;
}

@keyframes enhancedPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* @tweakable enhanced feedback animations */
.feedback-success {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.feedback-error {
    animation: errorShake 0.6s ease-in-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* @tweakable enhanced loading animations */
.loading-pulse {
    animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.02);
    }
}

/* @tweakable enhanced success flash */
.success-flash {
    animation: successFlash 0.8s ease-in-out;
}

@keyframes successFlash {
    0% {
        background-color: transparent;
        transform: scale(1);
    }
    50% {
        background-color: rgba(16, 185, 129, 0.2);
        transform: scale(1.02);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

/* @tweakable added for form validation error feedback */
.validation-error {
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    animation: slideDown 0.3s ease;
}

/* @tweakable added for form validation success feedback */
.validation-success {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--success-color);
    animation: fadeIn 0.3s ease;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .generator-container {
        grid-template-columns: 260px 1fr;
    }
    
    :root {
        --sidebar-width: 260px;
    }
}

@media (max-width: 1200px) {
    .generator-container {
        grid-template-columns: 240px 1fr;
    }
    
    :root {
        --sidebar-width: 240px;
        --workspace-gap: 16px;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .nav {
        order: 2;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 1024px) {
    .header-content {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }
    
    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .theme-controls {
        order: 2;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 0 16px;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .nav {
        width: 100%;
        overflow-x: auto;
        padding: 0.5rem;
    }
    
    .nav-btn {
        white-space: nowrap;
        min-width: 100px;
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
    
    .theme-toggle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .logo {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .nav {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-btn {
        width: 100%;
    }
}

/* File Upload and Sharing Styles */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: rgba(102, 126, 234, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    margin: 1rem 0;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.file-upload-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.uploaded-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.uploaded-file-tag {
    background: var(--primary-color);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideIn 0.3s ease;
}

.remove-file {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Image Generation Modal */
.image-generation-modal .modal-content {
    max-width: 700px;
}

.image-preview {
    width: 100%;
    max-width: 512px;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

/* Document Export Styles */
.export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.export-option {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.export-option:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
}

.export-option.selected {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

.export-option i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

/* Enhanced Chat Features */
.chat-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid var(--separator-color);
    flex-wrap: wrap;
}

.chat-tool-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-tool-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-1px);
}

.chat-tool-btn.active {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* Advanced AI Features */
.ai-status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.ai-status-indicator.enhanced {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    border-color: rgba(102, 126, 234, 0.2);
}

.ai-status-indicator.offline {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Enhanced Code Display */
.large-code-container {
    position: relative;
    max-height: 600px;
    overflow: hidden;
    border-radius: 8px;
}

.code-navigation {
    background: linear-gradient(135deg, #374151, #4b5563);
    color: white;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.code-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.code-controls button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.code-controls button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

#chunkContent {
    background: var(--bg-dark);
    color: #e5e7eb;
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    overflow: auto;
    white-space: pre-wrap;
    max-height: 500px;
    transition: all 0.3s ease;
}

/* Search Results Styling */
.search-results {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
    margin-bottom: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.search-result-item:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: translateX(4px);
}

.search-result-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.search-result-snippet {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.search-result-url {
    color: var(--success-color);
    font-size: 0.8rem;
    text-decoration: none;
    opacity: 0.8;
    word-break: break-all; /* Ensure long URLs wrap */
}

.search-result-url:hover {
    text-decoration: underline;
    opacity: 1;
}

/* Code Analysis Display */
.code-analysis {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    font-family: var(--font-sans);
}

.analysis-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(16, 185, 129, 0.1);
    font-size: 0.9rem;
}

.analysis-metric:last-child {
    border-bottom: none;
}

.metric-label {
    font-weight: 500;
    color: var(--text-primary);
}

.metric-value {
    font-weight: 600;
    color: var(--success-color);
    font-family: var(--font-mono);
}

/* Enhanced Streaming Response */
.streaming-response {
    opacity: 0.8;
    position: relative;
    animation: streamingPulse 1.5s ease-in-out infinite;
}

.streaming-response::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-color);
    animation: streamingCursor 1s ease-in-out infinite;
}

@keyframes streamingPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

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

/* Advanced Chat Message Types */
.chat-message.system {
    background: rgba(102, 126, 234, 0.1);
    border-left: 4px solid var(--primary-color);
    color: var(--text-primary);
    font-style: italic;
    margin: 0.5rem 0;
    padding: 0.75rem;
    border-radius: 6px;
}

.chat-message.search-result {
    background: rgba(59, 130, 246, 0.05);
    border-left: 4px solid #3b82f6;
    font-family: var(--font-sans);
}

.chat-message.code-analysis {
    background: rgba(16, 185, 129, 0.05);
    border-left: 4px solid var(--success-color);
    font-family: var(--font-sans);
}

/* Memory and Context Indicators */
.context-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--primary-color);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.memory-usage {
    font-weight: 500;
}

.context-length {
    opacity: 0.8;
}

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

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

/* Focus and keyboard navigation improvements */
.nav-btn:focus,
.btn:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: 3px solid rgba(102, 126, 234, 0.3);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* @tweakable additional feedback styles */
.service-removal-indicator {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    z-index: 10;
    animation: slideDown 0.3s ease;
    text-align: center;
}

.character-counter {
    position: absolute;
    bottom: -25px;
    right: 0;
    font-size: 0.8rem;
    color: #f59e0b;
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #f59e0b;
    animation: slideDown 0.3s ease;
}

.generation-indicator,
.fields-applying-indicator,
.settings-saving,
.database-testing,
.language-change-banner {
    position: absolute;
    background: #3b82f6; /* Default info color */
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    animation: slideDown 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    top: 10px;
    right: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.settings-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 12px;
    color: var(--text-primary);
}

.settings-loading-overlay .loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.settings-loading-overlay .loading-spinner i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.settings-loading-overlay .loading-spinner p {
    font-size: 1rem;
    font-weight: 500;
}

.database-result {
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideDown 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.database-result.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.database-result.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.font-preview {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    font-size: 16px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease;
}

.color-preview {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 30px;
    border-radius: 6px;
    margin-top: 5px;
    animation: slideDown 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.animation-demo {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    z-index: 10000;
    pointer-events: none;
}