/* ===================================
   PlanCheckr - Professional Styles
   AI Plan Review for Construction
   =================================== */

/* ===================================
   CSS Variables
   =================================== */

:root {
    --brand-50: #eff6ff;
    --brand-100: #dbeafe;
    --brand-500: #3b82f6;
    --brand-600: #2563eb;
    --brand-700: #1d4ed8;
    
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
}

/* Light Theme (Default) */
.theme-light {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

/* Dark Theme - Clean & Minimal */
.theme-dark {
    --bg-primary: #111111;
    --bg-secondary: #1a1a1a;
    --bg-card: #161616;
    --text-primary: #f5f5f5;
    --text-secondary: #a3a3a3;
    --text-muted: #737373;
    --border-color: #262626;
}

/* ===================================
   Base Styles
   =================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.theme-light body,
.theme-light {
    background: #ffffff;
    color: #0f172a;
}

.theme-dark body,
.theme-dark {
    background: #111111;
    color: #f5f5f5;
}

/* Selection */
::selection {
    background: rgba(59, 130, 246, 0.2);
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

.theme-dark ::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.theme-dark ::-webkit-scrollbar-thumb {
    background: #404040;
}

/* ===================================
   Theme Toggle
   =================================== */

.theme-light .sun-icon { display: none; }
.theme-light .moon-icon { display: block; }
.theme-dark .sun-icon { display: block; }
.theme-dark .moon-icon { display: none; }

/* ===================================
   Header
   =================================== */

.theme-dark header {
    background: rgba(17, 17, 17, 0.85) !important;
    border-color: #262626 !important;
}

.theme-dark header .text-slate-900 {
    color: #f5f5f5;
}

.theme-dark header .text-slate-500 {
    color: #a3a3a3;
}

.theme-dark header .hover\:bg-slate-100:hover {
    background: #262626;
}

.theme-dark header .hover\:text-slate-700:hover {
    color: #e5e5e5;
}

/* ===================================
   Hero Section
   =================================== */

.hero-section {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    position: relative;
}

.theme-dark .hero-section {
    background: linear-gradient(180deg, #161616 0%, #111111 100%);
}

.theme-dark .hero-section h1,
.theme-dark .text-slate-900 {
    color: #f5f5f5;
}

.theme-dark .text-slate-600,
.theme-dark .text-slate-500 {
    color: #a3a3a3;
}

.theme-dark .text-slate-700 {
    color: #d4d4d4;
}

.theme-dark .text-slate-400 {
    color: #737373;
}

.theme-dark .text-slate-300 {
    color: #525252;
}

/* ===================================
   Admin Settings
   =================================== */

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

.admin-toggle {
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    background: var(--bg-secondary);
    font-weight: 600;
    transition: all 0.2s ease;
}

.admin-toggle:hover {
    border-color: var(--brand-500);
    color: var(--text-primary);
}

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

.admin-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
}

.admin-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.admin-help {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

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

.admin-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.admin-input {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.65rem 0.75rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.admin-button {
    background: var(--brand-600);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: background 0.2s ease;
}

.admin-button:hover {
    background: var(--brand-700);
}

.admin-status {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.admin-status.is-error {
    color: #dc2626;
}

.admin-status.is-success {
    color: #059669;
}

.admin-prompt {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 1rem;
}

.admin-prompt summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.admin-textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'DM Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    min-height: 160px;
}

/* Footer Dark */
.theme-dark footer {
    background: #161616 !important;
    border-color: #262626 !important;
}

.theme-dark .bg-slate-50 {
    background: #161616;
}

.theme-dark .border-slate-200 {
    border-color: #262626;
}

/* ===================================
   Section Styles
   =================================== */

.content-section {
    background: var(--bg-primary);
}

.theme-dark .content-section {
    background: #111111;
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--slate-200), transparent);
    max-width: 800px;
    margin: 0 auto;
}

.theme-dark .section-divider {
    background: linear-gradient(90deg, transparent, #333333, transparent);
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 1.5rem;
    text-align: center;
}

.theme-dark .section-title {
    color: #f5f5f5;
}

/* ===================================
   Cards & Components
   =================================== */

.discipline-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 0.75rem;
    font-weight: 500;
    color: var(--slate-700);
    transition: all 0.2s ease;
}

.discipline-card:hover {
    border-color: var(--brand-500);
    background: var(--brand-50);
}

.theme-dark .discipline-card {
    background: #1a1a1a;
    border-color: #2a2a2a;
    color: #e5e5e5;
}

.theme-dark .discipline-card:hover {
    border-color: #3b82f6;
    background: #222222;
}

.discipline-icon {
    font-size: 1.25rem;
}

.callout-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--brand-50);
    border: 1px solid var(--brand-100);
    border-radius: 0.75rem;
    border-left: 4px solid var(--brand-500);
}

