* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    background: #fafafa;
    color: #1a1a1a;
}

.navbar {
    background: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #f0f0f0;
}

.navbar-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
    gap: 40px;
}

.navbar-brand {
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-logo {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.poolie-text {
    display: inline-flex;
    align-items: center;
    position: relative;
    min-width: fit-content;
}

.action-word {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    white-space: nowrap;
    font-weight: 600;
    color: #1a1a1a;
    pointer-events: none;
}

.with-poolie {
    display: inline-block;
    transition: opacity 0.3s ease-in-out;
    white-space: nowrap;
}

.navbar-brand:hover .action-word {
    opacity: 1;
}

.navbar-brand:hover .with-poolie {
    opacity: 0;
}

.navbar-brand:hover { opacity: 1; }

.navbar-links {
    display: flex;
    gap: 24px;
}

.navbar a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.navbar a:hover { color: #1a1a1a; }
.navbar a.icon { display: none; }

@media (max-width: 600px) {
    .navbar-links a:not(.icon) { display: none; }
    .navbar a.icon { display: flex; cursor: pointer; font-size: 18px; }
    .navbar.responsive .navbar-links {
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: white;
        border-bottom: 1px solid #f0f0f0;
        gap: 0;
    }
    .navbar.responsive .navbar-links a:not(.icon) {
        display: flex;
        padding: 12px 20px;
        border-bottom: 1px solid #f0f0f0;
    }
}

.container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 20px
}

.page-header {
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px 0;
}

.page-header p {
    font-size: 14px;
    color: #999;
    margin: 0;
}

.main-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 12px;
}

.input-section {
    background: white;
    padding: 24px;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.input-section h2 {
    font-size: 16px;
    margin: 0;
}

.input-section p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

input {
    padding: 10px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
    outline: none;
    border-color: #999;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

input::placeholder { color: #ccc; }

.action-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

button {
    background: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

button:hover { background: #333; }
button:disabled { background: #ccc; cursor: not-allowed; }

.loading {
    display: inline-flex;
    align-items: center;
    color: #666;
    font-size: 13px;
    gap: 8px;
}

#output {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 20px;
}

#output h2 {
    font-size: 11px;
    font-weight: 600;
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
}

.term {
    background: #1a1a1a;
    color: #e0e0e0;
    border-radius: 4px;
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    flex: 1;
    max-height: 500px;
    overflow-y: auto;
    width: 100%;
}

.term pre { margin: 0; white-space: pre-wrap; }
.term .stdout { color: #a8e6a1; }
.term .stderr { color: #ff8080; }
.term .meta { color: #888; font-size: 11px; }

.right-column {
    background: white;
    padding: 24px;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
    height: fit-content;
}

.right-column h2 {
    font-size: 11px;
    font-weight: 600;
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
}

@media (max-width: 900px) {
    .main-layout { grid-template-columns: 1fr; }
    .right-column { max-height: 400px; overflow-y: auto; }
}

/* Git Tree Styling */
.git-tree {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    font-size: 13px;
    line-height: 1.6;
    color: #666;
}

.git-tree ul {
    margin: 0 0 0 0.8em;
    padding: 0;
    list-style: none;
    position: relative;
}

.git-tree > ul:first-of-type {
    margin: 0;
}

.git-tree ul:before {
    content: "";
    display: block;
    width: 0px;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0px;
    border-left: 1px solid #e5e5e5;
    z-index: -1;
}

.git-tree > ul:before {
    border-left: none;
}

.git-tree li.root-highlight {
    padding-left: 0;
}

.git-tree li.root-highlight:before {
    border: 0;
    background: none !important;
}

.git-tree li {
    margin: 0;
    padding: 0 0 0 0.8em;
    position: relative;
    z-index: 0;
    line-height: 1.6;
}

.git-tree li:before {
    content: "";
    display: block;
    position: absolute;
    top: 0.75em;
    left: 0px;
    width: 8px;
    border-top: 1px solid #e5e5e5;
}

.git-tree li:last-child:before {
    height: auto;
    bottom: 0;
    background: white;
}

.git-tree > li:before {
    border-top: none;
}

.git-tree li span.name {
    display: inline-block;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    color: #1a1a1a;
}

.git-tree li span.name:hover {
    color: #606060;
}

.git-tree li span.meta {
    color: #aaa;
    font-size: 12px;
    padding-left: 6px;
    font-style: normal;
    font-weight: 400;
}

.git-tree li:has(.current) > span.name,
.git-tree li.current > span.name {
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: underline;
}

.git-tree li.root-highlight span.name {
    padding: 0;
    font-size: 13px;
    font-weight: 600;
}

#meta-info {
    padding: 6px;
    font-size: 10px;
    text-align: right;
}

#meta-info a {
    color: inherit;
}

/* Custom Tooltip */
.tooltip-trigger {
    position: relative;
    cursor: help;
}

.tooltip-trigger:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 1;
    visibility: visible;
    transition: none;
}

.tooltip-trigger:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1000;
    opacity: 1;
    visibility: visible;
    transition: none;
}