/* Variables */
:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --secondary: #6B7280;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --light: #F3F4F6;
    --dark: #1F2937;
    --white: #FFFFFF;
    --border: #E5E7EB;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--light);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    padding: 0;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.navbar-brand:hover {
    color: var(--dark);
}

.brand-logo {
    flex-shrink: 0;
}

.brand-text {
    font-weight: 600;
    letter-spacing: -0.01em;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--dark);
    background: var(--light);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* User Dropdown */
.nav-user {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 9999px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dark);
    transition: all 0.2s;
}

.user-menu-toggle:hover {
    background: var(--border);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    opacity: 0.6;
    transition: transform 0.2s;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 200px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s;
    z-index: 1000;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: var(--dark);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.15s;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--light);
}

.dropdown-item svg {
    opacity: 0.6;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid var(--border);
}

.logout-btn {
    color: var(--danger);
}

.logout-btn:hover {
    background: #FEF2F2;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--white);
    color: var(--dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--light);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s, background-color 0.2s;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Regex mode indicator */
.form-control.regex-mode {
    background: #ECFDF5;
    border-color: var(--success);
}

.form-control.regex-invalid {
    background: #FEF2F2;
    border-color: var(--danger);
}

.regex-error {
    color: var(--danger);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.eula-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.eula-check .validation-error {
    display: block;
    margin-top: 0.25rem;
}

.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--secondary);
}

