/* Sentient Brewer — Where Software Gets Brewed */
/* Sentient Bean / Created By Will */

:root {
    --bg: #1a1205;
    --bg-panel: #28200f;
    --bg-terminal: #120e04;
    --accent: #a89880;
    --accent-glow: #c8baa4;
    --accent-dim: #8a7a64;
    --accent-dark: #3c3020;
    --brass: #b0a088;
    --brass-glow: #d4c4a8;
    --copper: #907860;
    --green: #7ab648;
    --green-dim: #4a7a2a;
    --red: #d45a4a;
    --yellow: #d4a828;
    --blue: #7aaad4;
    --text: #e8ddd0;
    --text-dim: #a09585;
    --border: #3c3020;
    --font-mono: 'Courier New', 'Consolas', monospace;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-glow); }

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

/* Hero / Landing */
.hero {
    text-align: center;
    padding: 80px 20px 40px;
}

.logo, .logo-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.logo-sm { justify-content: flex-start; }

.gear {
    font-size: 2rem;
    color: var(--accent);
    animation: spin 10s linear infinite;
}

.logo-sm .gear { font-size: 1.4rem; }

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.logo h1, .logo-sm a {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 2px;
}

.logo-sm a { font-size: 1.4rem; }

.accent { color: var(--accent); }

.tagline {
    margin-top: 12px;
    color: var(--text-dim);
    font-size: 1.1rem;
}

/* Panels */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 30px;
    max-width: 420px;
    margin: 0 auto;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 14px;
    padding: 10px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab.active, .tab:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Forms */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

input, textarea, select {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(196, 136, 74, 0.25);
}

textarea { resize: vertical; }

/* Buttons */
.btn {
    font-family: var(--font-mono);
    font-size: 14px;
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    background: var(--bg);
    color: var(--text);
    transition: all 0.2s;
}

.btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-primary {
    background: #c8baaa;
    color: #1a1205;
    border-color: #b8a898;
    font-weight: 700;
}

.btn-primary:hover {
    background: #d4c4b0;
    color: #1a1205;
    box-shadow: 0 0 16px rgba(240, 230, 216, 0.2);
}

.btn-sm { padding: 6px 14px; font-size: 12px; }

/* Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-dim);
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.dashboard-header h2 { color: var(--accent); }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.project-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.project-card:hover { border-color: var(--accent-dim); box-shadow: 0 0 12px rgba(196, 136, 74, 0.15); }

.project-card h4 { color: var(--text); margin-bottom: 8px; }
.project-card .goal { color: var(--text-dim); font-size: 12px; margin-bottom: 12px; }
.project-card .meta { display: flex; justify-content: space-between; align-items: center; }

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge-pending { background: var(--text-dim); color: var(--bg); }
.badge-planning { background: var(--blue); color: var(--bg); }
.badge-building { background: var(--yellow); color: var(--bg); }
.badge-reviewing { background: var(--copper); color: var(--bg); }
.badge-testing { background: var(--blue); color: var(--bg); }
.badge-complete { background: var(--green); color: var(--bg); }
.badge-failed { background: var(--red); color: var(--bg); }

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-content {
    max-width: 520px;
    width: 90%;
}

.modal-content h3 { margin-bottom: 16px; color: var(--accent); }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

/* Project View — Split Panel */
.project-layout { max-width: 1400px; }

.split-panel {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
    min-height: calc(100vh - 120px);
}

.panel-left, .panel-right {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
}

.panel-left h3, .panel-right h3 {
    color: var(--accent);
    margin-bottom: 16px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Progress Bar */
.progress-bar {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    height: 28px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-dark), var(--accent));
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}
.progress-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text);
    letter-spacing: 1px;
}

.panel-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Task List */
.task-list { display: flex; flex-direction: column; gap: 8px; }

.task-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
}

.task-item .agent-tag {
    background: var(--border);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    text-transform: uppercase;
    white-space: nowrap;
}

.task-item .task-desc { color: var(--text-dim); flex: 1; }

.task-item.complete { border-color: var(--green-dim); }
.task-item.complete .task-desc { color: var(--green); }
.task-item.in_progress { border-color: var(--yellow); }
.task-item.failed { border-color: var(--red); }

/* Terminal */
.terminal {
    background: var(--bg-terminal);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 16px;
    height: calc(100vh - 220px);
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.8;
}

.terminal-line {
    padding: 2px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    word-wrap: break-word;
}

