/* ─── BugPilot AI Agent — Design System ───────────────────────────────────── */
/* Premium dark theme with glassmorphism, gradients, and micro-animations     */

/* ─── CSS Custom Properties ──────────────────────────────────────────────── */
:root {
    /* Background */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-card-hover: rgba(31, 41, 55, 0.8);
    --bg-glass: rgba(17, 24, 39, 0.5);
    --bg-input: rgba(31, 41, 55, 0.6);
    --bg-input-focus: rgba(55, 65, 81, 0.5);

    /* Accent Colors */
    --accent-primary: #7c3aed;
    /* More sophisticated violet */
    --accent-primary-hover: #8b5cf6;
    --accent-primary-glow: rgba(124, 58, 237, 0.3);
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --accent-success-glow: rgba(16, 185, 129, 0.2);
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-danger-glow: rgba(239, 68, 68, 0.2);
    --accent-jira: #0052cc;

    /* Text */
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-accent: #a5b4fc;

    /* Borders */
    --border-default: rgba(75, 85, 99, 0.4);
    --border-focus: rgba(99, 102, 241, 0.6);
    --border-subtle: rgba(55, 65, 81, 0.5);

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-primary-glow);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ─── Light Theme Variables ──────────────────────────────────────────────── */
[data-theme="light"] {
    /* Background */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-input: rgba(241, 245, 249, 0.8);
    --bg-input-focus: rgba(255, 255, 255, 1);

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-accent: #4338ca;

    /* Borders */
    --border-default: rgba(203, 213, 225, 0.8);
    --border-focus: rgba(99, 102, 241, 0.8);
    --border-subtle: rgba(226, 232, 240, 0.8);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* Animated background gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(16, 185, 129, 0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
#app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 64px;
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color var(--transition-base), border-color var(--transition-base);
    /* Needed so .header-center (position:absolute) anchors to this element */
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    pointer-events: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-brand {
    display: flex;
    align-items: center;
}

.header-title {
    font-weight: 700;
    font-size: 20px;
    margin: 0;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -0.02em;
}

.header-brand {
    display: flex;
    align-items: center;
    transition: transform var(--transition-base);
    cursor: default;
}

.header-brand:hover {
    transform: scale(1.02);
}

.theme-toggle-btn {
    background: transparent;
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
    color: var(--text-primary);
    background: var(--bg-input);
    border-color: var(--text-muted);
}

.theme-toggle-btn svg {
    width: 16px;
    height: 16px;
}

[data-theme="light"] .icon-moon {
    display: block;
}

[data-theme="light"] .icon-sun {
    display: none;
}

[data-theme="dark"] .icon-moon {
    display: none;
}

[data-theme="dark"] .icon-sun {
    display: block;
}

/* Removed orphaned brand-icon and brand-text styles */



/* Tabs */
.header-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 3px;
    border: 1px solid var(--border-default);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: var(--font-sans);
    white-space: nowrap;
}

.tab-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(124, 58, 237, 0.1);
}

.tab-btn.active {
    color: white;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 4px 12px var(--accent-primary-glow);
}

/* Status Badge */

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 100px;
    background: rgba(156, 163, 175, 0.1);
    border: 1px solid rgba(156, 163, 175, 0.2);
    color: var(--text-secondary);
    transition: all var(--transition-base);
}

.status-badge.disconnected {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
}

.status-badge.connected {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* ─── Main Content ───────────────────────────────────────────────────────── */
#app-main {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem 2rem 2rem;
    /* Reduced top padding */
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all var(--transition-base);
}

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

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

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.step-indicator {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    padding: 4px 12px;
    background: var(--bg-input);
    border-radius: 100px;
}

/* ─── Analyzer Grid ──────────────────────────────────────────────────────── */
.analyzer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

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

/* ─── Upload Zone ────────────────────────────────────────────────────────── */
.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: center;
    margin-bottom: 2rem;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: inset 0 0 20px var(--accent-primary-glow);
}

.upload-zone.drag-over {
    transform: scale(1.01);
}

.upload-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.upload-icon svg {
    width: 28px;
    height: 28px;
}

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

.upload-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.upload-browse {
    color: var(--accent-primary);
    background: none;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: inherit;
    font-family: var(--font-sans);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.upload-browse:hover {
    color: var(--accent-primary-hover);
}

.upload-formats {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ─── File Preview Grid ──────────────────────────────────────────────────── */
.file-preview {
    display: block;
    padding: 1.25rem;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
}

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

.preview-item {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-default);
    background: var(--bg-primary);
    transition: all var(--transition-fast);
}

.preview-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-remove-preview {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition-fast);
    z-index: 2;
}

