/* ==========================================================================
   INHACK Security Portal - High-Performance Developer Console Stylesheet
   Design Style: Inspired by Unity & Unreal Engine Official Portals
   Strict Directives: Default Dark Onyx, Technical HUD, Sharp Edges, High Contrast
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Fira+Code:wght@400;500;700&family=Outfit:wght@300;400;500;700&display=swap');

:root {
    /* Color Palette */
    --bg-base: #0b0f19;               /* Premium dark slate blue base */
    --bg-surface: #151b2d;            /* Structured slate surface */
    --bg-surface-header: #0e1320;     /* Header surface deep navy */
    --bg-sidebar: #0e1320;            /* Sidebar surface deep navy */
    
    /* Formal Accent Accents */
    --color-cyan: #3b82f6;            /* Sapphire blue primary */
    --color-cyan-glow: rgba(59, 130, 246, 0.15);
    --color-blue: #2563eb;            /* Royal/indigo blue hover */
    --color-blue-glow: rgba(37, 99, 235, 0.15);
    --color-green: #10b981;           /* Forest green secure */
    --color-red: #ef4444;             /* Muted crimson error */
    
    /* Typography */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Fira Code', monospace;
    
    /* Borders & Outlines */
    --border-dim: 1px solid rgba(255, 255, 255, 0.08);
    --border-tech: 1px solid rgba(59, 130, 246, 0.2);
    --border-tech-active: 1px solid #3b82f6;
    
    /* Transits */
    --transition-fast: 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
    --transition-mid: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ==========================================================================
   Global Reset & Structure
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

a {
    color: var(--color-cyan);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-blue);
    text-decoration: underline;
}

/* ==========================================================================
   Top Telemetry Status Bar
   ========================================================================== */
.system-status-bar {
    background-color: #000000;
    border-bottom: var(--border-dim);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #475569;
    padding: 6px 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: 1.5px;
    user-select: none;
    z-index: 101;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-green);
    font-weight: 700;
}

.status-ping-dot {
    width: 6px;
    height: 6px;
    background-color: var(--color-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--color-green);
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.system-title-tag {
    color: #64748b;
}

.system-time {
    color: #64748b;
    font-weight: 500;
}

/* ==========================================================================
   Header Styling
   ========================================================================== */
header {
    background-color: rgba(10, 13, 22, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: var(--border-dim);
    padding: 1.25rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

header img {
    height: 38px;
    width: auto;
    transition: opacity var(--transition-fast);
}

header img:hover {
    opacity: 0.9;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.45rem;
    line-height: 1.1;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #ffffff 0%, var(--color-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-sub {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: #475569;
    letter-spacing: 2px;
    margin-top: 2px;
}

/* Navigation buttons generated dynamically */
nav {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

nav button {
    background-color: transparent;
    color: #ffffff;
    border: var(--border-dim);
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0.65rem 1.4rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    border-radius: 4px;
}

nav button:hover {
    border-color: var(--color-cyan);
    background-color: rgba(59, 130, 246, 0.08);
}

nav button#login-btn {
    border-color: var(--color-cyan);
    color: var(--color-cyan);
}

nav button#logout-btn {
    border-color: var(--color-red);
    color: var(--color-red);
}

nav button#logout-btn:hover {
    background-color: rgba(239, 68, 68, 0.08);
}

nav button#renew-btn {
    border-color: var(--color-green);
    color: var(--color-green);
}

nav button#renew-btn:hover {
    background-color: rgba(16, 185, 129, 0.08);
}

nav button#logout-shared-btn {
    border-color: var(--color-red);
    color: var(--color-red);
}

nav button#logout-shared-btn:hover {
    background-color: rgba(239, 68, 68, 0.08);
}

/* ==========================================================================
   Main Grid Layout
   ========================================================================== */
main {
    flex: 1;
    display: flex;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 3rem;
    gap: 2.25rem;
    align-items: flex-start;
}

/* ==========================================================================
   Sidebar Styling
   ========================================================================== */
aside {
    width: 260px;
    background-color: var(--bg-sidebar);
    border: var(--border-dim);
    flex-shrink: 0;
    position: sticky;
    top: 90px;
}

.sidebar-header {
    background-color: rgba(255, 255, 255, 0.02);
    border-bottom: var(--border-dim);
    padding: 0.9rem 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 1px;
}

.sidebar-term-symbol {
    color: var(--color-cyan);
}

