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

:root {
    --bg-primary: rgb(9, 9, 11);
    --bg-secondary: rgb(17, 17, 19);
    --bg-card: rgb(23, 23, 26);
    --text-primary: rgb(255, 255, 255);
    --text-secondary: rgb(161, 161, 170);
    --accent-blue: rgb(64, 197, 255);
    --accent-green: rgb(72, 216, 125);
    --accent-yellow: rgb(255, 182, 110);
    --accent-purple: rgb(133, 84, 255);
    --border-color: rgba(255, 255, 255, 0.1);
    --hover-bg: rgba(255, 255, 255, 0.05);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 600px;
    background: radial-gradient(ellipse at 50% 0%, rgba(64, 197, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

header {
    background: transparent;
    padding: 40px 0;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.logo {
    height: 50px;
    width: auto;
}

.logo img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    user-select: none;
    cursor: default;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 18px;
    font-weight: 400;
    user-select: none;
    line-height: 1.5;
}

.config-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.config-section h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.config-form {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
}

label {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

input {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(64, 197, 255, 0.05);
}

button {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.2s;
}

button:hover::before {
    opacity: 1;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(64, 197, 255, 0.3);
}

.firmware-grid {
    display: grid;
    gap: 20px;
}

.firmware-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.firmware-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    opacity: 0;
    transition: opacity 0.3s;
}

.firmware-card:hover {
    transform: translateY(-2px);
    border-color: rgba(64, 197, 255, 0.3);
    background: rgba(64, 197, 255, 0.02);
}

.firmware-card:hover::before {
    opacity: 1;
}

.firmware-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.version-badge {
    background: rgba(133, 84, 255, 0.1);
    color: var(--accent-purple);
    padding: 6px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid rgba(133, 84, 255, 0.2);
}

.latest-badge {
    background: rgba(72, 216, 125, 0.1);
    color: var(--accent-green);
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    margin-left: 8px;
    border: 1px solid rgba(72, 216, 125, 0.2);
}

.robot-badge {
    background: rgba(255, 182, 110, 0.15);
    color: var(--accent-yellow);
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
    margin-left: 8px;
    border: 1px solid rgba(255, 182, 110, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.package-meta {
    display: flex;
    gap: 20px;
    margin: 12px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.components-list {
    margin: 12px 0;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.components-list strong {
    color: var(--accent-blue);
    font-weight: 600;
}

.upload-time {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
}

.changelog {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 14px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    line-height: 1.6;
    position: relative;
}

.changelog h1, .changelog h2, .changelog h3, .changelog h4, .changelog h5, .changelog h6 {
    color: var(--text-primary);
    margin-top: 16px;
    margin-bottom: 8px;
    font-weight: 600;
}

.changelog h1 { font-size: 20px; }
.changelog h2 { font-size: 18px; }
.changelog h3 { font-size: 16px; }

.changelog p {
    margin-bottom: 12px;
}

.changelog ul, .changelog ol {
    margin-left: 24px;
    margin-bottom: 12px;
}

.changelog li {
    margin-bottom: 4px;
}

.changelog code {
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 13px;
    color: var(--accent-blue);
}

.changelog pre {
    background: var(--bg-primary);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 12px;
}

.changelog pre code {
    background: none;
    padding: 0;
}

.changelog a {
    color: var(--accent-blue);
    text-decoration: none;
}

.changelog a:hover {
    text-decoration: underline;
}

.changelog blockquote {
    border-left: 3px solid var(--accent-blue);
    padding-left: 16px;
    margin: 12px 0;
    color: var(--text-secondary);
}

/* Markdown Table Styles */
.changelog table {
    width: 100%;
    margin: 16px 0;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.changelog thead {
    background: linear-gradient(135deg, rgba(64, 197, 255, 0.15), rgba(133, 84, 255, 0.15));
}

.changelog th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(64, 197, 255, 0.3);
}

.changelog tbody tr {
    transition: all 0.2s;
}

.changelog tbody tr:hover {
    background: rgba(64, 197, 255, 0.05);
}

.changelog tbody tr:not(:last-child) td {
    border-bottom: 1px solid var(--border-color);
}

.changelog td {
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.changelog td:first-child,
.changelog th:first-child {
    padding-left: 20px;
}

.changelog td:last-child,
.changelog th:last-child {
    padding-right: 20px;
}

/* Alternating row colors for better readability */
.changelog tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* Table cell alignment */
.changelog th:nth-child(n+2),
.changelog td:nth-child(n+2) {
    text-align: center;
}

/* Make code inside tables more visible */
.changelog td code {
    background: rgba(64, 197, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 12px;
    color: var(--accent-blue);
}

/* Responsive table */
@media (max-width: 768px) {
    .changelog table {
        font-size: 12px;
    }
    
    .changelog th,
    .changelog td {
        padding: 8px 12px;
    }
    
    .changelog td:first-child,
    .changelog th:first-child {
        padding-left: 12px;
    }
    
    .changelog td:last-child,
    .changelog th:last-child {
        padding-right: 12px;
    }
}

.changelog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.changelog-title {
    color: var(--accent-blue);
    font-weight: 600;
    font-size: 14px;
}

.download-btn {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.download-btn::before {
    content: '↓';
    font-size: 16px;
}

.download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(72, 216, 125, 0.3);
}

.file-info {
    display: flex;
    gap: 24px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.file-info span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.file-info span::before {
    content: '•';
    color: var(--accent-blue);
}

.file-info span:first-child::before {
    content: '';
}

.loading {
    text-align: center;
    padding: 80px;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
}

.loading::before {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error {
    background: rgba(255, 68, 68, 0.1);
    color: #ff4444;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 68, 68, 0.2);
    font-weight: 500;
}

.success {
    background: rgba(72, 216, 125, 0.1);
    color: var(--accent-green);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid rgba(72, 216, 125, 0.2);
    font-weight: 500;
}

.no-firmware {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 60px;
    text-align: center;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    font-size: 16px;
}

.info-message {
    background: rgba(64, 197, 255, 0.1);
    color: var(--accent-blue);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid rgba(64, 197, 255, 0.2);
    font-size: 14px;
}

@media (max-width: 768px) {
    h1 {
        font-size: 36px;
    }
    .subtitle {
        font-size: 16px;
    }
    .firmware-card {
        padding: 20px;
    }
    .config-form {
        flex-direction: column;
    }
}