/* Data Analysis Web App - Stylesheet */

/* ============================================================================
   CSS Variables
   ============================================================================ */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --success-color: #10b981;
    --success-hover: #059669;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --warning-color: #f59e0b;
    --secondary-color: #6b7280;
    --secondary-hover: #4b5563;
    
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --text-color: #111827;
    --text-muted: #6b7280;
    
    --navbar-bg: #1f2937;
    --navbar-text: #ffffff;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px 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);
    
    --radius: 8px;
    --radius-lg: 12px;
}

/* ============================================================================
   Base Styles
   ============================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.3;
}

/* ============================================================================
   Navbar
   ============================================================================ */
.navbar {
    background-color: var(--navbar-bg);
    color: var(--navbar-text);
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
}

.navbar-brand a {
    color: var(--navbar-text);
    font-size: 1.4rem;
    font-weight: 600;
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--navbar-text);
    text-decoration: none;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.user-name {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

.nav-link.logout {
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================================================
   Container & Main
   ============================================================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
}

/* Full-width container for job status page */
body.full-width-page .container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 2rem 3rem !important;
}

/* ============================================================================
   Flash Messages
   ============================================================================ */
.flash-messages {
    margin-bottom: 1.5rem;
}

.flash {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flash-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.flash-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.flash-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.flash-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.flash-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
    line-height: 1;
}

.flash-close:hover {
    opacity: 1;
}

/* ============================================================================
   Buttons
   ============================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn:hover {
    text-decoration: none;
}

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

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

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

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

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

.btn-success:hover {
    background-color: var(--success-hover);
}

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

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

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-large {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

/* ============================================================================
   Hero Login Page (Full-Screen Modern Design)
   ============================================================================ */
.hero-login {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
}

.hero-left {
    flex: 0 0 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: rgba(0, 0, 0, 0.2);
}

.hero-content {
    max-width: 420px;
    color: white;
}

.hero-logo {
    font-size: 5rem;
    margin-bottom: 1rem;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.hero-title {
    font-size: 4.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-tagline {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    letter-spacing: 0.05em;
}

.hero-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #a5b4fc, #818cf8);
    border-radius: 2px;
    margin: 2rem 0;
}

.hero-description {
    font-size: 1.15rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 2.5rem;
}

.hero-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1.25rem 2rem;
    background: white;
    color: #1e1b4b;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.hero-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    text-decoration: none;
}

.hero-login-btn .microsoft-logo {
    width: 22px;
    height: 22px;
}

.hero-login-btn-dev {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1f2937;
}

.hero-dev-note {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin-top: 1rem;
}

.hero-access-note {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-top: 2rem;
}