.theme-dark .callout-box {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.15);
}

/* Step Cards */
.step-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 1rem;
    transition: all 0.2s ease;
}

.step-card:hover {
    border-color: var(--brand-500);
    box-shadow: 0 4px 12px -2px rgba(59, 130, 246, 0.1);
}

.theme-dark .step-card {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

.step-number {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-600);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 0.625rem;
    flex-shrink: 0;
}

/* Benefits List */
.benefits-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.benefits-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--slate-700);
}

.theme-dark .benefits-list li {
    color: #d4d4d4;
}

/* Ideal For Card */
.ideal-for-card {
    padding: 1.5rem;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 1rem;
}

.theme-dark .ideal-for-card {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

/* Receive Cards */
.receive-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    color: var(--slate-700);
}

.theme-dark .receive-card {
    background: #1a1a1a;
    border-color: #2a2a2a;
    color: #d4d4d4;
}

/* Disclosure Box */
.disclosure-box {
    padding: 1.5rem;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 1rem;
    border-left: 4px solid var(--slate-400);
}

.theme-dark .disclosure-box {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

/* Agreement Box */
.agreement-box {
    padding: 1.25rem;
    background: var(--slate-50);
    border: 2px solid var(--slate-200);
    border-radius: 1rem;
    transition: all 0.2s ease;
}

.agreement-box.checked {
    border-color: var(--brand-500);
    background: var(--brand-50);
}

.theme-dark .agreement-box {
    background: #1a1a1a;
    border-color: #333333;
}

.theme-dark .agreement-box.checked {
    background: rgba(59, 130, 246, 0.08);
    border-color: #3b82f6;
}

.terms-link {
    display: inline;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--brand-600);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
    cursor: pointer;
}

.terms-link:hover {
    color: var(--brand-700);
    text-decoration-color: var(--brand-700);
}

.terms-panel {
    margin-top: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--slate-200);
    border-radius: 0.75rem;
    background: #ffffff;
    color: var(--slate-700);
    font-size: 0.875rem;
    line-height: 1.6;
    max-height: 360px;
    overflow-y: auto;
}

.terms-heading {
    font-size: 1rem;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 0.35rem;
}

.terms-subheading {
    font-weight: 600;
    color: var(--slate-700);
}

.terms-meta {
    color: var(--slate-600);
    font-size: 0.875rem;
}

.terms-divider {
    height: 1px;
    background: var(--slate-200);
    margin: 0.75rem 0;
}

.terms-section-title {
    font-weight: 700;
    color: var(--slate-900);
    margin: 0.75rem 0 0.35rem;
}

.terms-list {
    list-style: disc;
    padding-left: 1.25rem;
    margin: 0.35rem 0 0.75rem;
}

.theme-dark .terms-panel {
    background: #141414;
    border-color: #2a2a2a;
    color: #d4d4d4;
}

.theme-dark .terms-heading,
.theme-dark .terms-section-title {
    color: #f5f5f5;
}

.theme-dark .terms-subheading,
.theme-dark .terms-meta {
    color: #d4d4d4;
}

.theme-dark .terms-divider {
    background: #2a2a2a;
}

/* ===================================
   Step Indicator
   =================================== */

.step-indicator {
    padding: 0 1rem;
}

.step-indicator .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 80px;
}

