/* ================================
   CSS Variables & Theme
   ================================ */
:root {
    /* Light Theme - Clean & Professional */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-card: #ffffff;
    --bg-card-hover: #fafafa;

    /* Accent Colors - Red Theme */
    --accent-primary: #C00000;
    --accent-secondary: #913134;
    --accent-light: #EE1C24;
    --accent-soft: #F8BEBF;

    /* Status Colors */
    --status-pending: #A7A7A7;
    --status-running: #EE1C24;
    --status-completed: #2d8a4e;
    --status-error: #C00000;

    /* Text Colors */
    --text-primary: #000000;
    --text-secondary: #717171;
    --text-muted: #A7A7A7;

    /* Border & Shadow */
    --border-color: #E2E2E2;
    --border-dark: #D9D9D9;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

    /* Spacing */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ================================
   Layout
   ================================ */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

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

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer {
    text-align: center;
    padding-top: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ================================
   Card Component
   ================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.card h2 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-error {
    border-color: var(--status-error);
    background: #fff5f5;
}

/* ================================
   Drop Zone
   ================================ */
.drop-zone {
    border: 1px dashed var(--border-dark);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    text-align: center;
    transition: all var(--transition-normal);
    cursor: pointer;
    background: var(--bg-secondary);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent-primary);
    background: var(--accent-soft);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--accent-primary);
}

.drop-zone p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.or {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ================================
   File Info
   ================================ */
.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-top: 1rem;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-primary);
}

#file-name {
    color: var(--text-primary);
    font-weight: 500;
}

/* ================================
   Buttons
   ================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--accent-primary);
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-secondary);
}

.btn-primary:disabled {
    background: var(--border-dark);
    color: var(--text-muted);
    cursor: not-allowed;
}

.btn-success {
    background: var(--status-completed);
    color: #ffffff;
}

.btn-success:hover {
    background: #236b3e;
}

.btn-large {
    padding: 0.875rem 1.75rem;
    font-size: 0.95rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

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

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* ================================
   Form Elements
   ================================ */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.select:hover {
    border-color: var(--accent-secondary);
}

.select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* ================================
   Pipeline Visualization
   ================================ */
.pipeline-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    overflow-x: auto;
}

#pipeline-canvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

.pipeline-detail {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    text-align: center;
}

#current-detail {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ================================
   Download Section
   ================================ */
.download-content,
.error-content {
    text-align: center;
    padding: 2rem;
}

.success-icon svg {
    width: 48px;
    height: 48px;
    color: var(--status-completed);
    margin-bottom: 0.75rem;
}

.error-icon svg {
    width: 48px;
    height: 48px;
    color: var(--status-error);
    margin-bottom: 0.75rem;
}

.download-content p,
.error-content p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

#download-btn svg,
#reset-btn svg {
    width: 20px;
    height: 20px;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--text-muted);
}

/* ================================
   Utilities
   ================================ */
.hidden {
    display: none !important;
}

/* ================================
   Animations
   ================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.card {
    animation: fadeIn var(--transition-normal);
}

/* ================================
   Responsive
   ================================ */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .drop-zone {
        padding: 1.5rem;
    }

    .pipeline-container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .btn-large {
        width: 100%;
    }

    .file-info {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}
