* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Primary Colors - Blue Theme */
    --primary-600: #2563eb;
    --primary-500: #3b82f6;
    --primary-400: #60a5fa;
    --primary-100: #dbeafe;
    --primary-50: #eff6ff;

    /* Neutral Colors */
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;

    /* Success/Error Colors */
    --emerald-600: #059669;
    --emerald-500: #10b981;
    --emerald-100: #d1fae5;
    --red-600: #dc2626;
    --red-500: #ef4444;
    --red-100: #fee2e2;
    --amber-600: #d97706;
    --amber-500: #f59e0b;
    --amber-100: #fef3c7;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Light Mode Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    
    --border-color: #e5e7eb;
    --border-hover: #d1d5db;
}



body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

.header {
    text-align: center;
    margin-bottom: 48px;
    position: relative;
}



.logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.logo:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.brand-text h1 {
    font-size: 3.5rem;
    margin-bottom: 16px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-500) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
}

.brand-text p {
    font-size: 1.25rem;
    color: var(--gray-600);
    font-weight: 500;
    max-width: 600px;
    margin: 0 auto;
}

/* Fallback for older browsers */
.header h1 {
    font-size: 3.5rem;
    margin-bottom: 16px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-500) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
}

.header p {
    font-size: 1.25rem;
    color: var(--gray-600);
    font-weight: 500;
    max-width: 600px;
    margin: 0 auto;
}

.auth-section {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 12px;
}

.auth-btn {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

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

.user-info {
    background: var(--bg-card);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.main-card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    margin-bottom: 48px;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.tabs {
    display: flex;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.tab {
    flex: 1;
    padding: 20px 24px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    font-size: 15px;
}

.tab.active {
    background: var(--bg-card);
    border-bottom-color: var(--primary-500);
    color: var(--primary-600);
}

.tab:hover:not(.active) {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.tab-content {
    padding: 48px;
    min-height: 500px;
}

.tab-pane {
    display: none;
}

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

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: var(--bg-card);
    color: var(--text-primary);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.btn {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-500) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

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

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

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

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

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid;
    transform: translateX(100%);
    animation: slideIn 0.3s ease-out forwards;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

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

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

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

.toast-icon {
    font-size: 20px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--gray-900);
}

.toast-message {
    font-size: 14px;
    color: var(--gray-600);
}

.toast-close {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.toast-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

@keyframes slideIn {
    to { transform: translateX(0); }
}

@keyframes slideOut {
    to { transform: translateX(100%); }
}

.toast.removing {
    animation: slideOut 0.3s ease-in forwards;
}

.btn-outline {
    background: white;
    border: 1px solid var(--primary-500);
    color: var(--primary-600);
    box-shadow: var(--shadow-sm);
}

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

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    margin-top: 32px;
}

.pricing-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.pricing-card.popular {
    border: 2px solid var(--primary-500);
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

.pricing-card.popular::before {
    content: "RECOMMENDED";
    position: absolute;
    top: 20px;
    right: -35px;
    background: var(--primary-500);
    color: white;
    padding: 8px 45px;
    transform: rotate(45deg);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    box-shadow: 0 4px 8px rgba(111, 66, 193, 0.3);
}

.pricing-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}



/* Animation for when the section comes into view */
@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.price {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-600);
    margin: 24px 0;
    line-height: 1;
}

.price-period {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.features {
    list-style: none;
    margin: 32px 0;
    text-align: left;
}

.features li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 15px;
}

.features li:last-child {
    border-bottom: none;
}

.features li::before {
    content: "✓";
    color: var(--emerald-500);
    font-weight: bold;
    margin-right: 12px;
    font-size: 16px;
}

.output-section {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 24px;
    margin-top: 32px;
    border: 1px solid var(--gray-200);
}

.loading {
    text-align: center;
    padding: 48px;
}

.spinner {
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary-500);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

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

.demo-output {
    background: var(--gray-900);
    color: var(--gray-100);
    padding: 24px;
    border-radius: 12px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    border: 1px solid var(--gray-200);
}

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

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 24px;
    border-radius: 16px;
    text-align: center;
    color: var(--gray-700);
    backdrop-filter: blur(10px);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--primary-600);
}

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.auth-modal.active {
    display: flex;
}

