/* ===================================
   SIMPLIFIED COMPARE DOCS AI - LIGHT THEME
   Clean, minimalist design inspired by iLovePDF, Smallpdf, Adobe
   =================================== */

@import url('legal.css');

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

:root {
    /* Light Theme Colors */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #6c757d;
    --text-muted: #9ca3af;

    /* Accent Color */
    --accent-primary: #0066ff;
    --accent-hover: #0052cc;
    --accent-light: #e6f0ff;

    /* Borders & Dividers */
    --border-color: #dee2e6;
    --border-dashed: #c4c9cf;

    /* Status Colors */
    --success: #10b981;
    --success-bg: #d1fae5;
    --error: #ef4444;
    --error-bg: #fee2e2;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;

    /* Diff Colors */
    --diff-added: #10b981;
    --diff-added-bg: #d1fae5;
    --diff-removed: #ef4444;
    --diff-removed-bg: #fee2e2;
    --diff-modified: #f59e0b;
    --diff-modified-bg: #fef3c7;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.08);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Transitions */
    --transition: 0.2s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ===================================
   NAVIGATION
   =================================== */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-md) 0;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.logo-icon {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
    align-items: center;
    /* Fix vertical alignment */
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-primary);
}

/* Ensure button text is white in navbar */
.nav-links .btn-primary {
    color: white !important;
}

/* ===================================
   HERO SECTION
   =================================== */
.hero {
    padding: var(--spacing-md) 0 var(--spacing-sm);
    /* Reduced padding */
    text-align: center;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    /* Slightly smaller max size */
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    /* Tighter spacing */
    color: var(--text-primary);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    /* Reduced margin */
}

/* ===================================
   BUTTONS
   =================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 0.75rem 1.5rem;
    /* Slightly reduced padding */
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: transparent;
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
}

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

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* ===================================
   UPLOAD CARD
   =================================== */
.upload-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-lg);
    /* Reduced padding inside card */
    margin: var(--spacing-sm) auto var(--spacing-xl);
    /* Reduced top margin */
    max-width: 1000px;
    /* Wider card */
    min-height: 50vh;
    /* Ensure substantial height */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    flex-grow: 1;
    /* Allow grid to expand */
}

.upload-zone {
    border: 2px dashed var(--border-dashed);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-primary);
    min-height: 35vh;
    /* Responsive height */
    max-height: 50vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-zone:hover {
    border-color: var(--accent-primary);
    background: var(--accent-light);
}

.upload-zone.drag-over {
    border-color: var(--accent-primary);
    background: var(--accent-light);
    border-style: solid;
}

.upload-zone.has-file {
    border-color: var(--success);
    border-style: solid;
    background: var(--success-bg);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.6;
}

.upload-zone h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.upload-instruction {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

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

.file-info {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: white;
    border: 1px solid var(--success);
    border-radius: var(--radius-sm);
    position: relative;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    word-break: break-word;
}

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

.remove-file {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition);
}

.remove-file:hover {
    background: var(--error-bg);
    color: var(--error);
}

.compare-action {
    text-align: center;
    margin-top: var(--spacing-xl);
}

.privacy-note {
    margin-top: var(--spacing-md);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ===================================
   FEATURES SECTION
   =================================== */
.features {
    padding: var(--spacing-2xl) 0;
    background: var(--bg-secondary);
}

.features-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xl);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    max-width: 900px;
    margin: 0 auto;
}

.feature-card {
    text-align: center;
    padding: var(--spacing-lg);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===================================
   RESULTS SECTION
   =================================== */
.results-section {
    padding: var(--spacing-2xl) 0;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

.results-header h2 {
    font-size: 2rem;
    font-weight: 700;
}

.results-summary {
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-primary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
}

.results-summary h3 {
    margin-bottom: var(--spacing-sm);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-card-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.stat-card-value.added {
    color: var(--diff-added);
}

.stat-card-value.removed {
    color: var(--diff-removed);
}

.stat-card-value.modified {
    color: var(--diff-modified);
}

.stat-card-value.total {
    color: var(--accent-primary);
}

.stat-card-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.changes-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.changes-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.changes-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    font-size: 1.25rem;
}

.change-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
}

.change-icon.added {
    background: var(--diff-added-bg);
    color: var(--diff-added);
}

.change-icon.removed {
    background: var(--diff-removed-bg);
    color: var(--diff-removed);
}

.change-icon.modified {
    background: var(--diff-modified-bg);
    color: var(--diff-modified);
}

.count {
    margin-left: auto;
    background: var(--bg-primary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
}

.changes-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.change-item {
    padding: var(--spacing-md);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border-left: 3px solid;
}

.change-item.added {
    border-left-color: var(--diff-added);
    background: var(--diff-added-bg);
}

.change-item.removed {
    border-left-color: var(--diff-removed);
    background: var(--diff-removed-bg);
}

.change-item.modified {
    border-left-color: var(--diff-modified);
    background: var(--diff-modified-bg);
}

.modification-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.mod-label {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.mod-text {
    padding: var(--spacing-sm);
    background: white;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: var(--spacing-lg);
    font-style: italic;
}

/* ===================================
   ERROR & LOADING STATES
   =================================== */
.error-message {
    background: var(--error-bg);
    border: 1px solid var(--error);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
    color: var(--error);
    text-align: center;
}

.loading-state {
    text-align: center;
    padding: var(--spacing-2xl);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-md);
}

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

.loading-subtext {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
}

/* ===================================
   FOOTER
   =================================== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-2xl);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
@media (max-width: 768px) {
    .upload-grid {
        grid-template-columns: 1fr;
    }

    .upload-zone {
        min-height: 200px;
    }

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

    .results-header {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: flex-start;
    }

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

    .upload-card {
        padding: var(--spacing-lg);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }

    .upload-zone {
        padding: var(--spacing-lg);
    }

    .btn-large {
        width: 100%;
    }
}

/* ===================================
   INPUT MODE TOGGLE
   =================================== */
.input-mode-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-xl);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    cursor: pointer;
}

.mode-text {
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition);
}

.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: '';
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

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

input:checked+.slider:before {
    transform: translateX(24px);
}

/* ===================================
   TEXT INPUT MODE
   =================================== */
.text-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.text-input-zone {
    display: flex;
    flex-direction: column;
}

.text-input-zone h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.text-input-zone textarea {
    width: 100%;
    min-height: 300px;
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color var(--transition);
    background: var(--bg-primary);
}

.text-input-zone textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: white;
}

.text-input-zone textarea::placeholder {
    color: var(--text-muted);
}

.char-count {
    margin-top: var(--spacing-xs);
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: right;
}

.char-count span {
    font-weight: 600;
    color: var(--text-secondary);
}

/* Responsive adjustments for text areas */
.text-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    flex-grow: 1;
    /* Match upload-grid behavior */
}

.text-input-zone {
    display: flex;
    flex-direction: column;
    min-height: 35vh;
    /* Responsive height */
    max-height: 50vh;
}

.text-input-zone textarea {
    flex-grow: 1;
    /* Fill the zone */
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    resize: none;
    /* Disable manual resize to keep layout consistent */
    font-family: inherit;
    font-size: 1rem;
    transition: all var(--transition);
    background: var(--bg-primary);
}

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