.step-indicator .step-circle {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
    font-size: 1.125rem;
    background: var(--slate-100);
    color: var(--slate-400);
    border: 2px solid var(--slate-200);
    transition: all 0.3s ease;
}

.step-indicator .step.active .step-circle {
    background: var(--brand-600);
    color: white;
    border-color: var(--brand-600);
    box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.4);
}

.step-indicator .step.completed .step-circle {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.step-indicator .step-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--slate-400);
    text-transform: uppercase;
}

.step-indicator .step.active .step-label {
    color: var(--brand-600);
}

.step-indicator .step.completed .step-label {
    color: #10b981;
}

.step-indicator .step-line {
    flex: 1;
    height: 2px;
    background: var(--slate-200);
    margin: 0 0.5rem;
    margin-bottom: 1.5rem;
    min-width: 40px;
    max-width: 100px;
}

.step-indicator .step-line.completed {
    background: #10b981;
}

/* Dark theme - Step Indicator */
.theme-dark .step-indicator .step-circle {
    background: #1f1f1f;
    border-color: #333333;
    color: #666666;
}

.theme-dark .step-indicator .step.active .step-circle {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.theme-dark .step-indicator .step.completed .step-circle {
    background: #10b981;
    border-color: #10b981;
}

.theme-dark .step-indicator .step-label {
    color: #666666;
}

.theme-dark .step-indicator .step.active .step-label {
    color: #60a5fa;
}

.theme-dark .step-indicator .step.completed .step-label {
    color: #34d399;
}

.theme-dark .step-indicator .step-line {
    background: #333333;
}

.theme-dark .step-indicator .step-line.completed {
    background: #10b981;
}

/* ===================================
   Upload Section
   =================================== */

.upload-card {
    background: white;
    border: 1px solid var(--slate-200);
    border-radius: 1.5rem;
    box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.theme-dark .upload-card {
    background: #161616;
    border-color: #262626;
}

.upload-zone {
    padding: 3rem 2rem;
    text-align: center;
    border: 2px dashed var(--slate-200);
    border-radius: 1rem;
    margin: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-zone[data-disabled="true"] {
    opacity: 0.6;
    cursor: not-allowed;
}

.upload-zone[data-disabled="false"]:hover,
.upload-zone.dragover {
    border-color: var(--brand-500);
    background: var(--brand-50);
}

.theme-dark .upload-zone {
    border-color: #333333;
}

.theme-dark .upload-zone[data-disabled="false"]:hover,
.theme-dark .upload-zone.dragover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.upload-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 1.25rem;
    background: var(--brand-50);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-dark .upload-icon-wrapper {
    background: rgba(59, 130, 246, 0.1);
}

/* ===================================
   Buttons
   =================================== */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: var(--brand-600);
    color: white;
    font-weight: 600;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px -2px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: var(--brand-700);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: var(--slate-100);
    color: var(--slate-700);
    font-weight: 600;
    border-radius: 0.75rem;
    border: 1px solid var(--slate-200);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--slate-200);
    border-color: var(--slate-300);
}

.theme-dark .btn-secondary {
    background: #1f1f1f;
    color: #e5e5e5;
    border-color: #333333;
}

.theme-dark .btn-secondary:hover {
    background: #292929;
    border-color: #404040;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--slate-100);
    color: var(--slate-600);
    border-radius: 0.625rem;
    border: 1px solid var(--slate-200);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--slate-200);
}

.theme-dark .btn-icon {
    background: #1f1f1f;
    border-color: #333333;
    color: #a3a3a3;
}

.theme-dark .btn-icon:hover {
    background: #292929;
}

/* ===================================
   Analysis Provider Toggle
   =================================== */

