/* =========================================
   1. CORE VARIABLES & RESET
   ========================================= */
   :root {
    --bg: #ffffff; --text: #202124; --primary: #1a73e8;
    --secondary: #f8f9fa; --border: #dadce0; --card-bg: #ffffff;
    --shadow: 0 4px 6px rgba(0,0,0,0.1); --danger: #d93025; --success: #188038;
}
[data-theme="dark"] {
    --bg: #202124; --text: #e8eaed; --primary: #8ab4f8;
    --secondary: #303134; --border: #3c4043; --card-bg: #292a2d;
    --shadow: 0 4px 6px rgba(0,0,0,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { font-family: 'Roboto', sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background 0.3s, color 0.3s;
    line-height: 1.6;
    display: flex; 
    flex-direction: column; 
    min-height: 100vh;
}

.container { 
    max-width: 1100px; 
    margin: 0 auto; 
    padding: 0 20px; 
    flex: 1; /* This pushes the footer down! */
}

a { text-decoration: none; color: inherit; }



/* =========================================
   2. NAVBAR
   ========================================= */
   .navbar { background: var(--card-bg); border-bottom: 1px solid var(--border); padding: 15px 0; }
   .navbar .container { display: flex; justify-content: space-between; align-items: center; }
   .logo { font-size: 24px; font-weight: bold; }
   .logo span { color: var(--primary); }
   .nav-links { list-style: none; display: flex; align-items: center; gap: 20px; }
   .nav-links a { font-weight: 500; font-size: 14px; }
   .theme-btn { background: none; border: none; cursor: pointer; font-size: 20px; }

/* =========================================
   3. HERO & SEARCH
   ========================================= */
   .hero { text-align: center; padding: 60px 20px; }
   .hero h1 { font-size: 2.5rem; margin-bottom: 10px; }
   .hero p { opacity: 0.7; margin-bottom: 30px; }

   .search-box {
    background: var(--card-bg); padding: 25px; border-radius: 15px;
    box-shadow: var(--shadow); max-width: 800px; margin: 0 auto;
    border: 1px solid var(--border);
}
.search-box input[type="text"] {
    width: 100%; padding: 15px; border: 1px solid var(--border);
    border-radius: 30px; font-size: 16px; margin-bottom: 20px;
    background: var(--secondary); color: var(--text); outline: none;
}
.search-box input[type="text"]:focus { border-color: var(--primary); }

/* Category Layout */
.categories {
    text-align: left; margin-bottom: 25px; display: flex; flex-direction: column; gap: 8px;
    max-height: 300px; overflow-y: auto; /* Scroll if too many categories */
}
.cat-wrapper { display: flex; flex-direction: column; }
.checkbox-container {
    cursor: pointer; font-size: 15px; user-select: none;
    display: flex; align-items: center; gap: 8px; padding: 5px 0;
}
.sub-cat-container {
    margin-left: 25px; padding-left: 10px; border-left: 2px solid var(--border);
    display: none; /* Hidden by default */
}
/* Crucial: Secret Category Hidden by default */
.hidden-secret-cat { display: none; }

.search-btn {
    background: var(--primary); color: #fff; border: none; padding: 12px 30px;
    border-radius: 30px; font-size: 16px; cursor: pointer; font-weight: bold; width: 100%;
}
.search-btn:hover { opacity: 0.9; }

/* Trending */
.trending { margin-top: 20px; font-size: 13px; opacity: 0.8; }
.trend-tag { color: var(--primary); font-weight: bold; margin-left: 5px; }

/* =========================================
   4. RESULTS GRID
   ========================================= */
   .link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-top: 30px; }
   .link-card { background: var(--card-bg); padding: 25px; border-radius: 15px; border: 1px solid var(--border); box-shadow: var(--shadow); }
   .card-actions { margin-top: 15px; }

/* =========================================
   5. ADMIN PANEL STYLES
   ========================================= */
   .admin-section { 
    background: var(--card-bg); padding: 30px; border-radius: 15px; 
    border: 1px solid var(--border); margin-bottom: 30px; box-shadow: var(--shadow); 
}
.tool-input {
    width: 100%; padding: 10px; margin: 5px 0 15px 0; 
    border: 1px solid var(--border); border-radius: 5px; 
    background: var(--secondary); color: var(--text);
}
.btn-primary { 
    background: var(--primary); color: #fff; padding: 10px 20px; 
    border-radius: 5px; border: none; cursor: pointer; font-size: 14px; display: inline-block;
}
.btn-danger { background: var(--danger); color: #fff; padding: 5px 10px; border-radius: 3px; font-size: 12px; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.admin-table th, .admin-table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }

/* Step Builder (Admin) */
.step-builder { background: var(--secondary); padding: 15px; border-radius: 8px; border: 1px dashed var(--border); margin-top: 10px; }
.step-input-group { display: flex; gap: 10px; margin-bottom: 10px; }
.step-item { background: var(--card-bg); padding: 8px; margin-bottom: 5px; border-left: 3px solid var(--primary); display: flex; justify-content: space-between; }

/* =========================================
   6. MODAL
   ========================================= */
   .modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 1000; display: none;
    justify-content: center; align-items: center; backdrop-filter: blur(3px);
}
.modal-box {
    background: var(--card-bg); width: 90%; max-width: 500px;
    padding: 30px; border-radius: 15px; position: relative;
    max-height: 80vh; overflow-y: auto;
}
.instruction-step { background: var(--secondary); padding: 15px; border-radius: 8px; margin-bottom: 10px; border: 1px solid var(--border); }
.step-number { font-size: 11px; font-weight: bold; color: var(--primary); text-transform: uppercase; display: block; margin-bottom: 5px; }
.step-action-btn { display: inline-block; margin-top: 5px; padding: 5px 10px; background: var(--primary); color: white; border-radius: 4px; font-size: 12px; }
.modal-close { position: absolute; top: 15px; right: 20px; font-size: 24px; background: none; border: none; cursor: pointer; color: var(--text); }


/* =========================================
   7. PAGINATION
   ========================================= */
   pagination { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 20px; 
    margin-top: 40px; 
    padding-bottom: 40px;
}
.page-info { 
    font-weight: bold; 
    color: var(--text); 
    opacity: 0.8; 
    font-size: 14px;
}


/* =========================================
   8. FOOTER
   ========================================= */
.site-footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: auto; /* Glues it to the bottom */
    border-top: 1px solid var(--border);
    font-size: 14px;
    opacity: 0.8;
    width: 100%;
}
.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}
.footer-links a {
    color: var(--primary);
    text-decoration: none;
    transition: opacity 0.3s;
}
.footer-links a:hover {
    opacity: 0.7;
    text-decoration: underline;
}