.validation-error {
    display: block;
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.validation-summary {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    color: var(--danger);
}

/* Auth Pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.auth-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
}

.auth-card.wide {
    max-width: 600px;
}

.auth-card h1 {
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--secondary);
}

.auth-links a {
    color: var(--primary);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 1rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--secondary);
    margin-bottom: 2rem;
}

.hero-note {
    margin-top: 1rem;
    color: var(--secondary);
    font-size: 0.875rem;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.features {
    margin: 3rem 0;
}

.features h2 {
    text-align: center;
    margin-bottom: 2rem;
}

/* Wizard */
.wizard {
    max-width: 900px;
    margin: 0 auto;
}

.wizard-header {
    margin-bottom: 2rem;
}

.wizard-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--border);
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.wizard-step.active .step-number {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.wizard-step.completed .step-number {
    background: var(--success);
    border-color: var(--success);
    color: var(--white);
}

.step-label {
    font-size: 0.875rem;
    color: var(--secondary);
}

.wizard-content {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.wizard-content h1 {
    margin-bottom: 1.5rem;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* File List */
.file-list {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 400px;
    overflow-y: auto;
}

.file-items {
    padding: 0.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
}

.file-item:hover {
    background: var(--light);
}

.file-item label {
    display: flex;
    align-items: center;
    flex: 1;
    cursor: pointer;
}

.file-icon {
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

.file-name {
    flex: 1;
}

.file-date {
    color: var(--secondary);
    font-size: 0.875rem;
}

.folder-item {
    cursor: pointer;
    color: var(--primary);
}

/* Folder row in Browse Drive */
.folder-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.folder-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.folder-row .folder-select-target {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    cursor: pointer;
    color: var(--dark);
}

.folder-row .folder-select-target:hover {
    color: var(--primary);
}

.folder-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.folder-nav-btn:hover {
    background: var(--border);
    color: var(--primary);
}

/* Folder Picker (Select Folder tab) */
.folder-picker {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.folder-items {
    padding: 0.5rem;
}

.folder-select-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    transition: background 0.15s;
}

.folder-select-item:hover {
    background: var(--light);
}

.folder-select-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    cursor: pointer;
    padding: 0.25rem 0;
}

.folder-select-label input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.folder-icon {
    font-size: 1.25rem;
}

.folder-name {
    flex: 1;
}

.folder-drill-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.folder-drill-btn:hover {
    background: var(--border);
    color: var(--primary);
}

/* Folder breadcrumb path */
.folder-picker-path {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: var(--light);
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.folder-path,
.folder-picker-path {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--gray-100, #f3f4f6);
    border-radius: var(--radius);
    font-size: 0.875rem;
    flex-wrap: wrap;
    min-height: 2.25rem;
}

.folder-path .path-item,
.folder-picker-path .path-item {
    color: var(--primary);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
}

.folder-path .path-item:hover,
.folder-picker-path .path-item:hover {
    background: var(--border);
    text-decoration: underline;
}

.folder-path .path-item:last-child,
.folder-picker-path .path-item:last-child {
    color: var(--text);
    text-decoration: none;
    cursor: default;
    font-weight: 600;
}

.folder-path .path-item:last-child:hover,
.folder-picker-path .path-item:last-child:hover {
    background: transparent;
}

.browse-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.browse-toolbar .folder-path {
    flex: 1;
    margin-bottom: 0;
}

.subfolder-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    flex-shrink: 0;
}

.subfolder-toggle input {
    cursor: pointer;
}

.folder-path .path-separator,
.folder-picker-path .path-separator {
    color: var(--text-secondary);
    font-size: 1rem;
    padding: 0 0.1rem;
    user-select: none;
}

/* Rules Section */
.rules-section {
    margin-bottom: 1.5rem;
}

.rules-section.collapsible .section-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h2 {
    margin: 0;
    font-size: 1.125rem;
}

.section-actions {
    display: flex;
    gap: 0.5rem;
}

.collapse-icon {
    font-size: 0.875rem;
    color: var(--secondary);
    transition: transform 0.2s;
}

.section-content {
    padding-top: 0.5rem;
}

.section-note {
    color: var(--secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Rules */
.rules-list {
    margin-bottom: 1rem;
}

.rule-item {
    background: var(--light);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.rule-item .form-control {
    background-color: #FFFFFF;
}

.rule-item .form-control.regex-mode {
    background-color: #ECFDF5;
}

.rule-item .form-control.regex-invalid {
    background-color: #FEF2F2;
}

.rule-main {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
}

.rule-main .form-group {
    flex: 1;
    margin-bottom: 0;
}

.rule-arrow {
    font-size: 1.25rem;
    color: var(--secondary);
    padding-bottom: 0.5rem;
}

.btn-remove {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--danger);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.rule-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.target-sections {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--light);
    margin-left: auto;
}

.target-sections > label:first-child {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--secondary);
    margin-right: 0.25rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    cursor: pointer;
}

/* Progress */
.progress-bar-container {
    background: var(--light);
    border-radius: var(--radius);
    height: 20px;
    overflow: hidden;
    margin: 1.5rem 0;
}

.progress-bar {
    background: var(--primary);
    height: 100%;
    transition: width 0.3s;
}

.progress-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2rem 0;
}

.stat {
    text-align: center;
}

.stat .value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat .label {
    font-size: 0.875rem;
    color: var(--secondary);
}

/* Pricing */
.pricing-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.pricing-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.pricing-card.featured {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.pricing-card h3 {
    margin-bottom: 1rem;
}

.price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark);
}

.price .period {
    font-size: 1rem;
    font-weight: 400;
    color: var(--secondary);
}

.price-period {
    color: var(--secondary);
    margin-bottom: 1rem;
}

.pricing-note {
    text-align: center;
    color: var(--secondary);
    margin-top: 1rem;
}

.pricing-note a {
    color: var(--primary);
}

.pricing-preview {
    margin: 3rem 0;
}

.pricing-preview h2 {
    text-align: center;
}

.pricing-card ul {
    list-style: none;
    margin: 1.5rem 0;
    text-align: left;
    flex: 1;
}

.pricing-card li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.pricing-card li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
}

/* Summary Cards */
.summary-cards {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    flex: 1;
}

.summary-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.summary-label {
    color: var(--secondary);
    font-size: 0.875rem;
}

/* Google Connect */
.google-connect-prompt {
    text-align: center;
    padding: 3rem 1rem;
}

.connect-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.google-icon {
    font-weight: bold;
    margin-right: 0.5rem;
}

.connect-note {
    margin-top: 1rem;
    color: var(--secondary);
    font-size: 0.875rem;
}

.verification-notice {
    margin-top: 1.25rem;
    padding: 0.75rem 1rem;
    background: #FEF3C7;
    border: 1px solid #F59E0B;
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: #92400E;
    text-align: left;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.google-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #ECFDF5;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.status-icon {
    color: var(--success);
}

/* Selection Summary */
.selection-summary {
    background: var(--light);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    margin-top: 1rem;
}

.selection-summary .count {
    font-weight: 700;
    color: var(--primary);
}

/* Tabs */
.source-tabs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.source-tabs .drive-toggle {
    margin-left: auto;
    margin-bottom: 0;
}

.source-tab {
    padding: 0.5rem 1rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
}

.source-tab.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.source-content.hidden {
    display: none;
}

.drive-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    width: fit-content;
}