.analysis-provider-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.analysis-provider-btn {
    border: none;
    border-radius: 0.5rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.analysis-provider-btn.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* ===================================
   Form Elements
   =================================== */

.input-field {
    width: 100%;
    padding: 0.875rem 1rem;
    background: white;
    border: 1px solid var(--slate-200);
    border-radius: 0.75rem;
    color: var(--slate-900);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-field::placeholder {
    color: var(--slate-400);
}

.theme-dark .input-field {
    background: #1a1a1a;
    border-color: #333333;
    color: #f5f5f5;
}

.theme-dark .input-field:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.theme-dark .input-field::placeholder {
    color: #666666;
}

/* Checkbox */
input[type="checkbox"] {
    accent-color: var(--brand-600);
}

/* ===================================
   Processing Animation
   =================================== */

.processing-animation {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.processing-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--brand-200);
    border-radius: 50%;
    animation: ring-pulse 1.5s ease-out infinite;
}

.theme-dark .processing-ring {
    border-color: rgba(59, 130, 246, 0.25);
}

@keyframes ring-pulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.delay-150 { animation-delay: 150ms; }
.delay-300 { animation-delay: 300ms; }

/* ===================================
   Modal
   =================================== */

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 28rem;
    background: white;
    border: 1px solid var(--slate-200);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.theme-dark .modal-content {
    background: #161616;
    border-color: #262626;
}

/* ===================================
   Analysis Content
   =================================== */

.analysis-section {
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 1rem;
    padding: 1.25rem;
}

.theme-dark .analysis-section {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

.analysis-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--slate-500);
    margin-bottom: 1rem;
}

.analysis-section .icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--brand-600);
}

.analysis-section p,
.analysis-section li {
    color: var(--slate-600);
    line-height: 1.7;
}

.theme-dark .analysis-section p,
.theme-dark .analysis-section li {
    color: #d4d4d4;
}

.theme-dark .analysis-section h4 {
    color: #a3a3a3;
}

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

.analysis-section li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.analysis-section li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 6px;
    height: 6px;
    background: var(--brand-600);
    border-radius: 50%;
}

/* ===================================
   Stripe Elements
   =================================== */

#card-element {
    background: white;
    border: 1px solid var(--slate-200);
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

#card-element.StripeElement--focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.theme-dark #card-element {
    background: #1a1a1a;
    border-color: #333333;
}

/* ===================================
   Animations
   =================================== */

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   Responsive
   =================================== */

@media (max-width: 640px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .upload-zone {
        padding: 2rem 1rem;
    }
    
    .step-card {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        margin: 0 auto;
    }
    
    /* Step Indicator Mobile */
    .step-indicator .step {
        min-width: 60px;
    }
    
    .step-indicator .step-circle {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }
    
    .step-indicator .step-label {
        font-size: 0.625rem;
    }
    
    .step-indicator .step-line {
        min-width: 20px;
    }
}

/* ===================================
   Print Styles
   =================================== */

@media print {
    header, footer, .upload-zone, .btn-primary, .btn-secondary {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* ===================================
   Preview Section - Larger Display
   =================================== */

.preview-content {
    min-height: 280px;
    max-height: none;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow-y: auto;
}

.theme-dark .preview-content {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

/* ===================================
   Streaming Analysis UI - Friendly Version
   =================================== */

.streaming-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 2.5rem;
    text-align: center;
}

.theme-dark .streaming-container {
    background: #161616;
    border-color: #2a2a2a;
}

.streaming-hero {
    margin-bottom: 2rem;
}

.streaming-animation {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.streaming-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--brand-500);
    border-radius: 50%;
    opacity: 0;
    animation: circle-expand 2s ease-out infinite;
}

.streaming-circle.delay-1 {
    animation-delay: 0.6s;
}

.streaming-circle.delay-2 {
    animation-delay: 1.2s;
}

@keyframes circle-expand {
    0% {
        transform: scale(0.5);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.streaming-icon {
    width: 48px;
    height: 48px;
    color: var(--brand-600);
    animation: icon-pulse 2s ease-in-out infinite;
}

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

.streaming-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.streaming-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0;
}

.streaming-progress-container {
    max-width: 400px;
    margin: 0 auto 2rem;
}

.streaming-progress-bar {
    height: 8px;
    background: var(--slate-200);
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.theme-dark .streaming-progress-bar {
    background: #2a2a2a;
}

.streaming-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--brand-500), var(--brand-600));
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.streaming-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-muted);
}

