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

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #16a34a;
    --error: #dc2626;
    --bg-gradient-start: #eff6ff;
    --bg-gradient-end: #dbeafe;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
    color: var(--gray-800);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

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

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

main {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

section {
    margin-bottom: 2rem;
}

section:last-child {
    margin-bottom: 0;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--gray-800);
}

/* Workflow Selector */
.radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.radio-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-content {
    padding: 1.25rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    background: white;
    transition: all 0.2s;
}

.radio-card input:checked ~ .radio-content {
    border-color: var(--primary);
    background: #eff6ff;
    box-shadow: var(--shadow);
}

.radio-content strong {
    display: block;
    font-size: 1.125rem;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.radio-content p {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Upload Section */
.upload-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.upload-container.single {
    grid-template-columns: 1fr;
}

.upload-zone.single {
    max-width: 500px;
    margin: 0 auto;
}

.drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 2px dashed var(--gray-300);
    border-radius: var(--border-radius);
    background: var(--gray-50);
    cursor: pointer;
    transition: all 0.2s;
    min-height: 200px;
}

.drop-zone:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

.drop-zone.dragover {
    border-color: var(--primary);
    background: #eff6ff;
    border-style: solid;
}

.drop-zone.has-file {
    border-color: var(--success);
    background: #f0fdf4;
}

.drop-zone svg {
    color: var(--gray-400);
    margin-bottom: 1rem;
}

.drop-text {
    font-size: 1rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.file-types {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.file-name {
    font-size: 0.875rem;
    color: var(--success);
    font-weight: 600;
    margin-top: 0.5rem;
    word-break: break-word;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 1rem 2rem;
    margin-top: 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.submit-btn:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
}

.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Results Section */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--gray-200);
}

.copy-btn.copied {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

/* Download Buttons */
.download-buttons-container {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.btn-download {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.results-content {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 2rem;
    max-height: 800px;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--gray-900);
}

.tool-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--gray-300);
}

.tool-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.tool-header {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #eff6ff;
    border-left: 4px solid var(--primary);
}

.field {
    margin-bottom: 1rem;
}

.field-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.25rem;
}

.field-value {
    color: var(--gray-900);
    margin-left: 1rem;
}

.list-item {
    margin-left: 2rem;
    margin-bottom: 0.25rem;
    color: var(--gray-800);
}

.list-item::before {
    content: "• ";
    color: var(--primary);
    font-weight: bold;
}

/* Error Message */
.error-message {
    padding: 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--border-radius);
    color: var(--error);
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .radio-group,
    .upload-container {
        grid-template-columns: 1fr;
    }

    main {
        padding: 1.5rem;
    }
}