.drive-toggle-btn {
    padding: 0.35rem 0.9rem;
    background: var(--white);
    border: none;
    border-right: 1px solid var(--border);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
}

.drive-toggle-btn:last-child {
    border-right: none;
}

.drive-toggle-btn.active {
    background: var(--primary);
    color: var(--white);
}

.drive-toggle-btn:hover:not(.active) {
    background: var(--gray-100, #f3f4f6);
}

/* Footer */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    text-align: center;
    color: var(--secondary);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.footer-brand .brand-logo {
    opacity: 0.8;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.footer-links a {
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.875rem;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Legal Pages */
.legal-page {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
}

.legal-page h1 {
    margin-bottom: 0.5rem;
}

.legal-updated {
    color: var(--secondary);
    font-size: 0.875rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.legal-section {
    margin-bottom: 2rem;
}

.legal-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.legal-section h3 {
    font-size: 1rem;
    margin: 1rem 0 0.5rem;
    color: var(--dark);
}

.legal-section p {
    color: var(--secondary);
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.legal-section ul {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
    color: var(--secondary);
}

.legal-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.legal-section a {
    color: var(--primary);
}

/* Google Account Page */
.google-connected,
.google-disconnected {
    text-align: center;
}

.connected-status {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #ECFDF5;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    text-align: left;
}

.connected-icon {
    flex-shrink: 0;
}

.connected-info h3 {
    color: var(--success);
    margin-bottom: 0.25rem;
}

.connected-email {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.connected-date {
    font-size: 0.875rem;
    color: var(--secondary);
}

.connection-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.permissions-info,
.permissions-preview {
    text-align: left;
    padding: 1.5rem;
    background: var(--light);
    border-radius: var(--radius);
    margin-top: 1.5rem;
}

.permissions-info h4,
.permissions-preview h4 {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary);
}

.permissions-info ul,
.permissions-preview ul {
    margin: 0 0 1rem 1.25rem;
    color: var(--dark);
}

.permissions-info li,
.permissions-preview li {
    margin-bottom: 0.5rem;
}

.permissions-note {
    font-size: 0.875rem;
    color: var(--secondary);
    margin: 0;
}

.permissions-note a {
    color: var(--primary);
}

.disconnected-icon {
    margin-bottom: 1rem;
}

.google-disconnected h3 {
    margin-bottom: 0.5rem;
}

.google-disconnected > p {
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

/* Settings Page */
.settings-page {
    max-width: 900px;
    margin: 0 auto;
}

.settings-page h1 {
    margin-bottom: 2rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.settings-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--light);
    border-bottom: 1px solid var(--border);
}

.settings-card-header svg {
    color: var(--primary);
    flex-shrink: 0;
}

.settings-card-header h2 {
    font-size: 1rem;
    margin: 0;
}

.settings-card-body {
    padding: 1.5rem;
}

.profile-info {
    margin-bottom: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--secondary);
    font-size: 0.875rem;
}

.info-value {
    font-weight: 500;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.connection-status.connected .status-dot {
    background: var(--success);
}

.connection-status.disconnected .status-dot {
    background: var(--secondary);
}

.security-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.security-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.security-item:last-child {
    border-bottom: none;
}

.security-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.security-info span {
    font-size: 0.875rem;
    color: var(--secondary);
}

.mfa-enabled {
    color: var(--success) !important;
}

.mfa-disabled {
    color: var(--warning) !important;
}

.subscription-status {
    margin-bottom: 1rem;
}

.plan-name {
    display: block;
    font-weight: 600;
    font-size: 1.125rem;
}

.plan-expires {
    display: block;
    font-size: 0.875rem;
    color: var(--secondary);
    margin-top: 0.25rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* Danger Zone */
.danger-zone {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: var(--radius-lg);
}

.danger-zone h3 {
    color: var(--danger);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.danger-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.danger-info strong {
    display: block;
    margin-bottom: 0.25rem;
}

.danger-info p {
    font-size: 0.875rem;
    color: var(--secondary);
    margin: 0;
}

/* Preview Section */
.preview-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--light);
    border-radius: var(--radius-lg);
}

.preview-section h2 {
    margin-bottom: 0.5rem;
}

.preview-section > p {
    color: var(--secondary);
    margin-bottom: 1rem;
}

.preview-result {
    min-height: 80px;
}

.preview-success {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    border-radius: var(--radius);
}

.preview-icon {
    font-size: 2rem;
    color: var(--success);
}

.preview-stats h3 {
    margin: 0 0 0.25rem;
    color: var(--success);
}

.preview-stats p {
    margin: 0.25rem 0;
    color: var(--dark);
}

.preview-note {
    font-size: 0.875rem;
    color: var(--secondary);
    margin-top: 0.5rem;
}

.preview-error {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: var(--radius);
    color: var(--danger);
    margin-bottom: 1rem;
}

.error-icon {
    font-size: 1.25rem;
}

/* Options Section */
.options-section {
    margin-bottom: 2rem;
}

.options-section h2 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.radio-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: border-color 0.15s;
}

.radio-label:hover {
    border-color: var(--primary);
}

.radio-label.disabled-option {
    opacity: 0.6;
    cursor: not-allowed;
}

.radio-label.disabled-option:hover {
    border-color: var(--border);
}

.trial-badge {
    color: var(--danger);
    font-weight: 500;
}

.trial-badge a {
    color: var(--primary);
    text-decoration: underline;
}

.radio-label input[type="radio"] {
    margin-top: 0.25rem;
}

.radio-text {
    display: flex;
    flex-direction: column;
}

.radio-text strong {
    margin-bottom: 0.25rem;
}

.radio-text small {
    color: var(--secondary);
}

/* Rules Summary */
.rules-summary {
    margin: 2rem 0;
}

.rules-summary h2 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.rules-table {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.rule-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--white);
}

.rule-row:last-child {
    border-bottom: none;
}

.find-text,
.replace-text {
    font-family: monospace;
    background: var(--light);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rule-row .arrow {
    color: var(--secondary);
}

.rule-flags {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

.rule-flags .flag {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    background: var(--light);
    border-radius: 9999px;
    color: var(--secondary);
}

/* Processing States */
.processing-start,
.processing-active,
.processing-complete,
.processing-failed,
.processing-cancelled {
    text-align: center;
    padding: 3rem 2rem;
}

.processing-start h1,
.processing-active h1,
.processing-complete h1,
.processing-failed h1,
.processing-cancelled h1 {
    margin-bottom: 1rem;
}

.processing-start p {
    color: var(--secondary);
    margin-bottom: 2rem;
}

.processing-active .progress-bar-container {
    max-width: 500px;
    margin: 1.5rem auto;
}

.current-doc {
    color: var(--secondary);
    font-size: 0.875rem;
    margin-top: 1rem;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--success);
    color: var(--white);
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.error-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--danger);
    color: var(--white);
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.cancel-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--secondary);
    color: var(--white);
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.final-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--light);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
}

.stat-card .value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .label {
    display: block;
    font-size: 0.875rem;
    color: var(--secondary);
    margin-top: 0.25rem;
}

.stat-card.warning .value {
    color: var(--warning);
}

.completion-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.error-message {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: var(--radius);
    padding: 1rem;
    color: var(--danger);
    margin-bottom: 1.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-warning {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    color: #92400E;
}

.alert-success {
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #065F46;
}

/* Trial Warning */
.trial-warning {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.trial-warning.trial-error {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #991B1B;
}

.trial-warning.trial-error a {
    color: #991B1B;
    font-weight: 600;
}

.trial-warning a {
    color: var(--primary);
}

/* MFA Setup */
.mfa-setup {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.qr-section {
    text-align: center;
}

.qr-code img {
    max-width: 200px;
    margin-bottom: 1rem;
}

.manual-entry code {
    display: block;
    background: var(--light);
    padding: 0.5rem;
    border-radius: var(--radius);
    word-break: break-all;
    font-family: monospace;
}

.code-input {
    font-family: monospace;
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 0.25em;
}

.recovery-codes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.recovery-codes code {
    display: block;
    background: var(--light);
    padding: 0.5rem;
    border-radius: var(--radius);
    font-family: monospace;
    text-align: center;
}

.mfa-apps {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.mfa-apps h4 {
    margin-bottom: 0.75rem;
}

.mfa-apps ul {
    list-style: none;
    color: var(--secondary);
}

/* Utility */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.loading {
    padding: 2rem;
    text-align: center;
    color: var(--secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading::before {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Small inline spinner for folder loading */
.folder-loading-spinner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
    font-size: 0.85rem;
    color: var(--primary);
}

.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--secondary);
}

.error {
    padding: 1rem;
    background: #FEF2F2;
    color: var(--danger);
    border-radius: var(--radius);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
}

.formatting-modal {
    width: 580px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--dark);
    color: var(--white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1rem;
}

.btn-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.btn-close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 1rem 1.25rem;
}

.modal-instructions {
    margin-bottom: 1rem;
    color: var(--secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--light);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Formatting Table */
.formatting-table {
    width: 100%;
    border-collapse: collapse;
}

.formatting-table tr {
    border-bottom: 1px solid var(--border);
}

.formatting-table tr:last-child {
    border-bottom: none;
}

.formatting-table td {
    padding: 0.4rem 0;
    vertical-align: middle;
}

.formatting-table .label-cell {
    width: 100px;
    font-weight: 500;
    color: var(--dark);
    font-size: 0.875rem;
    white-space: nowrap;
    padding-right: 0.5rem;
}

.formatting-table .color-cell {
    width: 40px;
    text-align: center;
}

.formatting-table .options-cell {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: nowrap;
}

.formatting-table .options-cell .radio-label:nth-of-type(1) {
    min-width: 58px;
    justify-content: center;
}

.formatting-table .options-cell .radio-label:nth-of-type(2) {
    min-width: 95px;
    justify-content: center;
}

.formatting-table .options-cell .radio-label:nth-of-type(3) {
    min-width: 115px;
    justify-content: center;
}

.formatting-table .options-cell .radio-label:nth-of-type(4) {
    min-width: 70px;
    justify-content: center;
}

.formatting-table .color-cell input[type="color"] {
    width: 32px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
}

.formatting-table .radio-label {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--white);
    transition: all 0.15s;
    margin: 0;
}

.formatting-table .radio-label:hover {
    border-color: var(--primary);
    background: var(--light);
}

.formatting-table .radio-label:has(input:checked) {
    border-color: var(--primary);
    background: #E0E7FF;
}

.formatting-table .radio-label input[type="radio"] {
    margin: 0;
    width: 12px;
    height: 12px;
}

/* Format Buttons */
.find-format-btn,
.apply-format-btn {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--secondary);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Formatting Summary */
.formatting-summary {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.find-format-summary {
    display: none;
    background: #E0E7FF;
    color: #3730A3;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.5rem;
}

.apply-format-summary {
    display: none;
    background: #D1FAE5;
    color: #065F46;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-container {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .navbar-menu {
        width: 100%;
        justify-content: space-between;
        order: 3;
    }

    .nav-links {
        gap: 0;
    }

    .nav-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }

    .user-name {
        display: none;
    }

    .user-menu-toggle {
        padding: 0.25rem 0.5rem;
    }

    .wizard-steps {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .wizard-steps::before {
        display: none;
    }

    .rule-main {
        flex-direction: column;
        align-items: stretch;
    }

    .rule-arrow {
        text-align: center;
        padding: 0.5rem 0;
    }

    .mfa-setup {
        grid-template-columns: 1fr;
    }

    .summary-cards {
        flex-direction: column;
    }
}

/* Use Cases Section */
.use-cases {
    margin: 3rem 0;
}

.use-cases h2 {
    text-align: center;
    margin-bottom: 2rem;
}

/* FAQ Section */
.faq {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--white);
    border-radius: var(--radius-lg);
}

.faq h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-item h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.faq-item p {
    color: var(--secondary);
    line-height: 1.7;
}

.faq-more {
    text-align: center;
    margin-top: 2rem;
}

.faq-more a {
    color: var(--primary);
    font-weight: 500;
}

/* Support Highlight Section */
.support-highlight {
    margin: 3rem 0;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    border-radius: var(--radius-lg);
    color: var(--white);
}

.support-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
}

.support-text h2 {
    color: var(--white);
    margin-bottom: 1rem;
}

.support-text p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.support-features {
    list-style: none;
    margin-bottom: 1.5rem;
}

.support-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.95);
}

