/* =========================================================================
   PrimentumFR — Feature Request Tracker
   The Enterprise Software Replacement Company | Primentum Suite
   ========================================================================= */

:root {
    --bg-color: #0b0f1a;
    --bg-surface: #111827;
    --text-primary: #f1f5f9;
    --text-secondary: #8b97b0;
    --text-muted: #64748b;

    /* ESRC Brand Accent — Warm orange/coral from FR icon */
    --accent: #f97316;
    --accent-hover: #ea580c;
    --accent-glow: rgba(249, 115, 22, 0.25);
    --accent-soft: rgba(249, 115, 22, 0.08);

    /* Secondary accent (blue, used sparingly) */
    --accent-blue: #3b82f6;
    --accent-teal: #14b8a6;

    /* Glass */
    --glass-bg: rgba(17, 24, 39, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.14);

    /* Status Badges */
    --badge-triage: #64748b;
    --badge-planned: #eab308;
    --badge-inprogress: #3b82f6;
    --badge-completed: #22c55e;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-med: 0.25s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(249, 115, 22, 0.08), transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(20, 184, 166, 0.06), transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Utilities ─────────────────────────────────────────────── */
.hidden { display: none !important; }

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}

/* ── ESRC Top Bar ──────────────────────────────────────────── */
.brand-topbar {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 24px;
    height: 42px;
    display: flex;
    align-items: center;
    z-index: 200;
    flex-shrink: 0;
}

.topbar-inner {
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: color var(--transition-fast);
}
.topbar-brand:hover { color: var(--text-primary); }

.topbar-logo-icon {
    font-size: 0.85rem;
    color: var(--accent);
}

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

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-module-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(249, 115, 22, 0.2);
    padding: 3px 10px;
    border-radius: var(--radius-xl);
}

.topbar-suite-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.topbar-suite-link:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

/* ── Typography & Badges ───────────────────────────────────── */
h1 {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}
h1 i { color: var(--accent); font-size: 1.4rem; }

h2 {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
}

h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
}

p { color: var(--text-secondary); line-height: 1.6; }

.badge {
    padding: 4px 10px;
    border-radius: var(--radius-xl);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge[data-status="Triage"] { background: var(--badge-triage); color: white; }
.badge[data-status="Planned"] { background: var(--badge-planned); color: #1a1a1a; }
.badge[data-status="In Progress"] { background: var(--badge-inprogress); color: white; }
.badge[data-status="Completed"] { background: var(--badge-completed); color: white; }

/* ── Buttons & Inputs ──────────────────────────────────────── */
button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--accent);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 24px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    padding: 10px 20px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-weight: 500;
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--glass-border-hover);
}

.btn-text {
    background: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-text:hover { color: var(--text-primary); }

input[type="text"], input[type="email"], select, textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.3);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-med), box-shadow var(--transition-med);
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

select {
    appearance: auto;
}

/* ── Layout ────────────────────────────────────────────────── */
#app-container {
    display: flex;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px;
    gap: 24px;
    flex: 1;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
    width: 260px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 82px);
    position: sticky;
    top: 62px;
    flex-shrink: 0;
}

.sidebar-brand {
    margin-bottom: 32px;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.logo-icon {
    font-size: 1.2rem;
    color: var(--accent);
}

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

.logo-subtitle {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-top: 4px;
    margin-left: 32px;
    font-weight: 500;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.nav-btn {
    background: transparent;
    color: var(--text-secondary);
    text-align: left;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-btn i { font-size: 0.9rem; width: 18px; text-align: center; }
.nav-btn:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.nav-btn.active {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(249, 115, 22, 0.15);
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-top: 1px solid var(--glass-border);
    padding-top: 16px;
}

.user-info {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 1px solid rgba(249, 115, 22, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 0.75rem;
}

.powered-by {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.6;
}

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
}

.view-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.view-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 2px;
}

/* ── Filters / Search ──────────────────────────────────────── */
.filters {
    display: flex;
    gap: 16px;
    padding: 14px 18px;
    margin-bottom: 24px;
    align-items: center;
}

.search-wrapper {
    position: relative;
    flex: 1;
}
.search-wrapper .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}
.search-wrapper input {
    padding-left: 38px;
}

.filters select {
    width: 180px;
    flex-shrink: 0;
}

/* ── Request Cards Grid ────────────────────────────────────── */
.requests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 18px;
}