aside ul {
    list-style: none;
}

aside ul li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

aside ul li a {
    display: flex;
    align-items: center;
    padding: 1.05rem 1.25rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: 1.5px;
    color: #94a3b8;
    transition: all var(--transition-fast);
}

.nav-num {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #475569;
    margin-right: 12px;
    font-weight: 400;
}

aside ul li a:hover, aside ul li a.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--color-cyan);
    padding-left: calc(1.25rem - 3px);
}

/* Sidebar Footer Info box */
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: var(--border-dim);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: #334155;
    letter-spacing: 1px;
}

/* ==========================================================================
   Main View Panel
   ========================================================================== */
section#view {
    flex: 1;
    background-color: var(--bg-surface);
    border: var(--border-dim);
    padding: 3rem;
    min-height: 550px;
    position: relative;
    border-radius: 4px;
}

/* HUD Panel Title / Header Structure */
.section-header {
    margin-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 1.5rem;
}

.section-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-cyan);
    letter-spacing: 1px;
    display: block;
    margin-bottom: 8px;
}

section h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #ffffff;
    text-transform: uppercase;
    line-height: 1.2;
}

.section-desc {
    color: #64748b;
    font-size: 0.95rem;
    margin-top: 6px;
    line-height: 1.6;
}

/* ==========================================================================
   Fade-in Page Animations
   ========================================================================== */
.animate-fade-in {
    animation: renderContent 0.3s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

@keyframes renderContent {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   [1] Home View Styling
   ========================================================================== */
.terminal-banner {
    border-left: 2px solid var(--color-cyan);
    padding-left: 1.75rem;
    margin-bottom: 3rem;
}

.banner-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #475569;
    letter-spacing: 1.5px;
    display: block;
    margin-bottom: 4px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #ffffff;
    text-transform: uppercase;
    margin-bottom: 0.85rem;
}

.page-home .lead-text {
    font-size: 1.2rem;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.hero-desc {
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1.75;
}

/* Telemetry Grid Component */
.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3.5rem;
}

.tel-box {
    background-color: rgba(255, 255, 255, 0.015);
    border: var(--border-dim);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    border-radius: 2px;
}

.tel-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #475569;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.tel-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 6px;
}

.tel-desc {
    font-size: 0.8rem;
    color: #64748b;
}

/* Generic Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
}

.feat-card {
    background-color: rgba(0, 0, 0, 0.25);
    border: var(--border-dim);
    padding: 2rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.feat-card:hover {
    border-color: rgba(0, 240, 255, 0.35);
    box-shadow: 0 4px 20px rgba(0, 240, 255, 0.05);
}

.feat-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

.feat-card-id {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-cyan);
}

.feat-card h4 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.feat-card p {
    color: #94a3b8;
    font-size: 0.92rem;
    line-height: 1.6;
}

/* ==========================================================================
   [2] Curriculum View Styling
   ========================================================================== */
.roadmap-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
}

.roadmap-card {
    background-color: rgba(255, 255, 255, 0.01);
    border: var(--border-dim);
    padding: 2.25rem 2rem;
    position: relative;
    transition: all var(--transition-mid);
}

.roadmap-card:hover {
    border-color: var(--color-cyan);
    background-color: rgba(59, 130, 246, 0.02);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.card-badge {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-cyan);
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

.card-desc {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
}

.card-topics {
    list-style: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.25rem;
}

.card-topics li {
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: #64748b;
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color var(--transition-fast);
}

.roadmap-card:hover .card-topics li {
    color: #cbd5e1;
}

.topic-dot {
    width: 4px;
    height: 4px;
    background-color: var(--color-cyan);
    display: inline-block;
    flex-shrink: 0;
}

/* ==========================================================================
   [3] Seminar Timeline Styling
   ========================================================================== */
.timeline {
    position: relative;
    padding-left: 2rem;
    margin-left: 1.5rem;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 1px;
    background-color: rgba(255, 255, 255, 0.06);
}

.timeline-item {
    position: relative;
    margin-bottom: 3.5rem;
}

.timeline-item:last-child {
    margin-bottom: 1rem;
}

/* Floating custom bullet */
.timeline-item::before {
    content: "";
    position: absolute;
    left: calc(-2rem - 4.5px);
    top: 22px;
    width: 8px;
    height: 8px;
    background-color: var(--bg-base);
    border: 1px solid var(--color-cyan);
    z-index: 2;
    transition: all var(--transition-mid);
}

.timeline-item:hover::before {
    background-color: var(--color-cyan);
    transform: scale(1.3);
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-cyan);
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.timeline-content {
    background-color: rgba(255, 255, 255, 0.01);
    border: var(--border-dim);
    padding: 1.75rem 2rem;
    transition: all var(--transition-fast);
}

.timeline-content:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background-color: rgba(255, 255, 255, 0.015);
}

