/* 
    ==================================================
    PREMIUM AESTHETIC THEME SYSTEM
    ==================================================
*/

:root {
    /* DEFAULT: NEBULA */
    --bg-color: #030712;
    --card-bg: rgba(17, 24, 39, 0.7);
    --inner-bg: rgba(31, 41, 55, 0.5);
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --purple: #8b5cf6;
    --border-color: rgba(139, 92, 246, 0.25);
    --shadow-3d: 0 8px 32px 0 rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    --blob-1: rgba(139, 92, 246, 0.2);
    --blob-2: rgba(37, 99, 235, 0.2);
}

[data-theme="ocean"] {
    --bg-color: #010409;
    --card-bg: rgba(13, 17, 23, 0.8);
    --inner-bg: rgba(22, 27, 34, 0.6);
    --text-main: #f0f6fc;
    --text-muted: #8b949e;
    --purple: #00d2ff;
    --border-color: rgba(0, 210, 255, 0.3);
    --shadow-3d: 0 10px 40px rgba(0, 0, 0, 0.9), inset 0 0 15px rgba(0, 210, 255, 0.05);
}

[data-theme="forest"] {
    --bg-color: #050805;
    --card-bg: rgba(10, 15, 10, 0.85);
    --inner-bg: rgba(20, 30, 20, 0.5);
    --text-main: #f0fff4;
    --text-muted: #a0aec0;
    --purple: #00ff88;
    --border-color: rgba(0, 255, 136, 0.3);
    --shadow-3d: 0 12px 45px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(0, 255, 136, 0.05);
}

[data-theme="sunset"] {
    --bg-color: #0a050a;
    --card-bg: rgba(25, 15, 25, 0.8);
    --inner-bg: rgba(35, 20, 35, 0.6);
    --text-main: #fff5f5;
    --text-muted: #feb2b2;
    --purple: #ff3366;
    --border-color: rgba(255, 51, 102, 0.3);
    --shadow-3d: 0 15px 50px rgba(0, 0, 0, 0.9), inset 0 0 20px rgba(255, 51, 102, 0.05);
}

[data-theme="light"] {
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.9);
    --inner-bg: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --purple: #6366f1;
    --border-color: rgba(99, 102, 241, 0.2);
    --shadow-3d: 0 10px 25px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
}

/* 
    ==================================================
    GLOBAL & VISIBILITY FIXES
    ==================================================
*/

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background-color: var(--bg-color); color: var(--text-main); overflow-x: hidden; }

.text-gradient {
    background: linear-gradient(135deg, var(--text-main) 30%, var(--purple) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hidden { display: none !important; }

/* 
    ==================================================
    LAYOUT & NAVIGATION
    ==================================================
*/

.layout { display: flex; gap: 25px; padding: 25px; max-width: 1600px; margin: 0 auto; position: relative; }

.top-header {
    padding: 0 30px;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    backdrop-filter: blur(12px);
    margin-bottom: 25px;
    z-index: 100;
}

.top-nav { display: flex; gap: 30px; }
.top-nav a { 
    text-decoration: none; 
    color: var(--text-muted); 
    font-weight: 600; 
    transition: 0.3s; 
    font-size: 0.95rem;
}
.top-nav a.active { color: var(--purple); }

/* 
    ==================================================
    SIDEBAR & THEME SWITCHER
    ==================================================
*/

.sidebar {
    width: 280px;
    height: calc(100vh - 50px);
    position: sticky;
    top: 25px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.profile-section { text-align: center; margin-bottom: 30px; }
.profile-img-wrapper img { width: 80px; border-radius: 50%; margin-bottom: 15px; border: 2px solid var(--purple); }
.nav-menu { display: flex; flex-direction: column; gap: 10px; flex-grow: 1; }
.nav-menu a { text-decoration: none; color: var(--text-muted); padding: 12px; border-radius: 12px; display: flex; align-items: center; gap: 10px; font-weight: 600; transition: 0.3s; }
.nav-menu a.active, .nav-menu a:hover { background: var(--inner-bg); color: var(--purple); }

.theme-switcher-box { padding: 20px; border-radius: 16px; margin-top: auto; display: flex; flex-direction: column; gap: 12px; background: var(--inner-bg); }
.theme-btn { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--border-color); background: var(--bg-color); color: var(--text-main); cursor: pointer; font-weight: 700; transition: 0.3s; }
.theme-btn:hover { background: var(--purple); color: #fff; }

/* 
    ==================================================
    SEARCH BAR (PERSISTENT)
    ==================================================
*/

.tut-search-wrapper { margin-bottom: 30px; }
.tut-search-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 28px;
    border-radius: 50px;
    background: var(--inner-bg);
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-3d);
    transition: 0.3s;
}
.tut-search-bar:focus-within { border-color: var(--purple) !important; }
.tut-search-bar input { background: transparent; border: none; color: var(--text-main); width: 100%; outline: none; font-size: 1rem; }

/* 
    ==================================================
    HERO SECTION
    ==================================================
*/

.tut-hero { display: flex; align-items: center; justify-content: space-between; padding: 60px; margin-bottom: 40px; border-radius: 24px; background: var(--card-bg); border: 1px solid var(--border-color); }
.tut-hero-text { flex: 1.5; }
.tut-hero-text h1 { font-size: 3.2rem; margin-bottom: 15px; line-height: 1.1; font-weight: 800; }
.tut-main-img { width: 340px; filter: drop-shadow(0 20px 40px rgba(0,0,0,0.4)); }

/* 
    ==================================================
    CATEGORY GRID
    ==================================================
*/

.tut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 25px; margin: 20px 0 50px 0; }
.tut-cat-card { padding: 35px; border-radius: 24px; background: var(--card-bg); border: 1px solid var(--border-color); cursor: pointer; transition: 0.3s; }
.tut-cat-card:hover { transform: translateY(-8px); border-color: var(--purple) !important; }
.cat-icon { font-size: 3rem; margin-bottom: 15px; display: block; }
.cat-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; font-weight: 600; font-size: 0.85rem; opacity: 0.8; }