#streamingPercent {
    font-weight: 600;
    color: var(--brand-600);
}

.streaming-steps {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.streaming-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--slate-100);
    border-radius: 9999px;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.theme-dark .streaming-step {
    background: #1f1f1f;
}

.streaming-step .step-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.streaming-step .step-icon svg {
    width: 16px;
    height: 16px;
}

.streaming-step.active {
    background: var(--brand-50);
    color: var(--brand-700);
    font-weight: 600;
    animation: step-pulse 1.5s ease-in-out infinite;
}

.theme-dark .streaming-step.active {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

@keyframes step-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
}

.streaming-step.completed {
    background: #dcfce7;
    color: #166534;
}

.theme-dark .streaming-step.completed {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.streaming-step.completed .step-icon svg {
    stroke: currentColor;
}

.streaming-tip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

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

/* ===================================
   Multi-PDF Mode Toggle
   =================================== */

.mode-toggle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 1rem;
}

.theme-dark .mode-toggle-container {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

.mode-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mode-toggle-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--slate-500);
    transition: color 0.2s ease;
}

.mode-toggle-label[data-mode="single"] {
    color: var(--brand-600);
}

[data-mode="multiple"] .mode-toggle-label[data-mode="single"] {
    color: var(--slate-500);
}

[data-mode="multiple"] .mode-toggle-label[data-mode="multiple"] {
    color: var(--brand-600);
}

.mode-toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    background: var(--brand-100);
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
    padding: 0;
}

.mode-toggle-switch:hover {
    background: var(--brand-200);
}

.mode-toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: var(--brand-600);
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.mode-toggle-switch[data-mode="multiple"] .mode-toggle-slider {
    transform: translateX(24px);
}

.theme-dark .mode-toggle-switch {
    background: #333;
}

.theme-dark .mode-toggle-switch:hover {
    background: #444;
}

.theme-dark .mode-toggle-slider {
    background: #3b82f6;
}

/* ===================================
   Analysis Mode Toggle (Multi-file)
   =================================== */

.analysis-mode-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 1rem;
    margin: 0 1.5rem;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 0.75rem;
}

.theme-dark .analysis-mode-toggle {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

.analysis-mode-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.analysis-mode-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--slate-500);
    transition: color 0.2s ease;
}

.analysis-mode-label[data-mode="standard"] {
    color: var(--brand-600);
}

[data-mode="unified"] ~ .analysis-mode-label[data-mode="standard"],
.analysis-mode-wrapper:has([data-mode="unified"]) .analysis-mode-label[data-mode="standard"] {
    color: var(--slate-500);
}

[data-mode="unified"] ~ .analysis-mode-label[data-mode="unified"],
.analysis-mode-wrapper:has([data-mode="unified"]) .analysis-mode-label[data-mode="unified"] {
    color: var(--brand-600);
}

/* ===================================
   Multi-File List
   =================================== */

.multi-file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid var(--slate-200);
    border-radius: 0.75rem;
    transition: all 0.2s ease;
}

.multi-file-item:hover {
    border-color: var(--brand-300);
}

.theme-dark .multi-file-item {
    background: #1f1f1f;
    border-color: #333;
}

.theme-dark .multi-file-item:hover {
    border-color: #3b82f6;
}

.multi-file-icon {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    background: #fef2f2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.multi-file-icon svg {
    width: 20px;
    height: 20px;
    color: #ef4444;
}

.multi-file-info {
    flex: 1;
    min-width: 0;
}

.multi-file-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--slate-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-dark .multi-file-name {
    color: #f5f5f5;
}

.multi-file-size {
    font-size: 0.75rem;
    color: var(--slate-500);
}

