/* ==========================================================================
   Git REST API Management Dashboard (v2.2) - Design System
   High-Tech Dark Terminal Aesthetic with Emerald Accents
   ========================================================================== */

:root {
    --bg-dark: #070A0F;
    --card-bg: #0D111A;
    --card-hover: #131926;
    --card-border: #1E293B;

    --text-main: #F8FAFC;
    --text-sub: #94A3B8;
    --text-muted: #64748B;

    --color-emerald: #10B981;
    --color-emerald-dark: #059669;
    --color-emerald-bg: rgba(16, 185, 129, 0.12);
    --color-emerald-border: rgba(16, 185, 129, 0.3);

    --color-crimson: #EF4444;
    --color-crimson-bg: rgba(239, 68, 68, 0.12);

    --color-gold: #EAB308;
    --color-blue: #38BDF8;

    --font-primary: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-heading: 'Outfit', 'Pretendard', sans-serif;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;
}

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

html, body {
    width: 100%; height: 100%;
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-primary);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

/* Top Navigation Bar */
.top-bar {
    height: 60px;
    background: #0B0E17;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 100;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 800; }
.brand-sub { font-size: 0.75rem; color: var(--text-sub); font-family: var(--font-mono); font-weight: 400; margin-left: 6px; }

.api-status-badge {
    display: flex; align-items: center; gap: 8px;
    background: rgba(234, 179, 8, 0.12); border: 1px solid rgba(234, 179, 8, 0.3);
    color: var(--color-gold); padding: 4px 14px; border-radius: var(--radius-full);
    font-size: 0.8rem; font-weight: 700;
}

.api-status-badge.connected {
    background: var(--color-emerald-bg); border-color: var(--color-emerald-border);
    color: var(--color-emerald);
}

.status-dot {
    width: 8px; height: 8px; border-radius: 50%; background: currentColor;
}

.top-actions { display: flex; gap: 8px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 8px 16px; font-family: var(--font-primary); font-size: 0.88rem; font-weight: 700;
    border-radius: var(--radius-md); border: 1px solid transparent; cursor: pointer;
    text-decoration: none; transition: all 0.15s ease;
}

.btn:active { transform: scale(0.98); }

.btn-emerald { background: var(--color-emerald); color: #041D17; font-weight: 800; }
.btn-emerald:hover { background: var(--color-emerald-dark); color: white; }

.btn-outline { background: transparent; border: 1px solid var(--card-border); color: var(--text-main); }
.btn-outline:hover { background: var(--card-hover); border-color: var(--color-emerald); }

.btn-sm { padding: 4px 12px; font-size: 0.78rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 10px 20px; font-size: 0.95rem; }
.btn-icon { background: transparent; border: none; color: var(--text-sub); font-size: 1rem; cursor: pointer; }
.btn-icon:hover { color: var(--color-emerald); }

/* Dashboard Container */
.dashboard-container {
    max-width: 1280px; margin: 0 auto; padding: 24px;
    display: grid; grid-template-columns: 320px 1fr; gap: 24px;
}

/* Sidebar & Cards */
.dash-sidebar { display: flex; flex-direction: column; }

.sidebar-card, .panel-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.card-title {
    font-size: 0.95rem; font-weight: 800; display: flex; align-items: center; gap: 8px;
    margin-bottom: 12px;
}

.justify-between { justify-content: space-between; }
.card-desc { font-size: 0.8rem; color: var(--text-sub); margin-bottom: 10px; }

.input-group { display: flex; gap: 6px; }
.input-group input {
    flex: 1; background: var(--bg-dark); border: 1px solid var(--card-border);
    border-radius: var(--radius-md); padding: 8px 12px; color: white;
    font-family: var(--font-mono); font-size: 0.85rem; outline: none;
}
.input-group input:focus { border-color: var(--color-emerald); }

.key-status-msg { font-size: 0.78rem; color: var(--text-muted); }

.quick-cmd-list { display: flex; flex-direction: column; gap: 6px; }
.cmd-btn {
    background: var(--bg-dark); border: 1px solid var(--card-border);
    border-radius: var(--radius-md); padding: 10px 14px; text-align: left;
    color: var(--text-main); font-family: var(--font-primary); font-size: 0.85rem;
    font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 10px;
    transition: all 0.15s ease;
}

.cmd-btn:hover {
    border-color: var(--color-emerald); background: var(--color-emerald-bg); color: var(--color-emerald);
}

.info-list { display: flex; flex-direction: column; gap: 6px; color: var(--text-sub); }
.info-item { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--card-border); padding-bottom: 4px; }

/* Main Panel Layout */
.dash-main-panel { display: flex; flex-direction: column; }

.commit-form-row { display: flex; gap: 10px; }
.commit-form-row input {
    flex: 1; background: var(--bg-dark); border: 1px solid var(--card-border);
    border-radius: var(--radius-md); padding: 12px 16px; color: white;
    font-family: var(--font-primary); font-size: 0.95rem; outline: none;
}
.commit-form-row input:focus { border-color: var(--color-emerald); }

/* Status Output Box */
.status-output-box {
    background: var(--bg-dark); border: 1px solid var(--card-border);
    border-radius: var(--radius-md); padding: 14px; font-family: var(--font-mono);
    font-size: 0.85rem; color: var(--text-main); min-height: 80px; max-height: 220px; overflow-y: auto;
}

.status-tag { display: inline-block; padding: 2px 8px; border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 700; margin-right: 6px; }
.status-tag.modified { background: rgba(234, 179, 8, 0.15); color: var(--color-gold); }
.status-tag.untracked { background: rgba(239, 68, 68, 0.15); color: var(--color-crimson); }
.status-tag.clean { background: var(--color-emerald-bg); color: var(--color-emerald); }

/* History Timeline List */
.history-list-container { display: flex; flex-direction: column; gap: 10px; }

.history-item-card {
    background: var(--bg-dark); border: 1px solid var(--card-border);
    border-radius: var(--radius-md); padding: 14px 18px;
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    transition: border-color 0.15s ease;
}

.history-item-card:hover { border-color: var(--color-emerald); }

.h-info { display: flex; flex-direction: column; gap: 4px; }
.h-header { display: flex; align-items: center; gap: 10px; }
.h-hash { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; color: var(--color-emerald); background: var(--color-emerald-bg); padding: 2px 8px; border-radius: var(--radius-sm); }
.h-date { font-size: 0.78rem; color: var(--text-muted); }
.h-msg { font-size: 0.95rem; font-weight: 700; color: var(--text-main); }
.h-author { font-size: 0.78rem; color: var(--text-sub); }

.h-actions { display: flex; gap: 6px; }

.badge-count {
    font-family: var(--font-mono); font-size: 0.78rem; color: var(--color-emerald);
    background: var(--color-emerald-bg); padding: 2px 10px; border-radius: var(--radius-full);
}

/* Diff Code Box */
.diff-code-box {
    background: #040609; border: 1px solid var(--card-border);
    border-radius: var(--radius-md); padding: 16px; font-family: var(--font-mono);
    font-size: 0.82rem; color: #A7F3D0; overflow-x: auto; max-height: 320px;
    white-space: pre-wrap; word-break: break-all;
}

/* Console Drawer */
.console-drawer {
    position: fixed; bottom: 0; left: 0; right: 0; height: 160px;
    background: #05070B; border-top: 1.5px solid var(--card-border);
    display: flex; flex-direction: column; z-index: 90;
}

.drawer-header {
    padding: 8px 18px; background: #0A0D15; border-bottom: 1px solid var(--card-border);
    display: flex; align-items: center; justify-content: space-between; font-size: 0.82rem; font-weight: 700;
}

.drawer-body {
    padding: 12px 18px; overflow-y: auto; font-size: 0.8rem; display: flex; flex-direction: column; gap: 4px;
}

.log-entry { font-family: var(--font-mono); color: var(--text-sub); }
.log-entry.sys { color: var(--color-blue); }
.log-entry.success { color: var(--color-emerald); }
.log-entry.err { color: var(--color-crimson); }

.text-emerald { color: var(--color-emerald); }
.text-muted { color: var(--text-muted); }
.margin-top-xs { margin-top: 8px; }
.margin-top-sm { margin-top: 14px; }
.margin-top-md { margin-top: 20px; }

@media (max-width: 900px) {
    .dashboard-container { grid-template-columns: 1fr; }
}
