/* PDF Redaction System - Main Stylesheet */

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --background: #f9fafb;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --surface: #ffffff;
    --border: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 40px 0;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Main Content */
.main-content {
    margin-top: 40px;
}

.section {
    display: none;
    background: var(--surface);
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.section-header p {
    color: var(--text-secondary);
}

/* Upload Section */
.upload-container {
    max-width: 800px;
    margin: 0 auto;
}

.upload-box {
    position: relative;
    margin-bottom: 30px;
}

.upload-box input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.upload-label {
    display: block;
    padding: 40px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-label:hover {
    border-color: var(--primary-color);
    background-color: #f9fafb;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.upload-label h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 5px;
}

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

.file-name {
    display: block;
    margin-top: 10px;
    font-size: 0.875rem;
    color: var(--success-color);
    font-weight: 500;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

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

.btn-large {
    padding: 16px 32px;
    font-size: 1.125rem;
}

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

#upload-btn {
    width: 100%;
    margin-top: 20px;
}

/* Info Box */
.info-box {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
}

.info-box h4 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.info-box ol {
    margin-left: 20px;
}

.info-box li {
    margin-bottom: 8px;
}

/* Processing Section */
.progress-container {
    text-align: center;
    padding: 60px 20px;
}

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

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

#processing-status {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.progress-steps {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
}

.progress-step {
    text-align: center;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.progress-step.active {
    opacity: 1;
}

.progress-step.completed {
    opacity: 1;
    color: var(--success-color);
}

.step-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

/* Review Section */
.review-container {
    max-width: 900px;
    margin: 0 auto;
}

.review-info {
    background-color: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.review-info strong {
    color: #92400e;
}

.review-info ul {
    margin-left: 20px;
    margin-top: 10px;
}

.editor-container {
    margin-bottom: 30px;
}

.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: var(--background);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

#bracket-count {
    font-weight: 500;
    color: var(--text-secondary);
}

.text-editor {
    width: 100%;
    min-height: 400px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 0 0 8px 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.8;
    resize: vertical;
}

.text-editor:focus {
    outline: none;
    border-color: var(--primary-color);
}

.review-actions {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.review-actions button {
    flex: 1;
}

/* Download Section */
.download-container {
    text-align: center;
    padding: 40px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background-color: var(--success-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 30px;
}

.download-info {
    margin-bottom: 40px;
}

.download-info p {
    font-size: 1.125rem;
    margin-bottom: 10px;
}

.download-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Utilities */
code {
    background-color: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.875em;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .section {
        padding: 20px;
    }

    .progress-steps {
        gap: 20px;
        flex-wrap: wrap;
    }

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

/* Mode Selector Styles */
.mode-selector {
    border: 1px solid var(--border);
}

.mode-option {
    cursor: pointer;
    flex: 1;
    min-width: 200px;
}

.mode-option input[type="radio"] {
    display: none;
}

.mode-card {
    padding: 20px;
    border: 2px solid var(--border);
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    height: 100%;
}

.mode-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mode-option input[type="radio"]:checked + .mode-card {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), rgba(59, 130, 246, 0.05));
}

.mode-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.mode-card h4 {
    margin: 10px 0 5px 0;
    color: var(--text-primary);
    font-size: 18px;
}

.mode-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Criteria Input Mode Selection */
.input-mode-option {
    cursor: pointer;
}

.input-mode-option input[type="radio"] {
    display: none;
}

.input-mode-option div {
    transition: all 0.3s ease;
}

.input-mode-option div:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.criteria-input-container {
    transition: all 0.3s ease;
}

.criteria-textarea {
    transition: border-color 0.3s ease;
}

.criteria-textarea:focus {
    outline: none;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.instruction-banner pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

