/* Add these styles to your existing style.css */

:root {
    --gh-bg: #0d1117;
    --gh-card-bg: #161b22;
    --gh-border: #30363d;
    --gh-text-main: #c9d1d9;
    --gh-text-muted: #8b949e;
    --gh-btn-bg: #21262d;
    --gh-btn-hover: #30363d;
    --gh-btn-primary: #238636;
    --gh-btn-primary-hover: #2ea043;
    --gh-btn-danger: #da3633;
    --gh-input-bg: #0d1117;
    --gh-link: #58a6ff;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --term-send: #58a6ff;
    --term-receive: #8b949e;
}

/* Header improvements */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.repo-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--gh-text-muted);
}

.repo-name {
    font-weight: 600;
    color: var(--gh-text-main);
}

.repo-branch {
    background: rgba(88, 166, 255, 0.1);
    color: var(--gh-link);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-family: 'SFMono-Regular', Consolas, monospace;
}

/* Auto-flash specific styles */
.firmware-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--gh-border);
    border-radius: 4px;
    margin-bottom: 8px;
    transition: background-color 0.2s;
}

.firmware-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-name {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 12px;
    color: var(--gh-text-main);
}

.file-size {
    font-size: 11px;
    color: var(--gh-text-muted);
    margin-left: 8px;
}

