/* --- CONFIG & FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg: #0a0a0a;
    --card-bg: #111;
    --border: #1f1f1f;
    --accent: #fff;
    --text-main: #f5f5f5;
    --text-dim: #888;
    --text-header: #555;
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text-main);
    margin: 0;
    overflow-x: hidden;
    width: 100%;
}

/* --- NAVBAR --- */
.navbar {
    height: 70px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(12px);
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 800;
    letter-spacing: -1px;
    font-size: 1rem;
    text-transform: uppercase;
}

.logo span { font-weight: 300; color: #444; }

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    margin-left: 25px;
    font-size: 12px;
    font-weight: 500;
    transition: 0.2s;
}

.nav-links a:hover { color: #fff; }

/* --- HERO SECTION --- */
.hero {
    height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    background: radial-gradient(circle at center, #141414 0%, #0a0a0a 100%);
}

.hero-content h1 {
    font-size: clamp(2.2rem, 10vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -2px;
}

.hero-content p {
    color: var(--text-dim);
    max-width: 500px;
    margin: 0 auto 35px;
    font-size: 1.1rem;
    line-height: 1.5;
}

/* --- BUTTON: HERO CTA --- */
.cta-button {
    padding: 18px 45px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cta-button:hover {
    transform: scale(1.05);
    background: #ddd;
    box-shadow: 0 10px 30px rgba(255,255,255,0.1);
}

/* --- SEARCH MODAL CARD --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.search-card {
    background: var(--card-bg);
    padding: 50px 30px;
    border-radius: 28px;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 420px;
    position: relative;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.search-card h3 { font-size: 1.6rem; font-weight: 700; margin-bottom: 10px; }
.search-card p { font-size: 14px; color: var(--text-dim); margin-bottom: 30px; }

.close-modal {
    position: absolute;
    top: 20px; right: 20px;
    background: none; border: none; color: #444;
    font-size: 32px; cursor: pointer; transition: 0.2s;
}
.close-modal:hover { color: #fff; }

/* --- INPUTS & SEARCH BUTTON --- */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group input {
    width: 100%;
    padding: 18px;
    background: #000;
    border: 1px solid #2a2a2a;
    border-radius: 14px;
    color: #fff;
    font-size: 16px;
    text-align: center;
    transition: 0.3s;
}

.input-group input:focus { border-color: #fff; outline: none; }

.input-group button {
    width: 100%;
    padding: 18px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.input-group button:hover {
    background: #ddd;
    transform: translateY(-2px);
}

.input-group button::after {
    content: '→';
    font-size: 18px;
}

/* --- RESULTS PAGE --- */
.container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
}

/* --- BACK BUTTONS --- */
.back-home-btn {
    background: none; border: 1px solid var(--border);
    color: var(--text-dim); padding: 10px 20px; border-radius: 10px;
    font-size: 12px; font-weight: 600; cursor: pointer; transition: 0.2s;
}
.back-home-btn:hover { border-color: #fff; color: #fff; }

.close-x {
    background: var(--border); color: #fff; border: none;
    width: 42px; height: 42px; border-radius: 50%;
    font-size: 20px; cursor: pointer; transition: 0.2s;
}
.close-x:hover { background: #333; }

/* --- PROFILE --- */
.profile {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 25px;
}

.profile h2 { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.5px; }
.profile small { color: var(--text-dim); text-transform: uppercase; letter-spacing: 1.5px; font-size: 10px; font-weight: 700; }

.stats { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.stat {
    background: #0d0d0d; border: 1px solid var(--border);
    padding: 10px 16px; border-radius: 10px; font-size: 12px;
}
.stat strong { color: #fff; margin-right: 4px; }

/* --- TABS (Scrollable Segmented Control) --- */
.tabs {
    display: flex;
    gap: 4px;
    background: #111;
    padding: 5px;
    border-radius: 14px;
    border: 1px solid var(--border);
    margin-bottom: 25px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
    padding: 10px 22px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}

.tab:hover { color: #888; }
.tab.active { background: #fff; color: #000; }



/* --- MODULE GRID SECTION --- */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    padding-bottom: 80px;
}

.module-card {
    background: #0d0d0d;
    border: 1px solid #1a1a1a;
    border-radius: 32px;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    text-align: left;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.module-card:hover {
    border-color: #333;
    transform: translateY(-5px);
}

/* TAGS */
.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.module-tag {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #444;
}

.type-tag {
    font-size: 10px;
    font-weight: 800;
    padding: 4px 12px;
    border: 1px solid #222;
    border-radius: 20px;
    color: #fff;
}

.type-tag.live {
    background: #fff;
    color: #000;
}

/* TEXT */
.module-card h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    letter-spacing: -1px;
}

.module-card p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* TERMINAL PREVIEW (Card 1) */
.terminal-preview {
    background: #000;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #eee;
}

.terminal-preview p { margin: 5px 0; color: #fff; }

/* STATUS LIST (Card 2) */
.status-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
}

.status-item {
    background: #000;
    padding: 14px 20px;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
}

.status-item .val { color: #555; }

/* HIGHLIGHT CARD (Card 3) */
.module-card.highlight {
    background: #0d0d0d;
    justify-content: space-between;
}

.center-content {
    margin: 40px 0;
}

/* BUTTONS IN CARDS */
.outline-btn {
    background: none;
    border: 1px solid #1a1a1a;
    color: #fff;
    padding: 16px;
    border-radius: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.outline-btn:hover {
    background: #111;
    border-color: #444;
}

.solid-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 20px;
    border-radius: 16px;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    transition: 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.solid-btn:hover {
    background: #ccc;
}

/* RESPONSIVE FIX */
@media (max-width: 768px) {
    .module-grid {
        grid-template-columns: 1fr;
        padding: 20px;
    }
}

/* --- TABLE RESPONSIVENESS --- */
.table-wrapper {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card-bg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 650px;
}

th {
    font-size: 11px;
    letter-spacing: 1.5px;
    padding: 20px;
    background: #0d0d0d;
    text-align: left;
    color: var(--text-header);
    text-transform: uppercase;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 18px 20px;
    font-size: 13px;
    border-bottom: 1px solid #161616;
    color: #999;
}

td:nth-child(1) { color: #fff; font-weight: 600; }
td:nth-child(2) { color: #777; }

tr:last-child td { border-bottom: none; }
tr:hover td { background: #141414; color: #fff; }

/* --- GRADES --- */
.grade {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    min-width: 35px;
    text-align: center;
}

.pass { background: #fff; color: #000; }
.mid { background: #333; color: #fff; }
.none { background: transparent; border: 1px solid #222; color: #444; }

/* --- UTILS --- */
.hidden { display: none !important; }

.loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 9999;
}

.spinner {
    width: 40px; height: 40px; border: 3px solid #222;
    border-top: 3px solid #fff; border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

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

/* --- RESPONSIVE MEDIA QUERIES --- */

@media (max-width: 768px) {
    .hero-content h1 { font-size: 2.8rem; }
    .nav-links { display: none; }
    
    .profile { padding: 25px 20px; text-align: center; }
    .stats { justify-content: center; }
    
    .container { margin: 20px auto; }
}


@media (max-width: 480px) {
    .search-card { padding: 40px 20px; }
    .hero-content h1 { font-size: 2.2rem; }
    .hero-content p { font-size: 1rem; }
    
    .profile h2 { font-size: 1.4rem; }
    .back-home-btn span { display: none; } /* Hide text, keep arrow */
    
    td:nth-child(2) {
        max-width: 180px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
