:root {
    /* Light Mode (Default) - Zinc Inspired */
    --background: #ffffff;
    --foreground: #09090b;
    --card: #ffffff;
    --card-foreground: #09090b;
    --popover: #ffffff;
    --popover-foreground: #09090b;
    --primary: #6366f1;
    --primary-foreground: #ffffff;
    --secondary: #f4f4f5;
    --secondary-foreground: #18181b;
    --muted: #f4f4f5;
    --muted-foreground: #71717a;
    --accent: #f4f4f5;
    --accent-foreground: #18181b;
    --destructive: #ef4444;
    --destructive-foreground: #fafafa;
    --border: #e4e4e7;
    --input: #ffffff;
    --ring: #a1a1aa;
    --radius: 0.5rem;
}

.dark {
    /* Dark Mode - Zinc Dark */
    --background: #09090b;
    --foreground: #fafafa;
    --card: #09090b;
    --card-foreground: #fafafa;
    --popover: #09090b;
    --popover-foreground: #fafafa;
    --primary: #6366f1;
    --primary-foreground: #fafafa;
    --secondary: #27272a;
    --secondary-foreground: #fafafa;
    --muted: #27272a;
    --muted-foreground: #a1a1aa;
    --accent: #27272a;
    --accent-foreground: #fafafa;
    --destructive: #ef4444;
    --destructive-foreground: #fafafa;
    --border: #27272a;
    --input: #27272a;
    --ring: #d4d4d8;
}

body {
    background-color: var(--background);
    color: var(--foreground);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
}

.navbar {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--background);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 50;
    transition: background-color 0.3s, border-color 0.3s;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#lang-select {
    background-color: var(--secondary);
    border: 1px solid var(--border);
    color: var(--foreground);
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

#lang-select:hover {
    border-color: var(--primary);
}

/* AI Config Bar (Improved) */
.ai-config-section {
    background-color: var(--secondary);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.ai-config-grid {
    display: grid;
    grid-template-columns: 140px 160px 1fr auto;
    gap: 1.25rem;
    align-items: flex-end;
}

.config-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.config-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.config-group input, .config-group select {
    background-color: var(--background);
    border: 1px solid var(--border);
    color: var(--foreground);
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    width: 100%;
    outline: none;
    transition: all 0.2s;
}

.config-group input:focus, .config-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

#ai-api-key {
    font-family: monospace;
    letter-spacing: 0.1em;
}

.btn-ai {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
}

.btn-ai:hover {
    filter: brightness(1.1);
}

.modal-body .config-group input, 
.modal-body .config-group select {
    max-width: 320px;
    width: 100%;
}

.ai-loading {
    animation: pulse 1.5s infinite;
    pointer-events: none;
    opacity: 0.7;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-tabs {
    display: flex;
    gap: 0.5rem;
}

.nav-tab {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    color: var(--muted-foreground);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-tab:hover {
    background-color: var(--accent);
    color: var(--accent-foreground);
}

.nav-tab.active {
    background-color: var(--accent);
    color: var(--foreground);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--foreground);
    padding: 0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background-color: var(--accent);
}

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

.page {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.page.active {
    display: block;
}

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

/* Card Style */
.card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: background-color 0.3s, border-color 0.3s;
}

.card-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.card-description {
    color: var(--muted-foreground);
    margin-bottom: 2rem;
}

/* Drop Zone */
#drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 4rem 2rem;
    text-align: center;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: all 0.2s;
    background-color: var(--background);
}

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

#drop-zone i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: block;
}

/* Table Style */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
}

th {
    text-align: left;
    padding: 0.75rem 1rem;
    color: var(--muted-foreground);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    letter-spacing: 0.05em;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

input[type="text"] {
    background-color: var(--input);
    border: 1px solid var(--border);
    color: var(--foreground);
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius);
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s;
    font-size: 0.9rem;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    gap: 0.5rem;
}

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

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

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

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

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.status {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
}

.status.info {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

/* Activity Log Styles */
.log-container {
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    display: none;
}

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

.log-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.log-window {
    background-color: var(--secondary);
    border-radius: var(--radius);
    padding: 1rem;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--foreground);
    border: 1px solid var(--border);
}

.log-entry {
    margin-bottom: 0.5rem;
    display: flex;
    gap: 0.75rem;
    line-height: 1.4;
}

.log-time {
    color: var(--muted-foreground);
    flex-shrink: 0;
}

.log-msg-info { color: var(--primary); }
.log-msg-success { color: #22c55e; }
.log-msg-error { color: var(--destructive); }
.log-msg-ai { color: #a855f7; font-style: italic; }

.search-query-input {
    font-size: 0.72rem;
    color: var(--muted-foreground);
    min-width: 100px;
    max-width: 160px;
}

/* Placeholder for other pages */
.placeholder-content {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--muted-foreground);
    background-color: var(--muted);
    border-radius: var(--radius);
    margin-top: 1rem;
}

.art-preview-container {
    width: 48px;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    background-color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.art-preview-container:hover {
    border-color: var(--primary);
}

.art-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.art-preview-container i {
    font-size: 1.1rem;
    color: var(--muted-foreground);
}

.art-preview-container:hover::after {
    content: "\f044";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-fetch-art {
    display: block;
    width: 48px;
    background: none;
    border: 1px solid var(--border);
    color: var(--muted-foreground);
    border-radius: 4px;
    font-size: 0.7rem;
    padding: 2px 0;
    margin-top: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-fetch-art:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Modal Styles */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 90%;
    max-width: 450px;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    position: relative;
    animation: modalSlideUp 0.3s ease-out;
}

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

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

.modal-close {
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.5rem;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--foreground);
}

.cost-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cost-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.cost-item i {
    color: var(--primary);
    margin-top: 0.25rem;
}

/* Tooltip Styles (Removed/Replaced) */
.btn-remove {
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: color 0.2s;
    padding: 0.5rem;
}

.btn-lyrics {
    background: none;
    border: none;
    color: #ef4444; /* 가사 없음: Red */
    cursor: pointer;
    transition: all 0.2s;
    padding: 0.5rem;
}

.btn-lyrics.active {
    color: #22c55e; /* 가사 있음: Green */
}

.lyrics-editor-container {
    display: none;
    margin-top: 0.5rem;
    width: 100%;
}

.lyrics-textarea {
    width: 100%;
    min-height: 120px;
    background-color: var(--input);
    border: 1px solid var(--border);
    color: var(--foreground);
    border-radius: var(--radius);
    padding: 0.75rem;
    font-size: 0.85rem;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    outline: none;
}

.lyrics-textarea:focus {
    border-color: var(--primary);
}