.check-icon {
    color: #10B981;
    font-weight: bold;
}

.support-highlight .btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: none;
}

.support-highlight .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.9);
}

.testimonial-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.testimonial-stars {
    color: #FCD34D;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.testimonial-text {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--white);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.testimonial-author {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .support-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .support-testimonial {
        order: -1;
    }
}

/* Self-Hosted Docker Section */
.self-hosted {
    margin: 3rem 0;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: var(--radius-lg);
    color: var(--white);
}

.self-hosted-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
}

.self-hosted-text h2 {
    color: var(--white);
    margin-bottom: 1rem;
}

.self-hosted-text p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.self-hosted .support-features li {
    color: rgba(255, 255, 255, 0.95);
}

.self-hosted .btn-secondary {
    background: var(--white);
    color: #1e293b;
    border: none;
}

.self-hosted .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.9);
}

.docker-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.docker-icon {
    margin-bottom: 1.5rem;
}

.docker-command {
    display: block;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    color: #a5f3fc;
    font-family: 'Courier New', monospace;
}

@media (max-width: 768px) {
    .self-hosted-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .self-hosted-visual {
        order: -1;
    }
}

/* FAQ Page Styles */
.faq-page {
    max-width: 900px;
    margin: 0 auto;
}

.faq-hero {
    text-align: center;
    padding: 2rem 0 3rem;
}

