:root {
    --primary-hue: 250;
    --secondary-hue: 180;
    
    --primary: hsl(var(--primary-hue), 80%, 65%);
    --primary-glow: hsl(var(--primary-hue), 80%, 65%, 0.5);
    --secondary: hsl(var(--secondary-hue), 80%, 50%);
    --secondary-glow: hsl(var(--secondary-hue), 80%, 50%, 0.5);
    
    --bg-dark: #050507;
    --bg-card: rgba(20, 20, 25, 0.6);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.08);
    
    --text-main: #ffffff;
    --text-muted: #9ca3af;
    
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    padding: 40px 20px;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 0.8s ease-out;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    text-shadow: 0 0 40px rgba(99, 102, 241, 0.3);
}

h2 {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--secondary);
    margin-bottom: 15px;
    opacity: 0.9;
}

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

/* Cards & Glassmorphism */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.card h3 {
    font-size: 1.4rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
}

/* Lists */
ul, ol {
    list-style: none;
    margin-left: 0;
}

li {
    margin-bottom: 12px;
    padding-left: 24px;
    position: relative;
    color: var(--text-muted);
}

ol li::before {
    content: counter(list-item) ".";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 600;
}

ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: bold;
}

strong {
    color: var(--text-main);
    font-weight: 600;
}

/* Status Display */
.status-display {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 20px 30px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-glass);
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.status-item .label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.status-item .value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    color: var(--text-main);
}

/* Buttons */
.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.btn {
    padding: 18px 30px;
    border-radius: 16px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-main);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

/* Progress Bar */
.progress-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 30px;
}

.progress-container.hidden {
    display: none;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 15px var(--primary-glow);
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--secondary);
}

/* Logs */
.log-container h4 {
    margin-bottom: 15px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.log-output {
    background: #000000;
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    height: 250px;
    overflow-y: auto;
    color: #d1d5db;
}

.log-entry {
    margin-bottom: 6px;
    opacity: 0.9;
}

.log-entry.info { color: #93c5fd; }
.log-entry.success { color: #4ade80; }
.log-entry.error { color: #f87171; }
.log-entry.warning { color: #fbbf24; }

/* Firmware Info Box */
.firmware-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 700px) {
    .firmware-info { grid-template-columns: 1fr; }
    h1 { font-size: 2.5rem; }
    .button-group { grid-template-columns: 1fr; }
    .status-display { flex-direction: column; align-items: flex-start; gap: 20px; }
}

.note {
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 12px;
    padding: 15px 20px;
    margin-top: 25px;
    font-size: 0.9rem;
    color: #c7d2fe;
}

/* Advanced Section */
details {
    border-top: 1px solid var(--border-glass);
    padding-top: 20px;
    margin-top: 10px;
}

details summary {
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s;
}

details summary:hover {
    color: var(--text-main);
}

.file-upload {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer a {
    color: var(--text-main);
    text-decoration: none;
    border-bottom: 1px dotted var(--text-muted);
    transition: border-color 0.2s;
}

footer a:hover {
    border-bottom: 1px solid var(--primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

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