:root {
    --bg-color: #f8f9fa;
    --container-bg: #ffffff;
    --primary-text: #212529;
    --secondary-text: #6c757d;
    --accent-color: #0d6efd;
    --accent-hover: #0b5ed7;
    --border-color: #dee2e6;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --column-bg: #ffffff;
}

body.dark-mode {
    --bg-color: #121212;
    --container-bg: #1e1e1e;
    --primary-text: #e9ecef;
    --secondary-text: #adb5bd;
    --accent-color: #375a7f;
    --accent-hover: #2b4764;
    --border-color: #444;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    --column-bg: #1e1e1e;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--primary-text);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

.app-container {
    width: 95%;
    max-width: 1200px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
}

.main-header {
    text-align: center;
}

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

.workspace {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
    flex-grow: 1;
    height: 100%;
}

.column {
    background-color: var(--column-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.column-header {
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.column-header h2 {
    font-size: 1.25rem;
    margin: 0;
    color: var(--accent-color);
}

/* Upload Column */
.upload-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    transition: background-color 0.3s;
}

.custom-file-label {
    padding: 0.75rem 1.5rem;
    background-color: var(--accent-color);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 1rem;
    transition: background-color 0.2s;
}

.custom-file-label:hover {
    background-color: var(--accent-hover);
}

.file-info {
    font-size: 0.9rem;
    color: var(--secondary-text);
    text-align: center;
    word-break: break-all;
}

/* Settings Column */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex-grow: 1;
}

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

.setting-item label {
    font-weight: bold;
    font-size: 0.95rem;
}

.setting-item select {
    padding: 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--primary-text);
    font-size: 1rem;
}

/* Download Column */
.download-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-right: 0.5rem;
}

.empty-msg {
    text-align: center;
    color: var(--secondary-text);
    margin-top: 2rem;
}

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

.download-item span {
    font-size: 0.9rem;
    font-weight: 500;
}

.item-download-btn {
    text-decoration: none;
    color: var(--accent-color);
    font-weight: bold;
    font-size: 0.85rem;
}

/* Buttons */
.action-button {
    padding: 1rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
    margin-top: 1rem;
}

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

.action-button.secondary {
    background-color: var(--secondary-text);
}

/* Theme Toggle */
.theme-toggle-container {
    position: absolute;
    top: -10px;
    right: 0;
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
}

/* Spinner */
.loading-spinner {
    margin-top: 1rem;
    font-weight: bold;
    text-align: center;
}

/* Scrollbar */
.download-list::-webkit-scrollbar {
    width: 6px;
}

.download-list::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

@media (max-width: 900px) {
    .workspace {
        grid-template-columns: 1fr;
        height: auto;
    }
    .app-container {
        height: auto;
        padding: 2rem 0;
    }
    .column {
        height: 350px;
    }
}