.faq-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.faq-hero p {
    color: var(--secondary);
    font-size: 1.1rem;
}

.faq-navigation {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.faq-nav-link {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.faq-nav-link:hover {
    background: var(--light);
    color: var(--primary);
}

.faq-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.faq-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.faq-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.faq-section h2 {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.faq-page .faq-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.faq-page .faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-page .faq-item h3 {
    font-size: 1.1rem;
    color: var(--dark);
    margin-bottom: 0.75rem;
}

.faq-page .faq-item p {
    color: var(--secondary);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.faq-page .faq-item p:last-child {
    margin-bottom: 0;
}

.faq-page .faq-item ul,
.faq-page .faq-item ol {
    color: var(--secondary);
    line-height: 1.7;
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.faq-page .faq-item li {
    margin-bottom: 0.5rem;
}

.faq-page .faq-item code {
    background: var(--light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--danger);
}

.faq-cta {
    text-align: center;
    margin-top: 2rem;
    padding: 3rem 2rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.faq-cta h2 {
    margin-bottom: 0.5rem;
}

.faq-cta p {
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Section Headings */
section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

/* How It Works Enhancement */
.how-it-works {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--white);
    border-radius: var(--radius-lg);
}

.how-it-works h2 {
    text-align: center;
}

.steps {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
}

.step {
    flex: 1;
    text-align: center;
    padding: 1rem;
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step h4 {
    margin-bottom: 0.5rem;
}

.step p {
    color: var(--secondary);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .steps {
        flex-direction: column;
    }
}

/* Jobs History Page */
.jobs-page {
    max-width: 900px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    margin: 0;
}

.empty-state-card {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state-card h2 {
    margin-bottom: 0.5rem;
}

.empty-state-card p {
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.jobs-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.job-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.job-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-completed {
    background: #ECFDF5;
    color: #065F46;
}

.status-processing {
    background: #EFF6FF;
    color: #1E40AF;
}

.status-failed {
    background: #FEF2F2;
    color: #991B1B;
}

.status-cancelled {
    background: #F3F4F6;
    color: #4B5563;
}

.status-pending {
    background: #FFFBEB;
    color: #92400E;
}

.job-date {
    color: var(--secondary);
    font-size: 0.875rem;
}

.job-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.job-stat {
    text-align: center;
}

.job-stat .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.job-stat .stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--secondary);
    text-transform: uppercase;
}

.job-stat.success .stat-value {
    color: var(--success);
}

.job-stat.warning .stat-value {
    color: var(--danger);
}

.job-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: var(--radius);
    padding: 0.75rem;
    color: var(--danger);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.job-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Job Details Page */
.job-details-page {
    max-width: 1000px;
    margin: 0 auto;
}

.job-details-page .page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.job-details-page .page-header h1 {
    margin: 0;
}

.job-details-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.job-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.job-summary-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.summary-stat {
    text-align: center;
    padding: 1rem 1.5rem;
    background: var(--light);
    border-radius: var(--radius);
    min-width: 120px;
}

.summary-stat .stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.summary-stat .stat-label {
    font-size: 0.8rem;
    color: var(--secondary);
}

.summary-stat.warning .stat-value {
    color: var(--danger);
}

.summary-stat.success .stat-value {
    color: var(--success);
}

.job-error-details {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: var(--danger);
}

.job-output-link {
    margin-top: 1.5rem;
}

.documents-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.documents-section h2 {
    margin-bottom: 1.5rem;
}

.documents-table-container {
    overflow-x: auto;
}

.documents-table {
    width: 100%;
    border-collapse: collapse;
}

.documents-table th,
.documents-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.documents-table th {
    background: var(--light);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--secondary);
}

.doc-name {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.doc-status-badge.doc-success {
    background: #ECFDF5;
    color: #065F46;
}

.doc-status-badge.doc-failed {
    background: #FEF2F2;
    color: #991B1B;
}

.doc-status-badge.doc-skipped {
    background: #FEF3C7;
    color: #92400E;
}

.doc-status-badge.doc-processing {
    background: #EFF6FF;
    color: #1E40AF;
}

.doc-status-badge.doc-pending {
    background: var(--light);
    color: var(--secondary);
}

.doc-replacements {
    font-weight: 600;
    color: var(--success);
}

.doc-time {
    color: var(--secondary);
    font-size: 0.875rem;
}

.doc-error-row td {
    padding: 0.5rem 1rem 1rem;
    border-bottom: 1px solid var(--border);
}

.doc-error-message {
    background: #FEF2F2;
    color: #991B1B;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.no-documents {
    color: var(--secondary);
    text-align: center;
    padding: 2rem;
}

.job-actions-footer {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Image Replacement Section */
.image-load-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.loading-inline {
    display: none;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary);
    font-size: 0.875rem;
}

.htmx-request .loading-inline,
.htmx-request.loading-inline {
    display: inline-flex;
}

.image-grid-container {
    min-height: 100px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.image-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s;
    position: relative;
}

.image-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.image-card.has-replacement {
    border-color: var(--success);
    background: #F0FDF4;
}

.image-select {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
}

.image-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.image-preview {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
    padding: 0.5rem;
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-info {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    font-size: 0.75rem;
    color: var(--secondary);
    border-top: 1px solid var(--border);
}

.image-dimensions {
    font-family: monospace;
}

.image-doc-count {
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
}

.image-doc-count:hover {
    text-decoration: underline;
}

.view-docs-hint {
    font-size: 0.65rem;
    opacity: 0.7;
}

/* Image Documents Modal */
#imageDocsModal .modal-content {
    max-width: 500px;
}

.image-docs-preview {
    text-align: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: 4px;
}

.image-docs-preview img {
    max-width: 200px;
    max-height: 150px;
    object-fit: contain;
}

.image-docs-list {
    max-height: 300px;
    overflow-y: auto;
}

.doc-list-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.doc-list-item:last-child {
    border-bottom: none;
}

.doc-list-item .doc-icon {
    flex-shrink: 0;
}

.doc-list-item .doc-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-actions {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
    flex-wrap: wrap;
}

.image-actions .btn {
    flex: 1;
    min-width: 0;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
}

.image-replacement-info {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    min-height: 24px;
}

.replacement-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-weight: 500;
}

.image-badge {
    background: #DBEAFE;
    color: #1E40AF;
}

.text-badge {
    background: #FEF3C7;
    color: #92400E;
}

.image-bulk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--light);
    border-radius: var(--radius);
    margin-top: 1rem;
}

/* Image Replace Modal */
.image-replace-modal {
    width: 500px;
}

.image-text-modal {
    width: 450px;
}

.image-replace-preview {
    text-align: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--light);
    border-radius: var(--radius);
}

.image-replace-preview img {
    max-width: 200px;
    max-height: 150px;
    object-fit: contain;
    border: 1px solid var(--border);
    background: var(--white);
}

.sizing-options {
    margin-top: 1rem;
}

.sizing-options > label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.sizing-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
}

.radio-option:hover {
    border-color: var(--primary);
    background: var(--light);
}

.radio-option:has(input:checked) {
    border-color: var(--primary);
    background: #E0E7FF;
}

.radio-option input[type="radio"] {
    margin: 0;
}

.radio-option span {
    flex: 1;
    font-size: 0.875rem;
}

.scale-input {
    width: 60px;
    padding: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    text-align: center;
    font-size: 0.875rem;
}

.size-input {
    width: 60px;
    padding: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    text-align: center;
    font-size: 0.875rem;
}

/* ===== Support Page ===== */
.support-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.support-header {
    text-align: center;
    margin-bottom: 2rem;
}

.support-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.support-header p {
    color: var(--muted);
    font-size: 1.1rem;
}

.support-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .support-content {
        grid-template-columns: 1fr;
    }
}

.support-form-section,
.support-info-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.support-form-section h2,
.support-info-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.support-form .form-group {
    margin-bottom: 1rem;
}

.support-form label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.support-form .form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
}

.support-form textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.support-form select.form-control {
    cursor: pointer;
}

.support-form .form-hint {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.5rem;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--light);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.contact-icon {
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-details h3 {
    margin: 0;
    font-size: 1rem;
}

.contact-details a {
    color: var(--primary);
    text-decoration: none;
}

.contact-details a:hover {
    text-decoration: underline;
}

.support-hours {
    margin-bottom: 1.5rem;
}

.support-hours h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.support-hours p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.faq-section h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.faq-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-item strong {
    display: block;
    margin-bottom: 0.25rem;
}

.faq-item p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.faq-more-link {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.faq-more-link a {
    color: var(--primary);
    font-weight: 500;
}
