/* eddieisagoodboy.com — Main stylesheet */

:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface-hover: #222633;
    --border: #2a2e3a;
    --text: #e4e4e7;
    --text-muted: #9ca3af;
    --accent: #f59e0b;
    --accent-glow: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --success: #22c55e;
    --warm: #f59e0b;
    --cool: #3b82f6;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --mono: "SF Mono", "Fira Code", monospace;
    --radius: 12px;
}

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

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

/* Layout */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.02em;
}
.nav-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.not-stamp {
    display: inline-block;
    color: #ee2222;
    font-weight: 900;
    font-style: italic;
    font-size: 1rem;
    transform: rotate(-4deg);
    text-decoration: underline;
    text-decoration-color: #ee2222;
    text-decoration-thickness: 2px;
    margin: 0 0.15rem;
    letter-spacing: 0.02em;
}
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-refresh {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem;
    border-radius: 6px;
    transition: all 0.2s;
}
.nav-refresh:hover { color: var(--accent); background: var(--surface-hover); }

/* Footer */
.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 1.5rem;
}

/* Hero section */
.hero {
    text-align: center;
    padding: 1rem 0 0.5rem;
}

/* Window viewport — aspect ratio matches video (816:1104 ≈ 0.739) */
.window-viewport {
    position: relative;
    width: 280px;
    aspect-ratio: 816 / 1104;
    margin: 0 auto 0.6rem;
    overflow: hidden;
}
.eddie-video {
    position: absolute;
    /* Inset to sit inside the window frame borders */
    top: 5.5%;
    left: 6.5%;
    width: 87%;
    height: 90%;
    object-fit: cover;
    z-index: 1;
}
.window-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    display: block;
}
.glass-reflection {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0.06) 0%,
        rgba(255,255,255,0) 40%,
        rgba(255,255,255,0) 60%,
        rgba(255,255,255,0.03) 100%
    );
}
/* Hero buttons row */
.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}
.btn-refresh {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
}
.btn-refresh:hover { border-color: var(--accent); color: var(--accent); }

/* Legacy SVG fallback */
.eddie-image-container {
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
}
.eddie-svg {
    width: 100%;
    height: 100%;
}
.hero-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    letter-spacing: -0.03em;
}
.hero-title em {
    color: var(--danger);
    font-style: italic;
}
.assessment {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
    margin: 1rem 0;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    transition: border-color 0.2s;
}
.stat-card:hover {
    border-color: var(--accent);
    background: var(--surface-hover);
}
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--mono);
}
.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.stat-callout {
    font-size: 0.75rem;
    color: var(--accent);
    margin-top: 0.3rem;
    font-family: var(--mono);
    opacity: 0.8;
}

/* Chart */
.chart-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1rem 0;
}
.chart-section h2 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 500;
}
.hourly-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    padding-bottom: 24px;
    position: relative;
}
.bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}
.bar {
    width: 100%;
    min-height: 2px;
    border-radius: 3px 3px 0 0;
    transition: height 0.5s ease;
}
.bar-hot { background: var(--danger); }
.bar-warm { background: var(--warm); }
.bar-cool { background: var(--cool); opacity: 0.5; }
.bar-value {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-family: var(--mono);
    margin-bottom: 2px;
}
.bar-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-family: var(--mono);
}

