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

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 3rem;
}

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

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

main {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.settings-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.settings-section h2 {
    margin-bottom: 0;
    font-size: 1.5rem;
}

.btn-reset {
    background-color: var(--warning-color);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-reset:hover {
    background-color: #d97706;
}

.btn-reset:focus,
.btn-reset:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.settings-grid {
    display: grid;
    gap: 1.5rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-item label {
    font-weight: 500;
    color: var(--text-primary);
    display: block;
}

.setting-item label:not(.checkbox-label) {
    margin-bottom: 0.25rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:focus,
.checkbox-label input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.setting-item input[type="text"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.setting-item input[type="text"]:focus,
.setting-item input[type="text"]:focus-visible {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.setting-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.upload-section {
    margin-bottom: 2rem;
}

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 0.75rem;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: var(--bg-color);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.05);
}

.upload-icon {
    width: 4rem;
    height: 4rem;
    color: var(--primary-color);
    margin: 0 auto 1rem;
}

.drop-text {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.btn-select {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.btn-select:focus,
.btn-select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.convert-all-section {
    margin-bottom: 1.5rem;
    text-align: center;
}

.btn-convert-all {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 600;
}

.btn-convert-all:hover {
    background-color: var(--primary-hover);
}

.btn-convert-all:focus,
.btn-convert-all:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.button-group {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.file-list {
    margin-bottom: 2rem;
}

.file-item {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

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

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn:focus,
.btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

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

.btn-convert:hover:not(:disabled) {
    background-color: #059669;
}

.btn-convert:disabled {
    background-color: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

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

.btn-remove:hover {
    background-color: #dc2626;
}

.info-section {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    margin-top: 2rem;
}

.info-section h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.info-section ul {
    list-style-position: inside;
    color: var(--text-secondary);
}

.info-section li {
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

.info-section code {
    background-color: var(--bg-color);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    color: var(--text-secondary);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-content h2 {
    margin-bottom: 1rem;
    text-align: center;
}

.progress-info {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 1.5rem;
    background-color: var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

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

.progress-text {
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
}

/* Notification Modal */
.notification-modal {
    text-align: center;
    max-width: 450px;
}

.notification-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.notification-icon svg {
    width: 2.5rem;
    height: 2.5rem;
}

.notification-icon.success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.notification-icon.error {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.notification-icon.warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.notification-icon.info {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.notification-message {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-line;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 2rem;
}

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

.btn-primary:focus,
.btn-primary:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 반응형 디자인 */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    main {
        padding: 1.5rem;
    }

    .settings-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .btn-reset {
        width: 100%;
    }

    .drop-zone {
        padding: 2rem 1rem;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .file-actions {
        width: 100%;
    }

    .btn {
        flex: 1;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
        padding: 1.5rem;
    }

    .modal-content h2 {
        font-size: 1.25rem;
    }

    .notification-icon {
        width: 3rem;
        height: 3rem;
    }

    .notification-icon svg {
        width: 2rem;
        height: 2rem;
    }

    .btn-primary {
        width: 100%;
        padding: 0.625rem 1.5rem;
    }
}