.multi-file-status {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.multi-file-status .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--brand-100);
    border-top-color: var(--brand-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.multi-file-status .check-icon {
    color: #10b981;
}

.multi-file-status .error-icon {
    color: #ef4444;
}

.multi-file-remove {
    padding: 0.375rem;
    border-radius: 0.375rem;
    color: var(--slate-400);
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    cursor: pointer;
}

.multi-file-remove:hover {
    color: #ef4444;
    background: #fef2f2;
}

.theme-dark .multi-file-remove:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* ===================================
   Horizontal PDF Tabs
   =================================== */

#pdfTabsHorizontal {
    background: var(--slate-50);
    padding: 0.5rem 0.5rem 0;
}

.theme-dark #pdfTabsHorizontal {
    background: #1a1a1a;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.pdf-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--slate-500);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    min-width: 120px;
    max-width: 200px;
}

.pdf-tab:hover {
    color: var(--slate-700);
    background: rgba(0, 0, 0, 0.03);
}

.pdf-tab.active {
    color: var(--brand-600);
    border-bottom-color: var(--brand-600);
    background: white;
    border-radius: 0.5rem 0.5rem 0 0;
}

.theme-dark .pdf-tab {
    color: #888;
}

.theme-dark .pdf-tab:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.03);
}

.theme-dark .pdf-tab.active {
    color: #60a5fa;
    border-bottom-color: #3b82f6;
    background: #161616;
}

.pdf-tab-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdf-tab-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pdf-tab-status.pending {
    background: var(--slate-300);
}

.pdf-tab-status.validating,
.pdf-tab-status.analyzing {
    background: var(--brand-500);
    animation: pulse-dot 1s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.pdf-tab-status.validated,
.pdf-tab-status.complete {
    background: #10b981;
}

.pdf-tab-status.error {
    background: #ef4444;
}

/* ===================================
   Vertical PDF Sidebar
   =================================== */

#pdfSidebar {
    min-height: 400px;
}

.pdf-sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-sidebar-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.pdf-sidebar-item.active {
    background: var(--brand-50);
    color: var(--brand-700);
}

.theme-dark .pdf-sidebar-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.theme-dark .pdf-sidebar-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.pdf-sidebar-icon {
    width: 28px;
    height: 28px;
    border-radius: 0.375rem;
    background: #fef2f2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pdf-sidebar-icon svg {
    width: 16px;
    height: 16px;
    color: #ef4444;
}

.pdf-sidebar-name {
    flex: 1;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--slate-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theme-dark .pdf-sidebar-name {
    color: #d4d4d4;
}

.pdf-sidebar-item.active .pdf-sidebar-name {
    color: var(--brand-700);
}

.theme-dark .pdf-sidebar-item.active .pdf-sidebar-name {
    color: #60a5fa;
}

.pdf-sidebar-status {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pdf-sidebar-status .spinner-small {
    width: 14px;
    height: 14px;
    border: 2px solid var(--brand-100);
    border-top-color: var(--brand-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.pdf-sidebar-status svg {
    width: 16px;
    height: 16px;
}

.pdf-sidebar-status .check-icon {
    color: #10b981;
}

.pdf-sidebar-status .error-icon {
    color: #ef4444;
}

/* ===================================
   Batch Processing Progress
   =================================== */

.batch-progress-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
}

.batch-progress-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--slate-50);
    border-radius: 0.75rem;
}

.theme-dark .batch-progress-item {
    background: #1f1f1f;
}

.batch-progress-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.batch-progress-icon.pending {
    background: var(--slate-200);
}

.batch-progress-icon.processing {
    background: var(--brand-100);
}

.batch-progress-icon.complete {
    background: #dcfce7;
}

.batch-progress-icon.error {
    background: #fef2f2;
}

.batch-progress-info {
    flex: 1;
    min-width: 0;
}

.batch-progress-name {
    font-weight: 500;
    color: var(--slate-900);
    margin-bottom: 0.25rem;
}

.theme-dark .batch-progress-name {
    color: #f5f5f5;
}

.batch-progress-status {
    font-size: 0.875rem;
    color: var(--slate-500);
}

.batch-progress-bar {
    height: 4px;
    background: var(--slate-200);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.batch-progress-fill {
    height: 100%;
    background: var(--brand-600);
    border-radius: 2px;
    transition: width 0.3s ease;
}