.terminal-line .agent-label {
    color: var(--accent);
    font-weight: 700;
}

.terminal-line .status-ok { color: var(--green); }
.terminal-line .status-err { color: var(--red); }
.terminal-line .status-info { color: var(--blue); }
.terminal-line.dim { color: var(--text-dim); }

.blink { animation: blink 1s step-end infinite; }
@keyframes blink {
    50% { opacity: 0; }
}

/* Error */
.error {
    background: rgba(201, 74, 58, 0.08);
    border: 1px solid var(--red);
    color: var(--red);
    padding: 10px 14px;
    border-radius: 4px;
    margin-top: 12px;
    font-size: 12px;
}

/* Animated Coffee Background */
.coffee-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

/* Cup — positioned bottom-right, steam is inside it */
.coffee-bg .cup {
    position: absolute;
    bottom: -10px;
    right: 8%;
    width: 200px;
    height: 500px;
    overflow: hidden;
}

.coffee-bg .cup-body {
    width: 150px;
    height: 120px;
    background: var(--accent);
    border-radius: 0 0 45px 45px;
    position: absolute;
    bottom: 0;
    left: 0;
    opacity: 0.07;
}

.coffee-bg .cup-handle {
    width: 44px;
    height: 65px;
    border: 7px solid var(--accent);
    border-left: none;
    border-radius: 0 32px 32px 0;
    position: absolute;
    right: 6px;
    bottom: 30px;
    opacity: 0.07;
}

.coffee-bg .cup-rim {
    width: 170px;
    height: 16px;
    background: var(--accent);
    border-radius: 8px 8px 0 0;
    position: absolute;
    bottom: 120px;
    left: -10px;
    opacity: 0.07;
}

/* Wispy steam rising from the cup */
.coffee-bg .steam {
    position: absolute;
    bottom: 140px;
    opacity: 0;
    filter: blur(6px);
}

.coffee-bg .steam::before,
.coffee-bg .steam::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(200, 184, 160, 0.5) 0%, rgba(200, 184, 160, 0) 70%);
}

.coffee-bg .steam::before {
    width: 100%;
    height: 60%;
    top: 0;
    left: 0;
}

.coffee-bg .steam::after {
    width: 70%;
    height: 50%;
    bottom: 0;
    right: 0;
}

.coffee-bg .steam:nth-child(1) {
    left: 15px;
    width: 40px;
    height: 140px;
    animation: wisp-1 5s ease-in-out infinite;
    animation-delay: 0s;
}

.coffee-bg .steam:nth-child(2) {
    left: 50px;
    width: 50px;
    height: 160px;
    animation: wisp-2 6s ease-in-out infinite;
    animation-delay: 1s;
}

.coffee-bg .steam:nth-child(3) {
    left: 85px;
    width: 35px;
    height: 130px;
    animation: wisp-3 5.5s ease-in-out infinite;
    animation-delay: 2.2s;
}

.coffee-bg .steam:nth-child(4) {
    left: 30px;
    width: 45px;
    height: 150px;
    animation: wisp-2 6.5s ease-in-out infinite;
    animation-delay: 3.4s;
}

.coffee-bg .steam:nth-child(5) {
    left: 65px;
    width: 38px;
    height: 120px;
    animation: wisp-1 5.8s ease-in-out infinite;
    animation-delay: 0.7s;
}

@keyframes wisp-1 {
    0%   { opacity: 0;    transform: translateY(0)     translateX(0)    scaleX(0.5) scaleY(0.3); }
    8%   { opacity: 0.3; }
    25%  { opacity: 0.25; transform: translateY(-50px)  translateX(12px)  scaleX(0.8) scaleY(0.6); }
    50%  { opacity: 0.15; transform: translateY(-120px) translateX(-8px)  scaleX(1.4) scaleY(1);   }
    75%  { opacity: 0.06; transform: translateY(-200px) translateX(15px)  scaleX(2)   scaleY(1.2); }
    100% { opacity: 0;    transform: translateY(-280px) translateX(5px)   scaleX(2.5) scaleY(1.5); }
}

