:root {
    --bg: #0f172a;
    --card: #1e293b;
    --accent: #38bdf8;
    --text-p: #f8fafc;
    --text-s: #94a3b8;
    --border: #334155;
    --input-bg: #0b1120;
}

[data-theme="light"] {
    --bg: #f1f5f9;
    --card: #ffffff;
    --accent: #0284c7;
    --text-p: #0f172a;
    --text-s: #64748b;
    --border: #cbd5e1;
    --input-bg: #e2e8f0;
}

body {
    background: var(--bg);
    color: var(--text-p);
    font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Prevents scroll on lock screen */
}

/* --- Login Overlay --- */
.overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.auth-card { text-align: center; width: 320px; }
h2 { font-weight: 400; letter-spacing: 1px; margin-bottom: 2rem; }

.dots-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    transition: 0.2s;
}
.dot.active { background: var(--accent); box-shadow: 0 0 10px var(--accent); }

.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.n-btn {
    aspect-ratio: 1/1;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-p);
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.2s;
}
.n-btn:hover { border-color: var(--accent); color: var(--accent); }
.util { font-size: 0.8rem; font-weight: 600; }

/* --- Main Content --- */
.content-wrapper { 
    width: 100%; 
    height: 100vh; 
    padding: 2rem; 
    box-sizing: border-box; 
    overflow-y: auto; /* Allows scrolling if content is tall */
}

.navbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 3rem; 
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.brand { font-weight: 700; letter-spacing: 2px; color: var(--accent); }

.nav-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-s);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 10px;
}
.nav-btn:hover { border-color: var(--text-p); color: var(--text-p); }

.main-container { max-width: 1000px; margin: 0 auto; }

/* --- Search Bar --- */
.page-head { text-align: center; margin-bottom: 3rem; }

.search-box {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.search-box input {
    background: var(--input-bg);
    border: 1px solid var(--border);
    padding: 15px 20px;
    border-radius: 30px;
    width: 100%;
    max-width: 500px;
    color: var(--text-p);
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.search-box button {
    background: var(--accent);
    border: none;
    width: 50px;
    height: 50px; /* match input height roughly */
    border-radius: 50%;
    cursor: pointer;
    color: var(--bg);
    font-size: 1.2rem;
    transition: 0.2s;
}
.search-box button:hover { opacity: 0.9; transform: scale(1.05); }

/* --- Image Cards --- */
.node-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.node-card {
    background: var(--card);
    border-radius: 16px;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: 0.3s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-img {
    height: 140px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--border);
}

.card-info { padding: 1.5rem; }
.card-info h3 { margin: 0 0 5px 0; color: var(--text-p); font-size: 1.1rem; }
.card-info p { margin: 0; color: var(--text-s); font-size: 0.9rem; }

.node-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}