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

/* --- Root Variables --- */
:root {
    --bg: #0b0b0b;
    --surface: #141414;
    --stroke: #2a2a2a;
    --accent: #ffffff;
    --discord: #5865F2;
    --text-dim: #888888;
    --danger: #ff4d4d;
    --success: #4ade80;
    --radius: 14px;
    --shadow: 0 8px 30px rgba(0,0,0,0.5);
}

/* --- Base Setup --- */
body {
    background-color: var(--bg);
    color: white;
    font-family: 'Inter', sans-serif;
    margin: 0; padding: 0;
    display: flex; flex-direction: column; align-items: center;
    min-height: 100vh;
}

/* --- Navigation --- */
nav {
    width: 100%; 
    max-width: 1200px;
    display: flex; 
    justify-content: space-between;
    align-items: center; 
    box-sizing: border-box;
    padding: 40px 20px 20px 20px; 
    flex-shrink: 0;
}

.logo { font-size: 1.5rem; font-weight: 800; letter-spacing: -1px; display: flex; align-items: center; cursor: pointer; }
.logo span { color: var(--text-dim); font-weight: 900; }
.nav-actions { display: flex; gap: 12px; position: relative; }

/* --- Header & Search Area --- */
header {
    width: 100%; 
    max-width: 900px;
    padding: 20px 20px 40px 20px;
    display: flex; 
    flex-direction: column; 
    align-items: center;
}

.search-area {
    display: flex;
    gap: 12px;
    width: 100%;
    align-items: stretch;
}

.search-wrapper { flex: 1; position: relative; }