@keyframes wisp-2 {
    0%   { opacity: 0;    transform: translateY(0)     translateX(0)     scaleX(0.4) scaleY(0.3); }
    8%   { opacity: 0.28; }
    25%  { opacity: 0.22; transform: translateY(-60px)  translateX(-14px) scaleX(0.9) scaleY(0.7); }
    50%  { opacity: 0.12; transform: translateY(-140px) translateX(10px)  scaleX(1.5) scaleY(1);   }
    75%  { opacity: 0.05; transform: translateY(-220px) translateX(-12px) scaleX(2.2) scaleY(1.3); }
    100% { opacity: 0;    transform: translateY(-300px) translateX(-3px)  scaleX(2.8) scaleY(1.6); }
}

@keyframes wisp-3 {
    0%   { opacity: 0;    transform: translateY(0)     translateX(0)    scaleX(0.5) scaleY(0.4); }
    8%   { opacity: 0.32; }
    25%  { opacity: 0.2;  transform: translateY(-45px)  translateX(10px)  scaleX(1)   scaleY(0.7); }
    50%  { opacity: 0.1;  transform: translateY(-110px) translateX(-15px) scaleX(1.6) scaleY(1.1); }
    75%  { opacity: 0.04; transform: translateY(-180px) translateX(8px)   scaleX(2.1) scaleY(1.4); }
    100% { opacity: 0;    transform: translateY(-260px) translateX(-5px)  scaleX(2.6) scaleY(1.5); }
}

/* Floating coffee beans background */
.coffee-bg .bean {
    position: absolute;
    width: 20px;
    height: 28px;
    opacity: 0;
    animation: bean-float linear infinite;
    animation-fill-mode: forwards;
}

.coffee-bg .bean::before,
.coffee-bg .bean::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 28px;
    background: #8a7a68;
    border-radius: 50%;
}

.coffee-bg .bean::before {
    left: 0;
}

.coffee-bg .bean::after {
    left: 8px;
}

.coffee-bg .bean:nth-child(6) { left: 5%; animation-duration: 12s; animation-delay: 6s; }
.coffee-bg .bean:nth-child(7) { left: 15%; animation-duration: 15s; animation-delay: 2s; }
.coffee-bg .bean:nth-child(8) { left: 30%; animation-duration: 11s; animation-delay: 4s; }
.coffee-bg .bean:nth-child(9) { left: 50%; animation-duration: 14s; animation-delay: 1s; }
.coffee-bg .bean:nth-child(10) { left: 70%; animation-duration: 13s; animation-delay: 3s; }
.coffee-bg .bean:nth-child(11) { left: 85%; animation-duration: 16s; animation-delay: 0.5s; }
.coffee-bg .bean:nth-child(12) { left: 40%; animation-duration: 12s; animation-delay: 5s; }
.coffee-bg .bean:nth-child(13) { left: 60%; animation-duration: 14s; animation-delay: 2.5s; }

@keyframes bean-float {
    0% {
        transform: translateY(-10vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.1;
    }
    90% {
        opacity: 0.1;
    }
    100% {
        transform: translateY(110vh) rotate(360deg);
        opacity: 0;
    }
}

/* Utility */
.hidden { display: none !important; }
.loading { color: var(--text-dim); text-align: center; padding: 40px; }

/* Footer */
footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
    font-size: 12px;
}

/* Action buttons bar — always visible */
.mobile-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    grid-column: 1 / -1;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    width: 100%;
    background: var(--accent-dark);
    border: 2px solid var(--accent-dim);
    border-radius: 6px;
    color: var(--accent-glow);
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    padding: 12px 16px;
    cursor: pointer;
    margin-bottom: 8px;
    text-align: left;
    letter-spacing: 1px;
}

.mobile-menu-toggle::after {
    content: ' ▾ Show Recipe';
    float: right;
    font-weight: 400;
    font-size: 12px;
}

.mobile-menu-toggle.open::after {
    content: ' ▴ Hide Recipe';
}

.mobile-menu-toggle.open {
    border-color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .split-panel {
        grid-template-columns: 1fr;
    }

    .mobile-menu-toggle {
        display: block;
        order: 3;
    }

    .mobile-actions {
        padding: 8px;
        order: 1;
    }

    #update-panel, #fork-panel {
        order: 2;
    }

    .panel-left {
        order: 4;
        max-height: 60vh;
        overflow-y: auto;
    }

    .panel-left.collapsed {
        display: none !important;
    }

    .panel-right {
        order: 5;
    }

    .terminal { height: 400px; }
    .projects-grid { grid-template-columns: 1fr; }

    .topbar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .user-info {
        flex-wrap: wrap;
        gap: 6px;
        font-size: 12px;
    }
}