.request-card {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform var(--transition-med), box-shadow var(--transition-med), border-color var(--transition-med);
    cursor: pointer;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    background: var(--glass-bg);
}
.request-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.35);
    border-color: var(--glass-border-hover);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}
.card-header h3 { font-size: 1.05rem; line-height: 1.35; }

.card-desc {
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.upvote-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    padding: 6px 14px;
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.85rem;
}
.upvote-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--glass-border-hover);
}
.upvote-btn.voted {
    background: var(--accent-soft);
    border-color: rgba(249, 115, 22, 0.3);
    color: var(--accent);
}

/* ── Overlays / Modals ─────────────────────────────────────── */
.overlay, .modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 300;
}

.auth-card {
    padding: 44px 40px;
    width: 420px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid var(--glass-border);
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.auth-brand-icon {
    font-size: 2.4rem;
    color: var(--accent);
    margin-bottom: 4px;
    filter: drop-shadow(0 0 16px var(--accent-glow));
}

.auth-brand h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    color: var(--text-primary);
}

.auth-tagline {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted) !important;
    font-weight: 500;
}

.auth-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--glass-border), transparent);
    margin: 4px 0;
}

.auth-footer-text {
    font-size: 0.72rem;
    color: var(--text-muted) !important;
    margin-top: 4px;
}

.admin-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.modal-content {
    width: 520px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
    border: 1px solid var(--glass-border);
}

.modal-content h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-content h2 i { color: var(--accent); }

.large-modal { width: 720px; max-height: 90vh; overflow-y: auto; }

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

.suggestions {
    font-size: 0.82rem;
    color: var(--accent);
    padding: 8px 12px;
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(249, 115, 22, 0.15);
}

/* ── Detail Modal ──────────────────────────────────────────── */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.btn-close {
    position: absolute;
    top: 18px; right: 18px;
    background: rgba(255,255,255,0.04);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-muted);
}
.btn-close:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }

.detail-desc {
    margin-top: 8px;
    font-size: 0.92rem;
    line-height: 1.6;
}

.comments-section {
    margin-top: 28px;
    border-top: 1px solid var(--glass-border);
    padding-top: 20px;
}
.comments-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.comments-section h3 i { color: var(--accent); font-size: 0.9rem; }

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
    max-height: 300px;
    overflow-y: auto;
}

.comment {
    background: rgba(0,0,0,0.25);
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.04);
}
.comment.internal {
    border-left: 3px solid var(--badge-planned);
    background: rgba(234, 179, 8, 0.04);
}
.comment-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.add-comment {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}
.comment-actions label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ── Admin List ────────────────────────────────────────────── */
.admin-list-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    padding: 14px 18px;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.admin-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}
.admin-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    align-items: center;
    padding: 16px 18px;
    transition: border-color var(--transition-fast);
}
.admin-row:hover {
    border-color: var(--glass-border-hover);
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .brand-topbar { padding: 0 12px; }
    .topbar-company { display: none; }

    #app-container {
        flex-direction: column;
        padding: 12px;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }
    .sidebar-brand { margin-bottom: 0; }
    .sidebar nav { flex-direction: row; }
    .sidebar-footer { flex-direction: row; align-items: center; border-top: none; padding-top: 0; }

    .requests-grid {
        grid-template-columns: 1fr;
    }
    .filters { flex-direction: column; }
    .filters select { width: 100%; }

    .auth-card { width: 90vw; padding: 30px 24px; }
    .modal-content { width: 90vw; }
    .large-modal { width: 95vw; }
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-card { animation: fadeInUp 0.4s ease-out; }
.modal-content { animation: fadeInUp 0.3s ease-out; }
.request-card { animation: fadeInUp 0.35s ease-out both; }

/* Stagger card animations */
.request-card:nth-child(1)  { animation-delay: 0.02s; }
.request-card:nth-child(2)  { animation-delay: 0.06s; }
.request-card:nth-child(3)  { animation-delay: 0.10s; }
.request-card:nth-child(4)  { animation-delay: 0.14s; }
.request-card:nth-child(5)  { animation-delay: 0.18s; }
.request-card:nth-child(6)  { animation-delay: 0.22s; }
.request-card:nth-child(7)  { animation-delay: 0.26s; }
.request-card:nth-child(8)  { animation-delay: 0.30s; }
.request-card:nth-child(9)  { animation-delay: 0.34s; }
.request-card:nth-child(10) { animation-delay: 0.38s; }