.search-input {
    width: 100%;
    background: #0b0b0b;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 12px;
    color: white;
    margin-top: 5px;
    box-sizing: border-box;
    outline: none;
    font-family: inherit;
}
.search-input:focus { border-color: #444; }

/* --- Grid & Cards --- */
.grid {
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px; 
    width: 95%; 
    max-width: 1200px; 
    padding: 20px 0 100px 0;
}

.card {
    background: var(--surface); 
    border: 1px solid var(--stroke);
    border-radius: 20px; 
    overflow: hidden; 
    transition: 0.3s;
    cursor: pointer; 
    position: relative;
}
/* --- REFERRAL DASHBOARD STYLES --- */
.referral-container {
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: 20px;
    padding: 25px;
    margin: 20px 0;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
}

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

.ref-stat-badge {
    background: rgba(74, 222, 128, 0.1);
    color: var(--success);
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.ref-desc { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 20px; line-height: 1.4; }

.ref-input-box {
    display: flex;
    gap: 12px;
    background: #0b0b0b;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid var(--stroke);
}

.ref-input-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 5px;
    outline: none;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
}

/* Admin Specifics */
.admin-border { border-color: #f1c40f !important; }
.admin-list { margin-top: 15px; }
.admin-ref-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.card:hover { transform: translateY(-5px); border-color: #444; }
.referral-container {
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: 20px;
    padding: 25px;
    margin: 20px 0;
    width: 100%;
    box-sizing: border-box;
}

.admin-border { border-color: #f1c40f; }

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

.ref-stat-badge {
    background: rgba(74, 222, 128, 0.1);
    color: var(--success);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
}

.ref-desc { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 20px; }

.ref-input-box {
    display: flex;
    gap: 10px;
    background: #0b0b0b;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--stroke);
}

.ref-input-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 5px 10px;
    outline: none;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
}

.btn-copy {
    background: white;
    color: black;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

.admin-list {
    margin-top: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.admin-ref-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid var(--stroke);
    font-size: 0.85rem;
}

.view-tag-bottom {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(8px);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.thumb {
    position: relative;
    overflow: hidden;
    height: 180px; /* Standardizing thumb height */
    background-size: cover;
    background-position: center;
}

/* --- Card Components --- */
.meta-container {
    margin: 6px 0 12px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.meta-line { font-size: 0.85rem; color: #ffffff; }
.game-line { font-size: 0.75rem; color: #888; font-weight: 500; }

.content { padding: 20px; }
.card-title { margin: 0 0 8px 0; font-size: 1.1rem; font-weight: 700; }

.stats-row {
    display: flex;
    align-items: center;
    gap: 15px; 
    color: var(--text-dim);
    font-size: 0.85rem;
}

.like-count-text {
    margin-left: 6px !important;
    font-weight: 700;
    font-size: 13px;
    color: #ccc;
}

.badge-list { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }
.tag {
    background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
    padding: 5px 10px; border-radius: 8px; font-size: 0.7rem;
    border: 1px solid rgba(255,255,255,0.1); font-weight: 700;
}
.tag.verified { color: var(--success); }

/* --- Owner Actions (Overlays) --- */
.owner-actions-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 20;
}

.action-btn {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.action-btn:hover {
    background: white;
    color: black;
    transform: scale(1.1);
    border-color: white;
}

.action-btn.delete-btn:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.action-btn svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.5px;
}

/* --- Checkpoint Logic --- */
.checkpoint-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

.checkpoint-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.checkpoint-container {
    width: 100%;
    max-width: 450px;
    background: var(--surface);
    border: 1px solid var(--stroke);
    padding: 40px;
    border-radius: 24px;
    text-align: center;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-btn {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white !important; /* Reverted to white for brand colors */
    font-size: 0.95rem;
    text-transform: uppercase;
}

.btn-yt { background-color: #FF0000 !important; border: 2px solid #cc0000 !important; }
.btn-discord { background-color: #5865F2 !important; border: 2px solid #3e48bc !important; }
.btn-linkvertise { background-color: #ff8c00 !important; border: 2px solid #cc7000 !important; }
.btn-workink { background-color: #00bcd4 !important; border: 2px solid #0097a7 !important; }

.task-btn.completed {
    background-color: #4ade80 !important;
    border-color: #22c55e !important;
    color: #064e3b !important;
}

.task-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.6);
}

#final-script-btn {
    background: #ffffff;
    color: #000000;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
    margin-top: 10px;
}

/* --- Modals & Overlays --- */
#filter-overlay, #push-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.filter-modal, .push-modal {
    background: #0f0f0f;
    border: 1px solid var(--stroke);
    padding: 24px;
    border-radius: 28px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.05);
    color: white;
    width: 90%;
    max-width: 380px;
    animation: modalPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* --- Filter Specifics --- */
.tri-state {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: transparent;
    border: 1px solid var(--stroke);
    border-radius: 18px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: 0.2s ease;
}

.tri-indicator { width: 10px; height: 10px; border-radius: 50%; background: #333; }
.tri-state.state-green { border-color: var(--success); background: rgba(74, 222, 128, 0.05); }
.tri-state.state-green .tri-indicator { background: var(--success); box-shadow: 0 0 10px var(--success); }
.tri-state.state-red { border-color: var(--danger); background: rgba(255, 77, 77, 0.05); }
.tri-state.state-red .tri-indicator { background: var(--danger); box-shadow: 0 0 10px var(--danger); }

.filter-input, .filter-select {
    width: 100%;
    background: #121212;
    border: 1px solid var(--stroke);
    border-radius: 14px;
    padding: 12px;
    color: white;
    margin-bottom: 10px;
    outline: none;
}

/* --- Notifications & Toasts --- */
#notif-box { position: fixed; bottom: 30px; right: 30px; z-index: 99999; }
.toast {
    background: #1a1a1a; border: 1px solid var(--stroke); color: white;
    padding: 14px 22px; border-radius: 12px; margin-top: 10px; display: flex; align-items: center; gap: 10px;
    animation: slideIn 0.3s ease-out; box-shadow: var(--shadow);
}

@keyframes slideIn { from { transform: translateX(50px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.update-card {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #121212;
    border: 1px solid var(--stroke);
    border-left: 4px solid var(--success);
    padding: 16px;
    border-radius: 16px;
    width: 280px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    z-index: 100000;
    animation: slideUp 0.4s ease;
}

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

/* --- Buttons & UI Elements --- */
.btn {
    background: #1e1e1e; border: 1px solid var(--stroke); color: white;
    padding: 10px 18px; border-radius: 12px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: 0.2s; font-size: 0.9rem; font-weight: 600; text-decoration: none;
}
.btn:hover { background: #2a2a2a; transform: translateY(-1px); }
.btn-white { background: white; color: black; border: none; }
.btn-discord { background: var(--discord); border: none; }

.icon-btn {
    background: transparent;
    border: 1px solid var(--stroke);
    color: #888;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: 0.2s;
}
.icon-btn:hover { color: white; background: var(--surface); border-color: #555; }

/* --- Helper Classes --- */
#pfp-circle { width: 35px; height: 35px; border-radius: 50%; background: #333; overflow: hidden; border: 1px solid var(--stroke); }
#pfp-circle img { width: 100%; height: 100%; object-fit: cover; }
svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.5; }

/* --- Mobile Optimization --- */
@media (max-width: 700px) {
    .search-area { flex-direction: column; }
    nav { padding: 20px; }
    .grid { grid-template-columns: 1fr; width: 90%; }
    .checkpoint-container { padding: 20px; }
}
