/* style.css */
/* Modern Dark Glassmorphic Design System */

:root {
    --bg-base: #0b0d19;
    --bg-card: rgba(22, 28, 45, 0.6);
    --bg-card-hover: rgba(26, 34, 56, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #ec4899 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    
    --color-primary: #6366f1;
    --color-secondary: #a855f7;
    --color-text-main: #f8fafc;
    --color-text-muted: #94a3b8;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
    
    --font-sans: 'Outfit', 'Noto Sans KR', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-base);
    color: var(--color-text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Decor Orbs */
.background-decor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.45;
}

.orb-1 {
    top: -10%;
    right: 15%;
    width: 450px;
    height: 450px;
    background: #6366f1;
}

.orb-2 {
    bottom: 10%;
    left: -5%;
    width: 500px;
    height: 500px;
    background: #a855f7;
}

/* Layout */
.app-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.logo-area {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: #6366f1;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.6));
    animation: pulse-slow 3s infinite ease-in-out;
}

.logo-text {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ffffff 30%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--color-text-muted);
    -webkit-text-fill-color: initial;
}

.tagline {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0.5rem auto 0;
}

/* Grid System */
.app-main {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 1.75rem;
    flex: 1;
}

@media (max-width: 1024px) {
    .app-main {
        grid-template-columns: 1fr;
    }
}

/* Cards (Glassmorphism) */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.header-icon {
    width: 1.35rem;
    height: 1.35rem;
    color: var(--color-primary);
}

/* Form Styling & Radio Customization */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

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

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-label {
    cursor: pointer;
}

.radio-label input {
    display: none;
}

.radio-custom {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    transition: var(--transition);
}

.radio-custom i {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-text-muted);
    transition: var(--transition);
}

.radio-custom span {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: var(--transition);
}

.radio-label input:checked + .radio-custom {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--color-primary);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}

.radio-label input:checked + .radio-custom i {
    color: var(--color-primary);
}

.radio-label input:checked + .radio-custom span {
    color: var(--color-text-main);
}

/* Dropzone Area */
.dropzone-container {
    margin-top: 1.25rem;
}

.dropzone {
    border: 2px dashed rgba(99, 102, 241, 0.35);
    background: rgba(15, 18, 36, 0.5);
    border-radius: 1.25rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.dropzone:hover, .dropzone.dragover {
    border-color: #a855f7;
    background: rgba(99, 102, 241, 0.06);
    box-shadow: var(--shadow-glow);
}

.file-input-hidden {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.icon-circle {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    transition: var(--transition);
}

.dropzone:hover .icon-circle, .dropzone.dragover .icon-circle {
    background: rgba(168, 85, 247, 0.18);
    transform: scale(1.08);
}

.upload-icon {
    width: 2rem;
    height: 2rem;
    color: var(--color-primary);
    transition: var(--transition);
}

.dropzone:hover .upload-icon, .dropzone.dragover .upload-icon {
    color: #a855f7;
}

.dropzone h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.dropzone p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.file-limits {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    color: var(--color-text-muted);
}

/* Queue Panel and Batch Actions */
.queue-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.batch-card {
    border-left: 4px solid var(--color-primary);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.batch-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.batch-info h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.batch-info p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.batch-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(99, 102, 241, 0.15);
    color: var(--color-primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.batch-status-badge.completed {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.2);
}

/* Progress Bars */
.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar-wrapper {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-gradient);
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.progress-percent {
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 35px;
    text-align: right;
}

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

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35), var(--shadow-glow);
}

.btn-large {
    padding: 0.9rem 1.8rem;
    width: 100%;
    font-size: 1rem;
}

.btn-disabled, .btn:disabled {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--color-text-muted) !important;
    cursor: not-allowed;
    box-shadow: none !important;
    transform: none !important;
}

.btn-text {
    background: transparent;
    color: var(--color-text-muted);
    padding: 0.4rem 0.8rem;
}

.btn-text:hover {
    color: var(--color-text-main);
    background: rgba(255, 255, 255, 0.05);
}

.batch-download-area {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.download-tip {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    line-height: 1.4;
    text-align: center;
}

/* File List Elements */
.list-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 380px;
}

.title-with-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.count-badge {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: 3rem;
}

.empty-icon {
    width: 3.5rem;
    height: 3.5rem;
    color: var(--color-text-muted);
    opacity: 0.4;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-main);
    margin-bottom: 0.25rem;
}

.empty-state span {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Custom Scrollbar for Files List */
.files-list::-webkit-scrollbar {
    width: 6px;
}

.files-list::-webkit-scrollbar-track {
    background: transparent;
}

.files-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.files-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* File Item Card */
.file-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 0.85rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: var(--transition);
}

.file-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateX(4px);
}

.file-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.file-info-text {
    flex: 1;
    min-width: 0; /* allows text truncation */
}

.file-name {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.1rem;
}

.file-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    display: flex;
    gap: 0.75rem;
}

/* Badges for Jobs */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.badge-pending {
    background: rgba(234, 179, 8, 0.12);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.2);
}

.badge-processing {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-completed {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-failed {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.spinning {
    animation: spin 1.2s infinite linear;
}

/* File Actions / Download Buttons for item */
.file-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 0.65rem;
    animation: fadeIn 0.4s ease forwards;
}

.btn-download-sub {
    font-size: 0.75rem;
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-main);
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    transition: var(--transition);
}

.btn-download-sub:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

.error-text {
    font-size: 0.75rem;
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
}

/* Utility Helpers */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes pulse-slow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* Footer */
.app-footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--color-text-muted);
    font-size: 0.8rem;
}
