/* ========================================
   Git Branch Visualizer — Cyber Teal Theme
   ======================================== */

:root {
    --primary: #14B8A6;
    --primary-hover: #0D9488;
    --secondary: #2DD4BF;
    --accent: #E879F9;
    --bg: #0A1A1A;
    --bg-surface: #112020;
    --bg-elevated: #162828;
    --bg-input: #0D1818;
    --border: #1E3535;
    --border-focus: #14B8A6;
    --text: #D4F0EC;
    --text-muted: #6BA8A0;
    --text-dim: #3D6B65;
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --transition: 0.2s ease;
    --success: #10B981;
    --error: #EF4444;
}

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

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo h1 {
    font-size: 1.05rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.header-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all var(--transition);
}

.header-btn:hover {
    background: var(--bg-elevated);
    color: var(--text);
    border-color: var(--primary);
}

.btn-primary-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    border-color: transparent;
}

.btn-primary-header:hover {
    filter: brightness(1.1);
    color: #fff;
}

/* Main */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    position: relative;
}

/* Input Section */
.input-section {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
}

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

.input-header label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
}

.input-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-controls input {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-family: var(--font);
    font-size: 0.8rem;
    outline: none;
    width: 160px;
}

.input-controls input:focus {
    border-color: var(--border-focus);
}

.input-controls input::placeholder {
    color: var(--text-dim);
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.zoom-controls button {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.zoom-controls button:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.zoom-controls span {
    font-size: 0.78rem;
    color: var(--text-dim);
    min-width: 40px;
    text-align: center;
    font-family: var(--mono);
}

.log-input {
    width: 100%;
    min-height: 100px;
    max-height: 180px;
    background: var(--bg-input);
    color: var(--secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: border-color var(--transition);
}

.log-input:focus {
    border-color: var(--border-focus);
}

.log-input::placeholder {
    color: var(--text-dim);
}

/* Graph Section */
.graph-section {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.graph-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1;
    height: 100%;
    color: var(--text-dim);
    text-align: center;
    padding: 60px 20px;
    position: absolute;
    inset: 0;
}

.graph-container {
    width: 100%;
    height: 100%;
    overflow: auto;
    position: absolute;
    inset: 0;
    cursor: grab;
}

.graph-container:active {
    cursor: grabbing;
}

canvas {
    display: block;
}

/* Commit Tooltip */
.commit-tooltip {
    position: fixed;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    max-width: 320px;
    z-index: 500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    box-shadow: var(--shadow);
}

.commit-tooltip.visible {
    opacity: 1;
}

.tooltip-hash {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 4px;
}

.tooltip-message {
    font-size: 0.82rem;
    color: var(--text);
    margin-bottom: 4px;
}

.tooltip-refs {
    font-size: 0.75rem;
    color: var(--accent);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--text);
    box-shadow: var(--shadow);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
    max-width: 300px;
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--error);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

@media (max-width: 600px) {
    .input-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .input-controls {
        flex-wrap: wrap;
    }
}