/* Dashboard */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.dashboard-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}
.date-picker input {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.9rem;
    cursor: pointer;
}
.date-picker input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Episodes table */
.episodes-section {
    margin-top: 2rem;
}
.episodes-section h2 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 500;
}
.table-wrapper {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.episodes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.episodes-table th {
    text-align: left;
    padding: 0.8rem 1rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}
.episodes-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
}
.episodes-table tbody tr:last-child td { border-bottom: none; }
.episodes-table tbody tr:hover { background: var(--surface-hover); }
.row-dismissed { opacity: 0.4; }
.row-unconfirmed { opacity: 0.6; }
.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem !important;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-bark { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.badge-howl { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.badge-yip { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-whimper { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.badge-growl { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.badge-not-bark { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.badge-unconfirmed { background: rgba(156, 163, 175, 0.15); color: #9ca3af; }

/* Login */
.login-container {
    max-width: 360px;
    margin: 4rem auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}
.login-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.form-group input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: var(--font);
}
.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}
.btn-login {
    width: 100%;
    padding: 0.7rem;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: opacity 0.2s;
}
.btn-login:hover { opacity: 0.9; }
.error-msg {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* Section labels */
.section-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 1rem;
    margin-bottom: -0.5rem;
    padding-left: 0.2rem;
}

/* Random bark button */
.btn-clip {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
}
.btn-clip:hover { border-color: var(--accent); color: var(--accent); }
.btn-clip:disabled { opacity: 0.5; cursor: default; }

/* Daily chart */
.daily-chart .bar-label { font-size: 0.55rem; }

/* Dashboard nav */
.dashboard-nav {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.btn-config {
    padding: 0.45rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.btn-config:hover { border-color: var(--accent); color: var(--text); }

/* Media links in episodes table */
.media-links {
    display: inline-flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    vertical-align: middle;
}
.media-links a {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent);
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    transition: background 0.2s;
}
.media-links a:hover { background: rgba(245, 158, 11, 0.25); }

/* Config page */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.config-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
}
.config-section h3 {
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.config-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}
.config-row:last-child { border-bottom: none; }
.config-key {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.config-val {
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 500;
}
.config-val.mono { font-family: var(--mono); font-size: 0.75rem; }
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.4rem;
}
.status-on { background: var(--success); }
.status-off { background: var(--danger); }
.config-note {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
    margin-top: 1.5rem;
}
.status-warn { background: var(--warm); }

/* Health progress bars */
.health-bar-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    margin-top: 1rem;
}
.health-bar-section h3 {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.progress-bar-container {
    background: var(--bg);
    border-radius: 6px;
    height: 28px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bg);
    transition: width 0.5s ease;
    min-width: 40px;
}
.bar-good { background: var(--success); }
.bar-warn { background: var(--warm); }
.bar-bad { background: var(--danger); }

/* Logs */
.log-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.log-filters select,
.log-search {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.85rem;
}
.log-search { flex: 1; min-width: 150px; }
.log-filters select:focus,
.log-search:focus { outline: none; border-color: var(--accent); }
.log-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.log-count {
    padding: 0.6rem 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.log-output {
    height: 60vh;
    overflow-y: auto;
    padding: 0.5rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    line-height: 1.5;
}
.log-line {
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    white-space: pre-wrap;
    word-break: break-all;
}
.log-line:hover { background: var(--surface-hover); }
.log-error { color: var(--danger); }
.log-warn { color: var(--warm); }
.log-debug { color: var(--text-muted); opacity: 0.6; }
.log-empty { color: var(--text-muted); text-align: center; padding: 2rem; }

/* Mobile media popup */
.media-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.media-popup-overlay.active { display: flex; }
.media-popup {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    padding: 1.5rem;
    width: 100%;
    max-width: 400px;
    animation: popup-slide 0.2s ease-out;
}
@keyframes popup-slide {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.media-popup-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text);
}
.media-popup-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.popup-btn {
    display: block;
    padding: 0.8rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.15s;
}
.popup-btn:active { background: var(--surface-hover); border-color: var(--accent); }
.popup-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 1rem;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 600px) {
    .container { padding: 1rem; }
    .navbar { padding: 0.8rem 1rem; }
    .hero-title { font-size: 1.3rem; }
    .stat-value { font-size: 1.5rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .window-viewport { width: 220px; }
    .dashboard-header {
        flex-direction: column;
        gap: 0.8rem;
        align-items: flex-start;
    }
    .hide-mobile { display: none; }
    .media-col { display: none; }
    .ep-row[data-audio], .ep-row[data-video], .ep-row[data-live], .ep-row[data-snap] {
        cursor: pointer;
    }
    .ep-row:active { background: var(--surface-hover); }
}