.auth-modal-content {
    background: var(--bg-card);
    padding: 48px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

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

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.dashboard-card {
    background: var(--bg-card);
    padding: 32px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.dashboard-card h3 {
    color: var(--primary-600);
    margin-bottom: 16px;
    font-size: 1.25rem;
    font-weight: 700;
}

.usage-bar {
    background: var(--bg-tertiary);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 12px 0;
}

.usage-fill {
    background: var(--primary-500);
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.generation-item {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 12px;
    border-left: 4px solid var(--emerald-500);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.generation-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.generation-meta {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 8px;
    font-weight: 500;
}

.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-weight: 500;
    border-width: 1px;
    border-style: solid;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.alert-error {
    background: var(--red-100);
    border-color: var(--red-500);
    color: var(--red-600);
}

.alert-warning {
    background: var(--amber-100);
    border-color: var(--amber-500);
    color: var(--amber-600);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
    }
    


    .logo-section {
        flex-direction: column;
        gap: 12px;
    }

    .logo {
        width: 40px;
        height: 40px;
    }

    .brand-text h1 {
        font-size: 2.5rem;
    }

    .header h1 {
        font-size: 2.5rem;
    }

    .tabs {
        flex-direction: column;
        gap: 0;
    }

    .tab {
        padding: 16px 20px;
        font-size: 14px;
        border-bottom: 1px solid var(--border-color);
        border-right: none;
    }

    .tab.active {
        border-bottom-color: var(--primary-500);
        border-right-color: transparent;
    }

    .tab-content {
        padding: 32px 24px;
    }

    .auth-section {
        position: static;
        justify-content: center;
        margin-top: 24px;
    }

    .pricing-card.popular {
        transform: none;
    }

    .auth-modal-content {
        padding: 32px 24px;
    }

    /* Touch-friendly buttons */
    .btn, .btn-outline, .auth-btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 16px;
    }

    /* Better spacing for mobile */
    .form-group {
        margin-bottom: 20px;
    }

    .form-group input, .form-group select {
        padding: 16px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Toast positioning for mobile */
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast {
        margin-bottom: 8px;
        padding: 12px 16px;
    }
}

/* Improved focus states for accessibility */
.btn:focus,
.auth-btn:focus,
input:focus,
select:focus,
textarea:focus,
.tab:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* Better color contrast for accessibility */
.alert-info {
    background: var(--primary-50);
    border-color: var(--primary-200);
    color: var(--primary-800);
}

/* Screen reader only text */
.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;
}

/* Analytics Cards */
.analytics-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.analytics-card canvas {
    max-height: 300px !important;
    height: 300px !important;
}

.chart-container {
    height: 300px;
    position: relative;
}

.analytics-card h4 {
    margin-bottom: 15px;
    color: var(--gray-800);
    font-size: 1.1rem;
    font-weight: 600;
}

.efficiency-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.metric-label {
    color: var(--gray-600);
    font-size: 14px;
}

.metric-value {
    color: var(--primary-600);
    font-weight: 600;
    font-size: 14px;
}

/* API Key Management */
.api-key-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

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

.api-key-name {
    font-weight: 600;
    color: var(--gray-800);
}

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

.api-key-value {
    font-family: 'Courier New', monospace;
    background: var(--gray-50);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--gray-700);
    word-break: break-all;
}

.api-key-meta {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--gray-600);
}

/* Bulk Operations */
.bulk-repo-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bulk-repo-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.bulk-repo-status.pending {
    background: var(--amber-100);
    color: var(--amber-700);
}

.bulk-repo-status.completed {
    background: var(--emerald-100);
    color: var(--emerald-700);
}