/* Right Side: Features Grid */
.hero-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 750px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.feature-card-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: white;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .hero-login {
        flex-direction: column;
        min-height: auto;
        overflow-y: auto;
    }

    .hero-left {
        flex: none;
        padding: 2rem;
    }

    .hero-right {
        padding: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .hero-left {
        padding: 1.5rem;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-tagline {
        font-size: 0.95rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .feature-card {
        padding: 1.25rem;
    }
}

/* ============================================================================
   Dashboard
   ============================================================================ */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.dashboard-header .subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Dashboard Stats Grid */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-stats .stat-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.dashboard-stats .stat-icon {
    font-size: 2.5rem;
}

.dashboard-stats .stat-content {
    display: flex;
    flex-direction: column;
}

.dashboard-stats .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.dashboard-stats .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-total {
    border-left: 4px solid var(--primary-color);
}

.stat-completed {
    border-left: 4px solid var(--success-color);
}

.stat-running {
    border-left: 4px solid var(--warning-color);
}

.stat-failed {
    border-left: 4px solid var(--danger-color);
}

/* Jobs Section */
.jobs-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.jobs-section h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* Enhanced Table Styling */
.job-id-link {
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: 600;
    color: var(--primary-color);
}

.job-id-link:hover {
    text-decoration: underline;
}

.keywords-cell .keyword-preview {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 200px;
}

.keywords-cell .keyword-count {
    background: var(--bg-color);
    color: var(--text-muted);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.sources-cell {
    font-size: 1.25rem;
}

.source-icon {
    margin-right: 0.25rem;
}

.running-indicator {
    color: var(--warning-color);
    animation: pulse 1.5s ease-in-out infinite;
}

@media (max-width: 1200px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

/* Jobs Table */
.jobs-table-container {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.jobs-table {
    width: 100%;
    border-collapse: collapse;
}

.jobs-table th,
.jobs-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.jobs-table th {
    background: var(--bg-color);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.jobs-table td {
    font-size: 0.9rem;
}

.jobs-table tr:last-child td {
    border-bottom: none;
}

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

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-provisioning {
    background: #dbeafe;
    color: #1e40af;
}

.status-running {
    background: #e0e7ff;
    color: #3730a3;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.status-cancelled {
    background: #f3f4f6;
    color: #4b5563;
}

.status-badge.large {
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h2 {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ============================================================================
   Forms
   ============================================================================ */
.form-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

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

.form-group:last-child {
    margin-bottom: 0;
}

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

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.current-value {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.current-value code {
    background: var(--bg-color);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
}

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

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label {
    font-weight: 500;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: var(--radius);
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.checkbox-grid.compact {
    padding: 0.5rem;
    gap: 0.5rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.checkbox-grid.compact label {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
}

.source-options,
.cleaning-options,
.analysis-options {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: var(--radius);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 0;
}

/* ============================================================================
   Submit Job - Two Column Layout
   ============================================================================ */

/* Full-width container override for submit job page */
.container:has(.submit-job.two-column-layout) {
    max-width: none;
    padding: 2rem 3rem;
}

.submit-job.two-column-layout {
    max-width: none;
}

.submit-job .job-form-header {
    margin-bottom: 2rem;
}

.submit-job .job-form-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.submit-job .subtitle {
    color: var(--text-muted);
}

.two-column-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

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

.form-actions-full {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-top: 0;
}

/* Analysis config compact styling */
.analysis-config {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.help-text.inline {
    display: inline;
    margin-left: 0.5rem;
    margin-top: 0;
}

@media (max-width: 1024px) {
    .two-column-form {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   Job Status Page
   ============================================================================ */

/* Full-width container override for job status page */
.container:has(.job-status.two-column-layout) {
    max-width: none;
    padding: 2rem 2rem;
}

/* Two-column layout for job status - uses full width */
.job-status.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    gap: 2rem;
}

.job-status.two-column-layout .job-header {
    grid-column: 1 / -1; /* Span full width */
}

.job-main-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.job-logs-column {
    position: sticky;
    top: 1.5rem;
    height: fit-content;
    max-height: calc(100vh - 3rem);
}

.job-logs-column .job-logs {
    height: calc(100vh - 10rem);
    display: flex;
    flex-direction: column;
}

.job-logs-column .log-output {
    flex: 1;
    max-height: none;
    min-height: 300px;
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0;
}

.back-link {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.5rem;
}

.job-id {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: monospace;
}

.status-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.status-main {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-message {
    margin-top: 1rem;
    padding: 1rem;
    background: #fee2e2;
    color: #991b1b;
    border-radius: var(--radius);
}

/* Timeline */
.job-timeline {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.timeline {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.timeline-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border-color);
}

.timeline-item.completed:not(:last-child)::after {
    background: var(--success-color);
}

.timeline-marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    z-index: 1;
}

.timeline-item.completed .timeline-marker {
    background: var(--success-color);
    color: white;
}

.timeline-content h3 {
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

.timeline-content p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Stats */
.job-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2rem;
}

.stat-content h3 {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Configuration */
.job-config {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.config-section {
    margin-bottom: 1.25rem;
}

.config-section:last-child {
    margin-bottom: 0;
}

.config-section h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.keyword-tag {
    background: var(--bg-color);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
}

/* Logs */
.job-logs {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.job-logs h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.log-output {
    background: #1f2937;
    color: #e5e7eb;
    padding: 1rem;
    border-radius: var(--radius);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-x: auto;
    max-height: 400px;
    min-height: 150px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    scroll-behavior: smooth;
}

.log-output::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.log-output::-webkit-scrollbar-track {
    background: #374151;
    border-radius: 4px;
}

.log-output::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 4px;
}

.log-output::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Live indicator for active jobs */
.log-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--success-color);
    margin-left: auto;
    font-weight: normal;
}

.log-live-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* ============================================================================
   Settings Page
   ============================================================================ */
.settings .subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.section-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.instructions {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: var(--radius);
}

.instructions h3 {
    font-size: 0.95rem;
    margin: 1rem 0 0.5rem 0;
}

.instructions h3:first-child {
    margin-top: 0;
}

.instructions ol {
    margin-left: 1.25rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.instructions li {
    margin-bottom: 0.25rem;
}

.danger-zone {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 2rem;
}

.danger-zone h2 {
    color: #991b1b;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.danger-zone p {
    color: #7f1d1d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ============================================================================
   Access Denied Page
   ============================================================================ */
.access-denied {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
}

.access-denied-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    padding: 3rem;
    text-align: center;
}

.access-denied-card .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.access-denied-card h1 {
    color: var(--danger-color);
    margin-bottom: 1rem;
}

.access-denied-card .message {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.access-denied-card .user-info {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.access-denied-card .instructions {
    text-align: center;
    background: none;
    padding: 0;
}

.access-denied-card .instructions h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.access-denied-card .instructions p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.support-email {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

.access-denied-card .actions {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* ============================================================================
   Footer
   ============================================================================ */
.footer {
    background: var(--navbar-bg);
    color: rgba(255, 255, 255, 0.6);
    padding: 1rem;
    text-align: center;
    font-size: 0.85rem;
}

/* ============================================================================
   Responsive
   ============================================================================ */
@media (max-width: 1024px) {
    /* Switch to single column layout on tablets and smaller */
    .job-status.two-column-layout {
        grid-template-columns: 1fr;
    }

    .job-logs-column {
        position: static;
        max-height: none;
    }

    .job-logs-column .job-logs {
        height: auto;
    }

    .job-logs-column .log-output {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 1rem;
        gap: 1rem;
    }

    .navbar-menu {
        order: 3;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .jobs-table-container {
        overflow-x: auto;
    }

    .job-header {
        flex-direction: column;
        gap: 1rem;
    }

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

    .timeline-item:not(:last-child)::after {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .job-stats {
        grid-template-columns: 1fr;
    }
}