/* 
    ==================================================
    SPLIT LAYOUT (RECENT & POPULAR)
    ==================================================
*/

.tut-split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 35px; }
.tut-item { display: flex; align-items: center; gap: 20px; padding: 22px; border-radius: 20px; margin-bottom: 15px; background: var(--card-bg); border: 1px solid var(--border-color); text-decoration: none; color: inherit; transition: 0.3s; }
.tut-item:hover { transform: translateX(10px); background: var(--inner-bg); }
.tut-item-icon { font-size: 1.5rem; color: var(--purple); }

/* POPULAR LIST (CLICKABLE) */
.pop-row-link { text-decoration: none; color: inherit; display: block; }
.pop-row { display: flex; align-items: center; padding: 12px; border-radius: 12px; transition: 0.3s; cursor: pointer; }
.pop-row:hover { background: var(--inner-bg); transform: translateX(8px); }
.pop-idx { font-weight: 800; font-size: 1.1rem; opacity: 0.2; margin-right: 15px; min-width: 25px; }
.pop-info h5 { margin-bottom: 2px; font-size: 0.9rem; }
.pop-stat { margin-left: auto; font-size: 0.8rem; font-weight: 600; color: var(--purple); }

/* 
    ==================================================
    RESULTS GRID & CARDS
    ==================================================
*/

.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; margin-top: 30px; }
.result-card { text-decoration: none; color: inherit; padding: 30px; border-radius: 24px; background: var(--card-bg); border: 1px solid var(--border-color); display: flex; flex-direction: column; transition: 0.3s; min-height: 250px; }
.result-card:hover { transform: translateY(-8px); border-color: var(--purple) !important; box-shadow: var(--shadow-3d); }
.result-card h3 { margin-bottom: 12px; font-size: 1.2rem; }
.result-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 20px; }

/* 
    ==================================================
    MOBILE RESPONSIVENESS
    ==================================================
*/

@media (max-width: 1024px) {
    .layout { flex-direction: column; padding: 15px; }
    .sidebar { position: fixed; left: -300px; transition: 0.4s; z-index: 500; height: 100vh; top: 0; }
    .sidebar.active { left: 0; }
    .top-nav { display: none; }
    .tut-split { grid-template-columns: 1fr; }
    .tut-hero { flex-direction: column; text-align: center; padding: 40px; }
    .tut-main-img { width: 260px; margin-top: 30px; }
}

@media (max-width: 600px) {
    .tut-hero-text h1 { font-size: 2.2rem; }
    .tut-grid { grid-template-columns: 1fr; }
    .results-grid { grid-template-columns: 1fr; }
}