.preview-item:hover .btn-remove-preview {
    opacity: 1;
}

.btn-remove-preview svg {
    width: 12px;
    height: 12px;
}

.preview-add-more {
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-base);
}

.preview-add-more:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(124, 58, 237, 0.05);
}

.preview-add-more svg {
    width: 24px;
    height: 24px;
}

.preview-name {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-family: var(--font-sans);
    color: var(--text-primary);
    opacity: 0.9;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    outline: none;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon input {
    padding-right: 2.5rem;
    /* Space for the icon */
}

.visibility-toggle {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.visibility-toggle:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.visibility-toggle svg {
    width: 18px;
    height: 18px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent-primary);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
    opacity: 1;
    /* Full opacity on focus */
}

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

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.3;
    /* Further lowered opacity for placeholder text */
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    display: block;
}

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

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

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

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

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.675rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-sans);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 2px 8px var(--accent-primary-glow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-primary-glow);
}

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

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

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--text-muted);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-jira), #2684ff);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 82, 204, 0.3);
}

.btn-accent:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 82, 204, 0.4);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
    padding: 0.5rem 1rem;
}

.btn-ghost:hover:not(:disabled) {
    color: var(--text-primary);
    background: var(--bg-input);
}

.btn-sm {
    padding: 0.4rem 0.875rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 0.95rem;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn-icon svg {
    width: 18px;
    height: 18px;
}

#analyze-btn {
    width: 100%;
    margin-top: 0.5rem;
}

/* ─── Results Section ────────────────────────────────────────────────────── */
.results-empty,
.results-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 400px;
}

.empty-icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background: var(--bg-input);
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.empty-icon svg {
    width: 36px;
    height: 36px;
}

.results-empty h3,
.results-loading h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.results-empty p,
.results-loading p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    max-width: 300px;
}

/* Loading */
.loading-spinner {
    margin-bottom: 1.5rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-default);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.progress-bar {
    width: 200px;
    height: 4px;
    background: var(--bg-input);
    border-radius: 100px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 100px;
    transition: width 0.5s ease;
}

/* Report Fields */
.report-fields {
    margin-bottom: 1.5rem;
}

.report-field {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.report-field:last-child {
    border-bottom: none;
}

.report-field label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.field-display {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.field-edit {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-focus);
    border-radius: var(--radius-sm);
    outline: none;
    resize: vertical;
}

.field-edit:focus {
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

/* Severity Badge */
.severity-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.severity-badge.low {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.severity-badge.medium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.severity-badge.high {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.severity-badge.critical {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
    animation: pulse-critical 2s ease-in-out infinite;
}

@keyframes pulse-critical {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2);
    }

    50% {
        box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
    }
}

/* Attachment Toggle */
.attachment-toggle {
    margin: 1.5rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.checkbox-container {
    display: inline-flex;
    align-items: center;
    position: relative;
    padding-left: 32px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    user-select: none;
    transition: color var(--transition-fast);
}

.checkbox-container:hover {
    color: var(--accent-primary);
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.checkbox-container:hover input~.checkmark {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-primary-glow);
}

.checkbox-container input:checked~.checkmark {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked~.checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Result Actions */
.result-actions-top {
    display: flex;
    gap: 0.5rem;
}

.result-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

/* ─── Settings ───────────────────────────────────────────────────────────── */
.settings-container {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.settings-section {
    margin-bottom: 1.5rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.section-title svg {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

.section-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 0.5rem 0 1.5rem;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

/* Connection Result */
.connection-result {
    padding: 1rem 1.5rem;
}

.connection-message {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
}

.connection-message.success {
    color: var(--accent-success);
}

.connection-message.error {
    color: var(--accent-danger);
}

/* ─── Toast Notifications ────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-lg);
    animation: slideInToast 0.3s ease, fadeOutToast 0.3s ease 3.7s forwards;
    max-width: 400px;
}

.toast.success {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.1);
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
}

.toast.info {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.1);
}

@keyframes slideInToast {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOutToast {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

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

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

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

::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 100px;
}

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

/* Selection */
::selection {
    background: var(--accent-primary);
    color: white;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    #app-header {
        padding: 0 1rem;
        flex-wrap: wrap;
        height: auto;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        gap: 0.5rem;
    }

    .header-brand {
        flex: 1;
    }

    .header-status {
        order: 2;
    }

    .header-tabs {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    #app-main {
        padding: 1rem;
    }

    .result-actions {
        flex-direction: column;
    }

    .settings-actions {
        flex-direction: column;
    }
}