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

:root {
    --primary-color: #2563eb;
    --primary-light: #dbeafe;
    --secondary-color: #64748b;
    --accent-color: #10b981;
    --background-color: #ffffff;
    --surface-color: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
    background-color: var(--surface-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 0.25rem;
    padding: 0 0;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

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

/* Main Converter Box */
.converter-box {
    background: var(--background-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.converter-box h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    text-align: center;
}

/* Upload Section */
.upload-section {
    margin-bottom: 1rem;
}

/* Simple collapse animation utility */
.anim-collapse {
    overflow: hidden;
    transition: grid-template-rows 300ms ease, height 300ms ease, opacity 200ms ease, margin 200ms ease, padding 200ms ease;
}

.is-hidden {
    height: 0 !important;
    opacity: 0;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.75rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--surface-color);
    position: relative;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: #f5e0c4;
}

.file-upload-area.drag-over {
    border-color: var(--primary-color);
    background: #f5e0c4;
    transform: scale(1.01);
}

.upload-icon {
    color: #574130;
    margin-bottom: 0.75rem;
    opacity: 0.8;
    transition: color 0.2s ease;
}

.file-upload-area:hover .upload-icon {
    color: #574130;
    opacity: 0.8;
}

.file-upload-area p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
}

.file-info {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.5rem;
    line-height: 1.3;
}

/* File Details */
.file-details {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--surface-color);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
}

.remove-btn {
    background: #ef4444;
    color: white;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

/* Format Selection */
.format-selection {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.format-group {
    display: flex;
    flex-direction: column;
}

.format-group label {
    margin-bottom: 0.375rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.format-group select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--background-color);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.format-group select:hover {
    border-color: var(--primary-color);
}

.format-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* Text Column Selection */
.text-column-selection {
    margin-bottom: 1rem;
}

/* PDF Settings */
.pdf-settings {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.pdf-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.pdf-group {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
}

.pdf-group legend {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.radio-row, .check-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin: 0.25rem 0;
}

.solo {
    display: block;
    margin-top: 0.5rem;
}

.text-column-selection > label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.checkbox-group {
    display: flex;
    gap: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.checkbox-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin-right: 0.5rem;
    position: relative;
    transition: all 0.2s ease;
    background: var(--background-color);
}

.checkbox-label:hover .checkmark {
    border-color: var(--primary-color);
}

.checkbox-label input[type="radio"]:checked + .checkmark {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

.checkbox-label input[type="radio"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
}

/* Convert Button */
.convert-btn {
    width: 100%;
    padding: 0.75rem 1.25rem;
    background: #f5e0c4;
    color: black;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.025em;
    position: relative;
}

.convert-btn:hover:not(:disabled) {
    border-color: #574130;
}

.convert-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Progress Bar */
.progress-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

/* Result Section */
.result-section {
    margin-top: 1rem;
    padding: 1rem;
    background: #f0fdf4;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid #bbf7d0;
}

.result-section h3 {
    color: #166534;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.download-btn {
    padding: 0.5rem 1rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

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

.error-message {
    color: #dc2626;
    font-weight: 500;
    font-size: 0.8rem;
}

/* Info Section */
.info-section {
    background: var(--background-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.info-section h2 {
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
}

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

.info-card {
    padding: 1.5rem;
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.info-card h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
}

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

.info-card ul {
    list-style: none;
    padding-left: 0;
}

.info-card ul li {
    padding: 0.25rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.info-card ul li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* Footer */
footer {
    text-align: center;
    color: var(--text-secondary);
    padding: 1.5rem 0;
    margin-top: 2rem;
    font-size: 0.75rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 1rem 0.75rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .converter-box {
        padding: 1rem;
    }
    
    .file-upload-area {
        padding: 1rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .converter-box {
        padding: 0.75rem;
    }
    
    .format-selection {
        gap: 0.375rem;
    }
    
    .file-upload-area {
        padding: 0.75rem 0.5rem;
    }
    
    .file-info {
        font-size: 0.65rem;
    }
}