/* ============================================================
   dangabug — Dark Theme Stylesheet
   ============================================================ */

:root {
    --bg:         #1a1a2e;
    --bg-alt:     #16213e;
    --card:       #1f2940;
    --card-hover: #263352;
    --fg:         #e0e0e0;
    --fg-muted:   #8892a4;
    --accent:     #4fc3f7;
    --accent-hover: #29b6f6;
    --border:     #2d3a54;
    --red:        #ef5350;
    --red-bg:     #3e1a1a;
    --orange:     #ffa726;
    --orange-bg:  #3e2c1a;
    --yellow:     #ffee58;
    --yellow-bg:  #3e3a1a;
    --green:      #66bb6a;
    --green-bg:   #1a3e1f;
    --blue:       #42a5f5;
    --blue-bg:    #1a2d3e;
    --gray:       #78909c;
    --gray-bg:    #2a2f36;
    --radius:     8px;
    --radius-sm:  4px;
}

/* ============================================================
   Reset & Base
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
}
a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ============================================================
   Navbar
   ============================================================ */

.navbar {
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--fg);
    text-decoration: none;
}
.nav-brand:hover {
    color: var(--accent);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--fg);
    font-size: 1.4rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-links a {
    color: var(--fg-muted);
    font-size: 0.9rem;
}
.nav-links a:hover {
    color: var(--fg);
    text-decoration: none;
}

.nav-user {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ============================================================
   Container
   ============================================================ */

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* ============================================================
   Page Header
   ============================================================ */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h1 {
    font-size: 1.5rem;
}

/* ============================================================
   Filter Tabs
   ============================================================ */

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    background: var(--card);
    color: var(--fg-muted);
    border: 1px solid var(--border);
    transition: all 0.15s;
}
.filter-tab:hover {
    color: var(--fg);
    background: var(--card-hover);
    text-decoration: none;
}
.filter-tab.active {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    font-weight: 600;
}

/* ============================================================
   Bug Cards (List)
   ============================================================ */

.bug-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bug-card {
    display: block;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    transition: background 0.15s, border-color 0.15s;
    color: var(--fg);
    text-decoration: none;
}
.bug-card:hover {
    background: var(--card-hover);
    border-color: var(--accent);
    text-decoration: none;
    color: var(--fg);
}

.bug-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.bug-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.bug-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.82rem;
    color: var(--fg-muted);
    flex-wrap: wrap;
}

.bug-id {
    color: var(--fg-muted);
    font-size: 0.8rem;
    font-weight: 500;
}

.bug-votes {
    font-weight: 600;
    color: var(--accent);
}

.bug-comments {
    color: var(--fg-muted);
}

/* ============================================================
   Badges
   ============================================================ */

.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Priority badges */
.badge-priority-critical { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red); }
.badge-priority-high     { background: var(--orange-bg); color: var(--orange); border: 1px solid var(--orange); }
.badge-priority-medium   { background: var(--yellow-bg); color: var(--yellow); border: 1px solid var(--yellow); }
.badge-priority-low      { background: var(--gray-bg);   color: var(--gray);   border: 1px solid var(--gray); }

/* Status badges */
.badge-status-open        { background: var(--blue-bg);   color: var(--blue);   border: 1px solid var(--blue); }
.badge-status-in_progress { background: var(--orange-bg); color: var(--orange); border: 1px solid var(--orange); }
.badge-status-fixed       { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green); }
.badge-status-closed      { background: var(--gray-bg);   color: var(--gray);   border: 1px solid var(--gray); }
.badge-status-wontfix     { background: var(--gray-bg);   color: var(--gray);   border: 1px solid var(--gray); }

/* Admin badge */
.badge-admin {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid var(--red);
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
}

/* ============================================================
   Bug Detail
   ============================================================ */

.bug-detail {
    margin-bottom: 2rem;
}

.bug-detail-header {
    margin-bottom: 1.25rem;
}

.bug-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.bug-detail-header h1 {
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
}

.bug-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--fg-muted);
    flex-wrap: wrap;
}

.bug-description {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.bug-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* ============================================================
   Vote Button
   ============================================================ */

.vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--fg-muted);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.15s;
}
.vote-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.vote-btn.voted {
    background: var(--blue-bg);
    border-color: var(--accent);
    color: var(--accent);
}

/* ============================================================
   Admin Panel
   ============================================================ */

.admin-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.admin-panel h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--red);
}

.admin-status-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.admin-status-form label {
    font-size: 0.85rem;
    color: var(--fg-muted);
}

/* ============================================================
   Comments
   ============================================================ */

.comments-section h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.comment-card {
    background: var(--card);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 0.85rem 1rem;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}

.comment-date {
    color: var(--fg-muted);
    font-size: 0.8rem;
}

.comment-text {
    line-height: 1.6;
    word-wrap: break-word;
}

.comment-form {
    margin-top: 1rem;
}

.comment-form label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

/* ============================================================
   Forms
   ============================================================ */

.auth-form,
.form-page {
    max-width: 480px;
    margin: 2rem auto;
}

.auth-form h1,
.form-page h1 {
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--fg);
}

input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
    display: block;
    width: 100%;
    padding: 0.6rem 0.85rem;
    margin-bottom: 1rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--fg);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s;
}
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

small {
    display: block;
    margin-top: -0.75rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--fg-muted);
}

.auth-link {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--fg-muted);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--bg);
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}
.btn-outline:hover {
    background: var(--accent);
    color: var(--bg);
    text-decoration: none;
}

.btn-danger {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}
.btn-danger:hover {
    opacity: 0.85;
    text-decoration: none;
}

/* ============================================================
   Alerts
   ============================================================ */

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border: 1px solid;
}
.alert-success {
    background: var(--green-bg);
    color: var(--green);
    border-color: var(--green);
}
.alert-error {
    background: var(--red-bg);
    color: var(--red);
    border-color: var(--red);
}

/* ============================================================
   Pagination
   ============================================================ */

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ============================================================
   Empty State
   ============================================================ */

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--fg-muted);
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--fg-muted);
    border-top: 1px solid var(--border);
}
.footer-links {
    margin-top: 0.4rem;
}
.footer-links a {
    color: var(--fg-muted);
    text-decoration: none;
}
.footer-links a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 600px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
        padding-top: 0.5rem;
    }
    .nav-links.open {
        display: flex;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-status-form {
        flex-direction: column;
        align-items: flex-start;
    }

    .bug-card-meta {
        gap: 0.5rem;
    }
}