.bulk-repo-status.failed {
    background: var(--red-100);
    color: var(--red-700);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Subtle animations for better UX */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Apply animations to key elements */
.tab-pane.active {
    animation: fadeInUp 0.4s ease-out;
}

.pricing-card {
    animation: slideInRight 0.4s ease-out;
}

.pricing-card:nth-child(2) {
    animation-delay: 0.1s;
}

.pricing-card:nth-child(3) {
    animation-delay: 0.2s;
}

/* Improved button states */
.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* Better hover effects */
.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ULTRA format icons with special styling */
.download-option[data-format="confluence"] .download-icon,
.download-option[data-format="github-wiki"] .download-icon,
.download-option[data-format="notion"] .download-icon,
.download-option[data-format="word"] .download-icon {
    font-size: 28px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Premium pricing card for ULTRA with enhanced styling */
.pricing-card.ultra {
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
    border: 2px solid #2563eb;
    transform: scale(1.08);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.15);
    position: relative;
    overflow: hidden;
}

.pricing-card.ultra::before {
    content: "PREMIUM";
    position: absolute;
    top: 20px;
    right: -35px;
    background: linear-gradient(135deg, #6f42c1 0%, #8b5fbf 100%);
    color: white;
    padding: 8px 45px;
    transform: rotate(45deg);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    box-shadow: 0 4px 8px rgba(111, 66, 193, 0.3);
}

.pricing-card.ultra .price {
    background: linear-gradient(135deg, #6f42c1 0%, #8b5fbf 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pricing-card.ultra .features li strong {
    color: #6f42c1;
    font-weight: 700;
}



/* Success animation for downloads */
@keyframes downloadSuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {

    .download-icon {
        font-size: 20px !important;
        margin-right: 12px;
        width: 35px;
    }

    .download-title {
        font-size: 14px;
    }

    .download-desc {
        font-size: 12px;
    }

    .pricing-card.ultra {
        transform: none;
        margin: 10px 0;
    }
}

/* Print styles for Word documents */
@media print {
    .download-modal,
    .auth-modal {
        display: none !important;
    }

    body {
        background: white !important;
    }

    .demo-output,
    .generation-item {
        background: white !important;
        color: black !important;
        border: 1px solid #ccc !important;
    }
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Ensure toggle is always visible */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-right: 10px;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
    border: 1px solid #ccc;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Enhanced Loading States */

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-card {
    padding: 20px;
    border-radius: 12px;
    background: white;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.skeleton-card .skeleton-text {
    margin-bottom: 12px;
}

/* Enhanced Progress Indicators */
.progress-container {
    background: #f3f4f6;
    border-radius: 8px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-bar {
    height: 8px;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
    border-radius: 8px;
    transition: width 0.3s ease;
    position: relative;
}

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

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

.progress-text {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
}

/* Loading Spinner Enhancements */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid var(--primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.spinner.small {
    width: 20px;
    height: 20px;
    border-width: 2px;
    margin: 10px auto;
}

.spinner.large {
    width: 60px;
    height: 60px;
    border-width: 6px;
    margin: 30px auto;
}

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

/* Loading States for Buttons */
.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-overlay .spinner {
    margin-bottom: 20px;
}

.loading-overlay .loading-text {
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 500;
}

.loading-overlay .loading-subtext {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Skeleton Dashboard */
.skeleton-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.skeleton-dashboard-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.skeleton-dashboard-card .skeleton-text {
    margin-bottom: 15px;
}

.skeleton-dashboard-card .skeleton-text:first-child {
    width: 40%;
    height: 1.2em;
}

.skeleton-dashboard-card .skeleton-text:nth-child(2) {
    width: 60%;
    height: 1em;
}

.skeleton-dashboard-card .skeleton-text:nth-child(3) {
    width: 80%;
    height: 1em;
}

/* Loading States for Forms */
.form-loading {
    opacity: 0.6;
    pointer-events: none;
}

.form-loading .btn {
    position: relative;
}

.form-loading .btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Pulse Animation for Real-time Updates */
.pulse {
    animation: pulse 2s infinite;
}

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

/* Loading States for API Calls */
.api-loading {
    position: relative;
}

.api-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
    animation: api-loading 2s infinite;
}

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

/* Enhanced Toast Loading */
.toast.loading {
    background: linear-gradient(90deg, #f0f0f0, #e0e0e0, #f0f0f0);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

/* Loading States for Charts */
.chart-loading {
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border-radius: 8px;
}

.chart-loading .spinner {
    margin: 0;
}

.chart-loading .loading-text {
    margin-left: 15px;
    color: var(--text-muted);
}

/* Responsive Loading States */
@media (max-width: 768px) {
    .skeleton-dashboard {
        grid-template-columns: 1fr;
    }
    
    .loading-overlay .loading-text {
        font-size: 16px;
    }
    
    .loading-overlay .loading-subtext {
        font-size: 12px;
    }
}

/* Queue Management Styles */
.queue-management-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.section-header h3 {
    margin: 0;
    color: #1e40af;
}

.btn-refresh {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: #e5e7eb;
}

.queue-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #1e40af;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.active-generations, .recent-completed {
    margin-bottom: 25px;
}

.active-generations h4, .recent-completed h4 {
    margin: 0 0 15px 0;
    color: #374151;
    font-size: 16px;
}

.generation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s;
}

.generation-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.generation-item.queued {
    border-left: 4px solid #f59e0b;
}

.generation-item.processing {
    border-left: 4px solid #3b82f6;
}

.generation-item.completed {
    border-left: 4px solid #10b981;
}

.generation-info {
    flex: 1;
}

.generation-repo {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.generation-type {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.generation-status {
    font-size: 12px;
    color: #374151;
}

.generation-meta {
    font-size: 12px;
    color: #6b7280;
}

.generation-time {
    font-size: 12px;
    color: #9ca3af;
}

.generation-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.progress-bar {
    width: 60px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    transition: width 0.3s ease;
}

.no-active-jobs {
    text-align: center;
    padding: 30px;
    color: #6b7280;
    font-style: italic;
}
