/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Primary colors - Minimalist slate palette */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    /* Accent colors - Subtle and professional */
    --primary: #0f172a;
    --primary-light: #1e293b;
    --primary-lighter: #334155;

    /* Status colors - Muted */
    --success: #059669;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --info: #0284c7;
    --info-light: #dbeafe;

    /* Semantic colors */
    --border: var(--slate-200);
    --border-light: var(--slate-100);
    --text-primary: var(--slate-900);
    --text-secondary: var(--slate-600);
    --text-tertiary: var(--slate-400);
    --bg-primary: #ffffff;
    --bg-secondary: var(--slate-50);
    --bg-hover: var(--slate-100);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ===== Login Screen ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(to bottom, var(--slate-50), var(--slate-100));
}

.logo {
    text-align: center;
    margin-bottom: 3rem;
}

.logo-icon {
    width: 56px;
    height: 56px;
    color: var(--primary);
    margin: 0 auto 1.5rem;
    stroke-width: 1.5;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.logo p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 400;
}

#loginForm {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 420px;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all 0.15s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-group input::placeholder {
    color: var(--text-tertiary);
}

.form-group input:hover {
    border-color: var(--slate-300);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.05);
}

/* ===== Buttons ===== */
.btn {
    padding: 0.75rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    white-space: nowrap;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

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

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

.btn-primary:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-primary:disabled {
    background: var(--slate-200);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-sm svg {
    width: 16px;
    height: 16px;
}

.btn-lg {
    padding: 1rem 1.75rem;
    font-size: 1rem;
}

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

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

.error {
    background: var(--danger-light);
    color: var(--danger);
    padding: 0.875rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.875rem;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

/* ===== Dashboard Header ===== */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
    margin-bottom: 3rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.header-logo {
    width: 28px;
    height: 28px;
    color: var(--primary);
    stroke-width: 1.5;
}

.header-left h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.015em;
}

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

.user-badge {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

/* ===== Statistics Section ===== */
.stats-section {
    margin-bottom: 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--bg-primary);
    padding: 1.75rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: var(--slate-300);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

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

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.stat-icon {
    width: 40px;
    height: 40px;
    opacity: 0.3;
}

.stat-card-success .stat-icon {
    color: var(--success);
}

.stat-card-warning .stat-icon {
    color: var(--warning);
}

.stat-card-info .stat-icon {
    color: var(--info);
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

/* ===== Card ===== */
.card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.card-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    letter-spacing: -0.025em;
}

.card-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin: 0;
}

/* ===== Deploy Steps ===== */
.deploy-steps {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.step {
    padding: 1.75rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border-light);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 1.25rem;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.step-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.step-optional {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    font-weight: 500;
    padding: 0.25rem 0.625rem;
    background: var(--slate-100);
    border-radius: 6px;
}

/* ===== Upload Zone ===== */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-primary);
}

.upload-zone:hover {
    border-color: var(--primary);
    background: var(--slate-50);
}

.upload-zone.dragover {
    border-color: var(--primary);
    background: var(--slate-50);
    border-style: solid;
}

.upload-placeholder {
    color: var(--text-secondary);
}

.upload-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.25rem;
    color: var(--text-tertiary);
    stroke-width: 1.5;
}

.upload-text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

/* ===== File List ===== */
.file-list {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.15s ease;
}

.file-item:hover {
    border-color: var(--slate-300);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.file-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}

.file-remove {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.file-remove:hover {
    background: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
}

/* ===== Version Types ===== */
.version-types {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.version-type {
    cursor: pointer;
}

.version-type input {
    display: none;
}

.version-type-card {
    background: var(--bg-primary);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1rem;
    text-align: center;
    transition: all 0.15s ease;
    height: 100%;
}

.version-type:hover .version-type-card {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.version-type input:checked + .version-type-card {
    border-color: var(--primary);
    background: var(--slate-50);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.05);
}

.version-type-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 0.875rem;
    color: var(--text-secondary);
}

.version-type-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.version-type-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
    margin-bottom: 0.375rem;
    font-weight: 500;
}

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

/* ===== Version Preview ===== */
.version-preview {
    padding: 1.25rem;
    background: var(--bg-primary);
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border);
}

.version-preview-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.version-badge {
    display: inline-block;
    padding: 0.5rem 1.125rem;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
    font-size: 1rem;
    margin-left: 0.75rem;
    letter-spacing: -0.015em;
}

/* ===== Textarea ===== */
textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9375rem;
    resize: vertical;
    transition: all 0.15s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

textarea::placeholder {
    color: var(--text-tertiary);
}

textarea:hover {
    border-color: var(--slate-300);
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.05);
}

/* ===== Deploy Button ===== */
.btn-deploy {
    min-width: 200px;
}

/* ===== Deploy Status ===== */
.deploy-status {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.deploy-status.success {
    background: var(--success-light);
    color: var(--success);
    border-color: rgba(5, 150, 105, 0.2);
}

.deploy-status.error {
    background: var(--danger-light);
    color: var(--danger);
    border-color: rgba(220, 38, 38, 0.2);
}

.deploy-status.loading {
    background: var(--info-light);
    color: var(--info);
    border-color: rgba(2, 132, 199, 0.2);
}

/* ===== Releases List ===== */
.releases-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.release-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.75rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.release-item:hover {
    border-color: var(--slate-300);
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.05);
}

.release-info {
    flex: 1;
    min-width: 0;
}

.release-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.release-version {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Courier New', monospace;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.release-channel {
    padding: 0.375rem 0.875rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.release-channel.stable {
    background: var(--success-light);
    color: var(--success);
}

.release-channel.beta {
    background: var(--warning-light);
    color: var(--warning);
}

.release-channel.alpha {
    background: var(--info-light);
    color: var(--info);
}

.release-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.release-files {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.file-badge {
    padding: 0.375rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.release-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 1.5rem;
}

.btn-delete {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.625rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.btn-delete:hover {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
}

.loading {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-tertiary);
    font-size: 0.9375rem;
}

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

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .version-types {
        grid-template-columns: 1fr;
    }

    .release-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }

    .release-actions {
        margin-left: 0;
        width: 100%;
    }

    .btn-delete {
        flex: 1;
    }

    .header-content {
        gap: 1rem;
    }

    .user-badge {
        display: none;
    }

    .card {
        padding: 1.5rem;
    }

    .step {
        padding: 1.5rem;
    }
}

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

.screen {
    animation: fadeIn 0.3s ease;
}
