:root {
    --bg-color: #f0f4f8;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --border-color: #e2e8f0;
    --terminal-bg: #0f172a;
    --terminal-text: #e2e8f0;
    --terminal-info: #ffffff;
    --terminal-warn: #fbbf24;
    --terminal-error: #ff4444;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --border-radius: 12px;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --border-color: #334155;
    --terminal-bg: #0b0f19;
    --terminal-text: #e2e8f0;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 900px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.controls {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 0.875rem;
}

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

.tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

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

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-pane {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
}

.tab-pane.active {
    display: flex;
}

.card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.card h2 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.file-inputs {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.file-upload-wrapper {
    position: relative;
    width: 100%;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.custom-file-upload {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    background-color: var(--bg-color);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s;
}

.file-upload-wrapper:hover .custom-file-upload {
    border-color: var(--primary-color);
}

.file-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.browse-btn {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 0.375rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    pointer-events: none; /* Let the click pass to input */
}

.primary-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.875rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
}

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

.primary-btn:disabled {
    background-color: var(--text-secondary);
    opacity: 0.5;
    cursor: not-allowed;
}

.zebra-btn {
    background-color: #6366f1;
}
.zebra-btn:hover:not(:disabled) {
    background-color: #4f46e5;
}

.terminal-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.terminal-header {
    background-color: var(--border-color);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-header h2 {
    font-size: 0.875rem;
    margin: 0;
    color: var(--text-primary);
}

.terminal-dots span {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-left: 6px;
    background-color: #ef4444;
}
.terminal-dots span:nth-child(2) { background-color: #fbbf24; }
.terminal-dots span:nth-child(3) { background-color: #22c55e; }

.terminal {
    background-color: var(--terminal-bg);
    color: var(--terminal-text);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    padding: 1.5rem;
    height: 300px;
    overflow-y: auto;
    line-height: 1.5;
}

.log-line { margin-bottom: 0.25rem; white-space: pre-wrap; word-break: break-all; }
.log-line.info { color: var(--terminal-info); }
.log-line.warn { color: var(--terminal-warn); }
.log-line.error { color: var(--terminal-error); }
.log-line.success { color: #22c55e; }

.progress-container {
    width: 100%;
    height: 6px;
    background-color: var(--border-color);
}

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

footer {
    display: flex;
    justify-content: center;
    padding-top: 1rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.footer-primary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-secondary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

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

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

.version-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.link-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: underline;
}

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

.modal {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 { font-size: 1.125rem; }

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 1.5rem;
}

.release-item {
    margin-bottom: 1rem;
}

.release-version {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.release-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.release-changes {
    padding-left: 1.25rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.release-changes li {
    margin-bottom: 0.5rem;
}

.release-changes li:last-child {
    margin-bottom: 0;
}