.timeline-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.75rem;
}

.timeline-content p {
    color: #94a3b8;
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.presenter {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: #475569;
    letter-spacing: 0.5px;
    display: block;
}

/* ==========================================================================
   [4] CTF Scoreboard & Challenges Dashboard Styling
   ========================================================================== */
.ctf-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2.5rem;
    align-items: flex-start;
}

.panel-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #64748b;
    letter-spacing: 1.5px;
    margin-bottom: 1.25rem;
}

.ctf-table {
    width: 100%;
    border-collapse: collapse;
}

.ctf-table th {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #475569;
    letter-spacing: 1px;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
    font-weight: 700;
}

.ctf-table td {
    padding: 1.15rem 1.25rem;
    font-size: 0.92rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.ctf-table tr {
    transition: background-color var(--transition-fast);
}

.ctf-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.015);
}

.ctf-table td.user-cell {
    font-family: var(--font-heading);
    font-weight: 600;
    color: #ffffff;
}

.ctf-table td.pts-cell {
    font-family: var(--font-mono);
    color: var(--color-cyan);
    font-weight: 700;
}

.ctf-table td.status-cell {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #64748b;
}

/* Ranks Styles */
.rank-1 td {
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
    background-color: rgba(255, 215, 0, 0.01);
}
.rank-1 td.user-cell {
    color: #ffd700;
}
.rank-2 td.user-cell {
    color: #e2e8f0;
}
.rank-3 td.user-cell {
    color: #b45309;
}

/* Challenge elements */
.challenge-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.challenge-card {
    background-color: rgba(0, 0, 0, 0.2);
    border: var(--border-dim);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color var(--transition-fast);
}

.challenge-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.challenge-card.solved {
    border-left: 2px solid var(--color-green);
    background-color: rgba(0, 255, 102, 0.01);
}

.chal-category {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    letter-spacing: 1px;
    flex-shrink: 0;
    border: 1px solid transparent;
}

.chal-category.web {
    background-color: rgba(0, 240, 255, 0.06);
    border-color: rgba(0, 240, 255, 0.25);
    color: var(--color-cyan);
}
.chal-category.pwn {
    background-color: rgba(0, 102, 255, 0.06);
    border-color: rgba(0, 102, 255, 0.25);
    color: var(--color-blue);
}
.chal-category.rev {
    background-color: rgba(255, 0, 60, 0.06);
    border-color: rgba(255, 0, 60, 0.25);
    color: var(--color-red);
}

.chal-details {
    flex: 1;
    margin-left: 1.25rem;
    margin-right: 1.25rem;
}

.chal-details h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 2px;
}

.chal-pts {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 0;
}

.challenge-card.solved .chal-pts {
    color: var(--color-green);
}

.status-badge {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 4px 8px;
}

.status-badge.solved {
    color: var(--color-green);
}

.status-badge.open {
    color: var(--color-cyan);
}

/* ==========================================================================
   Footer Component
   ========================================================================== */
footer {
    background-color: #000000;
    border-top: var(--border-dim);
    padding: 2rem 3rem;
    text-align: center;
    color: #475569;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 1px;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1100px) {
    main {
        flex-direction: column;
        align-items: stretch;
    }
    
    aside {
        width: 100%;
        position: static;
        margin-bottom: 1.5rem;
    }
    
    aside ul {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }
    
    aside ul li {
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.02);
    }
    
    aside ul li a {
        justify-content: center;
        padding: 1.25rem 0.5rem;
    }
    
    .ctf-container {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1.25rem 1.5rem;
    }
    
    main {
        padding: 1.5rem 1.5rem;
    }
    
    .system-status-bar {
        padding: 6px 1.5rem;
    }
    
    aside ul {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .telemetry-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .roadmap-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    section#view {
        padding: 1.75rem;
    }
    
    section h2 {
        font-size: 1.75rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
}

@media (max-width: 500px) {
    aside ul {
        grid-template-columns: 1fr;
    }
}