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

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    --primary: #22C55E;
    --accent: #86EFAC;
    --bg: #0A0A0A;
    --surface: #111111;
    --surface2: #1a1a1a;
    --border: #2a2a2a;
    --text: #E2E8F0;
    --text-dim: #6B7280;
    --success: #22C55E;
    --warn: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --font: 'JetBrains Mono', monospace;
}

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

/* Simulated git prompt bar */
.git-prompt {
    background: #0d0d0d;
    padding: 0.5rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.72rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gp-user {
    color: var(--primary);
}

.gp-branch {
    color: #F59E0B;
}

.gp-arrow {
    color: #6B7280;
}

header {
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.logo h1 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
}

.logo p {
    font-size: 0.62rem;
    color: var(--text-dim);
}

.header-actions {
    display: flex;
    gap: 0.4rem;
}

.btn {
    padding: 0.35rem 0.75rem;
    border-radius: 5px;
    border: none;
    font-family: var(--font);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
}

.btn-primary {
    background: var(--primary);
    color: #000;
}

.btn-primary:hover {
    background: var(--accent);
}

.btn-secondary {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Layout */
.app-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    flex: 1;
    height: calc(100vh - 106px);
    overflow: hidden;
}

.panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.left-panel {
    border-right: 1px solid var(--border);
    background: var(--surface);
}

.panel-section {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--border);
}

.section-label {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.4rem;
}

textarea {
    width: 100%;
    height: 130px;
    background: #050505;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: #86EFAC;
    font-family: var(--font);
    font-size: 0.73rem;
    padding: 0.6rem;
    resize: none;
    outline: none;
    line-height: 1.6;
    transition: border-color 0.2s;
}

textarea:focus {
    border-color: var(--primary);
}

/* Score input */
.score-row {
    display: flex;
    gap: 0.4rem;
}

.score-input {
    flex: 1;
    background: #050505;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.73rem;
    padding: 0.4rem 0.6rem;
    outline: none;
    transition: border-color 0.2s;
}

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

/* Type picker */
.type-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.type-btn {
    padding: 0.25rem 0.2rem;
    border-radius: 4px;
    font-family: var(--font);
    font-size: 0.62rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text-dim);
    text-align: center;
    transition: all 0.15s;
}

.type-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
}

.type-btn:hover:not(.active) {
    background: rgba(34, 197, 94, 0.1);
    color: var(--primary);
    border-color: rgba(34, 197, 94, 0.3);
}

/* Right Panel */
.right-panel {
    overflow-y: auto;
    padding: 1rem;
}

/* Suggestions */
.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.suggestion-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.6rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    transition: all 0.18s;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.suggestion-card:hover {
    border-color: var(--primary);
    background: rgba(34, 197, 94, 0.06);
}

.sg-num {
    font-size: 0.65rem;
    color: var(--primary);
    font-weight: 700;
    flex-shrink: 0;
    width: 18px;
}

.sg-text {
    flex: 1;
    font-size: 0.78rem;
    color: var(--accent);
    line-height: 1.4;
}

.sg-copy {
    font-size: 0.65rem;
    color: var(--text-dim);
    opacity: 0;
    transition: opacity 0.15s;
}

.suggestion-card:hover .sg-copy {
    opacity: 1;
}

/* Score display */
.score-display {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.25rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.score-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.score-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 3px solid;
}

.score-A {
    border-color: var(--success);
    color: var(--success);
}

.score-B {
    border-color: #F59E0B;
    color: #F59E0B;
}

.score-C {
    border-color: #F97316;
    color: #F97316;
}

.score-D,
.score-F {
    border-color: var(--danger);
    color: var(--danger);
}

.score-num {
    font-size: 1rem;
}

.score-grade {
    font-size: 0.65rem;
}

.score-label {
    font-size: 0.78rem;
    color: var(--text-dim);
}

.feedback-list {
    list-style: none;
}

.feedback-list li {
    font-size: 0.74rem;
    line-height: 1.6;
    padding: 0.2rem 0;
}

/* Reference panel */
.reference-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem;
    margin-bottom: 1.25rem;
}

.ref-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.ref-table {
    width: 100%;
    border-collapse: collapse;
}

.ref-table td {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ref-table td:first-child {
    color: var(--primary);
    font-weight: 700;
    width: 80px;
}

.ref-table td:last-child {
    color: var(--text-dim);
}

/* History */
.history-list {
    list-style: none;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem;
    border-radius: 4px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: background 0.15s;
}

.history-item:hover {
    background: var(--surface2);
}

.hist-grade {
    font-weight: 700;
    font-size: 0.65rem;
    width: 24px;
    text-align: center;
    border-radius: 3px;
    padding: 0.1rem 0;
}

.hist-text {
    flex: 1;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-panel {
    text-align: center;
    color: var(--text-dim);
    padding: 3rem 2rem;
    font-size: 0.8rem;
}

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

::-webkit-scrollbar-track {
    background: var(--surface);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

@media (max-width: 700px) {
    .app-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .left-panel {
        border-right: none;
        border-bottom: 1px solid var(--border);
        height: 300px;
    }

    .right-panel {
        overflow-y: auto;
    }
}