.file-address code {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 11px;
    color: #f0883e;
    background: rgba(240, 136, 62, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

.file-list {
    max-height: 200px;
    overflow-y: auto;
    margin: 15px 0;
    padding-right: 5px;
}

.file-list::-webkit-scrollbar {
    width: 6px;
}

.file-list::-webkit-scrollbar-track {
    background: var(--gh-input-bg);
    border-radius: 3px;
}

.file-list::-webkit-scrollbar-thumb {
    background: var(--gh-border);
    border-radius: 3px;
}

/* Terminal improvements */
.term-line {
    margin-bottom: 2px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 12px;
    word-break: break-all;
}

.term-line.send {
    color: var(--term-send);
}

.term-line.receive {
    color: var(--term-receive);
}

.term-prompt {
    color: #f0883e;
    margin-right: 8px;
    font-weight: bold;
}

.terminal {
    background-color: #0d1117;
    border: 1px solid var(--gh-border);
    border-radius: 6px;
    padding: 12px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 12px;
    height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
    color: var(--gh-text-muted);
}

.terminal-input-area {
    display: flex;
    gap: 10px;
}

.terminal-input-area input {
    flex: 1;
    background: var(--gh-input-bg);
    border: 1px solid var(--gh-border);
    border-radius: 4px;
    padding: 8px 12px;
    color: var(--gh-text-main);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 12px;
}

.terminal-input-area input:focus {
    outline: none;
    border-color: var(--gh-link);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

/* Footer */
.gh-footer {
    margin-top: 40px;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid var(--gh-border);
    font-size: 13px;
    color: var(--gh-text-muted);
}

.gh-footer a {
    color: var(--gh-link);
    text-decoration: none;
}

.gh-footer a:hover {
    text-decoration: underline;
}

.footer-note {
    font-size: 12px;
    margin-top: 5px;
    opacity: 0.8;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .grid-layout {
        grid-template-columns: 1fr;
    }
    
    .flex-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .file-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .offset-input {
        width: 100% !important;
    }
}

/* Add to existing styles */


.action-footer {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Keep all your existing styles below this line */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--gh-bg);
    color: var(--gh-text-main);
    font-family: var(--font-stack);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.gh-header {
    background-color: var(--gh-card-bg);
    border-bottom: 1px solid var(--gh-border);
    padding: 20px 0;
    margin-bottom: 30px;
}
.gh-header h1 { font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.gh-header p { color: var(--gh-text-muted); font-size: 14px; }

.container { max-width: 900px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* Grid Layout */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

/* Cards */
.gh-card {
    background-color: var(--gh-card-bg);
    border: 1px solid var(--gh-border);
    border-radius: 6px;
    overflow: hidden;
}

.gh-card-header {
    background-color: var(--gh-card-bg);
    border-bottom: 1px solid var(--gh-border);
    padding: 16px;
}
.gh-card-header h2 { font-size: 14px; font-weight: 600; margin: 0; }

.gh-card-body { padding: 16px; }

.description { font-size: 14px; color: var(--gh-text-muted); margin-bottom: 15px; }

/* Release Tag Style */
.release-tag {
    display: inline-flex;
    align-items: center;
    background: rgba(56, 139, 253, 0.1);
    border: 1px solid rgba(56, 139, 253, 0.4);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 12px;
    color: #58a6ff;
    margin-bottom: 20px;
}
.tag-icon { margin-right: 5px; }

/* Form Elements */
.input-group { margin-bottom: 15px; }
.input-group label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; }

.gh-input {
    width: 100%;
    background-color: var(--gh-input-bg);
    border: 1px solid var(--gh-border);
    border-radius: 6px;
    padding: 5px 12px;
    color: var(--gh-text-main);
    font-family: inherit;
    font-size: 14px;
    height: 32px;
}
.gh-input:focus { border-color: var(--gh-link); outline: none; box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.3); }

.gh-input-file { font-size: 12px; color: var(--gh-text-muted); }

/* Terminal */
/* (duplicate .terminal block removed; first occurrence kept) */
/* Buttons */
.btn-group { display: flex; gap: 10px; }
.gh-btn {
    appearance: none;
    background-color: var(--gh-btn-bg);
    border: 1px solid var(--gh-border);
    border-radius: 6px;
    color: var(--gh-text-main);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 5px 16px;
    line-height: 20px;
    transition: 0.2s;
}

/* Add these to your existing style.css */

.file-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    border: 1px solid var(--gh-border);
    border-radius: 6px;
    margin-bottom: 10px;
}

.gh-divider {
    border: 0;
    border-top: 1px solid var(--gh-border);
    margin: 20px 0;
}

.gh-btn-text {
    background: none;
    border: none;
    color: var(--gh-link);
    cursor: pointer;
    font-size: 13px;
    padding: 5px 0;
}
.gh-btn-text:hover { text-decoration: underline; }

.gh-btn-icon {
    background: none;
    border: none;
    color: var(--gh-text-muted);
    cursor: pointer;
    padding: 5px;
    transition: 0.2s;
}
.gh-btn-icon:hover { color: var(--gh-btn-danger); }

/* Make offset input smaller */
.offset-input { width: 100px; }

.gh-btn:hover:not(:disabled) { background-color: var(--gh-btn-hover); border-color: #8b949e; }
.gh-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.gh-btn-primary { background-color: var(--gh-btn-primary); color: white; border-color: rgba(27, 31, 35, 0.15); }
.gh-btn-primary:hover:not(:disabled) { background-color: var(--gh-btn-primary-hover); }

.gh-btn-danger { color: #f85149; }
.gh-btn-danger:hover:not(:disabled) { color: white; background-color: var(--gh-btn-danger); border-color: var(--gh-btn-danger); }

/* (duplicate footer block removed; first occurrence kept) */

/* EXTEND EXISTING CSS WITH THESE */

.badge {
    background: #f0883e;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 8px;
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--gh-text-muted);
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
    margin-right: 6px;
}
.status-indicator.connected .status-dot { background: #238636; box-shadow: 0 0 8px #238636; }
.status-indicator.connecting .status-dot { background: #e3b341; animation: blink 1s infinite; }

@keyframes blink { 50% { opacity: 0.5; } }

/* Sidebar Layout */
.main-column { flex: 3; }
.sidebar { flex: 1; min-width: 250px; height: fit-content; }

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
}
.info-row .label { color: var(--gh-text-muted); }
.info-row .value { font-family: monospace; font-weight: bold; }

.gh-btn-block { width: 100%; margin-bottom: 10px; }

/* Tabs */
.tabs { margin-bottom: 10px; display: flex; gap: 10px; }
.tab-btn {
    background: transparent;
    border: none;
    color: var(--gh-text-muted);
    padding: 8px 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.tab-btn.active { color: var(--gh-text-main); border-bottom-color: #f0883e; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Controls Header */
.flex-header { display: flex; justify-content: space-between; align-items: center; }
.controls { display: flex; gap: 15px; align-items: center; }

.gh-select {
    background: var(--gh-input-bg);
    border: 1px solid var(--gh-border);
    color: var(--gh-text-main);
    padding: 4px;
    border-radius: 4px;
}

/* Progress Bar */
.progress-container {
    height: 8px;
    background: #30363d;
    border-radius: 4px;
    margin-top: 20px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: #1f6feb;
    width: 0%;
    transition: width 0.2s ease;
}
.progress-bar.active {
    background-image: linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);
    background-size: 1rem 1rem;
    animation: progress-bar-stripes 1s linear infinite;
}
.progress-text { text-align: center; font-size: 12px; color: var(--gh-text-muted); margin-top: 5px; }

@keyframes progress-bar-stripes {
  0% { background-position: 1rem 0; }
  100% { background-position: 0 0; }
}

/* File List refinements */
.remove-row { color: #8b949e; }
.remove-row:hover { color: #da3633; }
