/* --- BASE & LAYOUT --- */
body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    display: block;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
    padding-bottom: 80px; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container { width: 100%; max-width: 100%; padding: 0 15px; box-sizing: border-box; position: relative; }

/* Header */
.app-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 20px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow); margin-bottom: 20px; position: sticky; top: 0; z-index: 1000;
    border-bottom: 1px solid var(--border);
}

.app-header::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    z-index: -1;
}

.header-left { display: flex; align-items: center; gap: 15px; }
.logo { font-size: 24px; font-weight: 800; color: var(--primary); letter-spacing: -1px; cursor: pointer; }
.theme-toggle { background: var(--primary-light); border: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 18px; transition: transform 0.2s; }
.theme-toggle:hover { transform: scale(1.1); }

/* User Menu */
#auth-zone { display: flex; align-items: center; gap: 15px; }

.notification-bell {
    position: relative; cursor: pointer; color: var(--text-light);
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    transition: all 0.2s;
}
.notification-bell:hover { background: var(--bg); color: var(--primary); }

.user-pill { 
    display: flex; align-items: center; gap: 10px; 
    background: var(--surface); 
    padding: 4px 6px 4px 15px; 
    border-radius: 30px; 
    cursor: pointer; 
    transition: all 0.2s; 
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.user-pill:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--primary-light); }

.user-menu-container { position: relative; display: inline-block; }
.user-dropdown {
    display: none;
    position: absolute;
    top: 120%;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    min-width: 200px;
    z-index: 2000;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
    padding: 6px;
}
.user-dropdown.show { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 12px 15px; color: var(--text); text-decoration: none; font-size: 13px; font-weight: 600; cursor: pointer; border: none; background: transparent; width: 100%; text-align: left; border-radius: 10px; transition: all 0.2s; }
.dropdown-item:hover { background: var(--bg); color: var(--primary); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: #fee2e2; }
.dropdown-divider { height: 1px; background: var(--border); margin: 5px 0; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* Navigation */
.nav-tabs { display: flex; gap: 5px; }
.nav-btn { border: none; background: transparent; padding: 8px 12px; font-weight: 600; color: var(--secondary); cursor: pointer; border-radius: 12px; transition: all 0.2s; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.nav-btn.active { background: var(--primary-light); color: var(--primary); }

@media (max-width: 640px) {
    .nav-tabs { 
        background: var(--surface); padding: 6px; border-radius: 24px; box-shadow: var(--shadow); margin: 0; border: 1px solid var(--border);
        position: fixed; bottom: 20px; left: 20px; right: 20px; margin: 0; z-index: 2000; border-radius: 24px; 
        /* Liquid Glass Effect (Dark Default) */
        background: rgba(15, 23, 42, 0.6); 
        backdrop-filter: blur(16px) saturate(180%);
        -webkit-backdrop-filter: blur(16px) saturate(180%); /* Safari Fix */
        -webkit-backdrop-filter: blur(16px) saturate(180%);
        max-width: none; width: auto; overflow-x: auto; 
        border: 1px solid rgba(255,255,255,0.1); 
        box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    }
    [data-theme="light"] .nav-tabs { 
        /* Liquid Glass Effect (Light) */
        background: rgba(255, 255, 255, 0.65); 
        border: 1px solid rgba(255, 255, 255, 0.4); 
        box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    }
    .nav-btn { flex: 1; flex-direction: column; padding: 10px 15px; border-radius: 18px; min-width: 60px; gap: 4px; }
    .nav-btn.active { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); }
}

/* Search & Filters */
.search-container { display: flex; gap: 10px; margin-bottom: 15px; flex-wrap: wrap; }
.search-input, .filter-select { padding: 12px 16px; border-radius: 12px; border: 1px solid transparent; outline: none; box-shadow: var(--shadow-sm); background: var(--surface); color: var(--text); transition: all 0.2s; }
.search-input { flex: 1; min-width: 200px; }
.filter-select { cursor: pointer; }
.search-input:focus, .filter-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

.category-bar { display: flex; 
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    gap: 8px; 
    padding: 10px 10px 20px 10px; 
    margin-bottom: 5px; 
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.category-bar::-webkit-scrollbar { display: none; }

.cat-chip { flex-shrink: 0; white-space: nowrap; padding: 8px 16px; background: var(--surface); border-radius: 20px; font-size: 12px; font-weight: 600; color: var(--text-light); cursor: pointer; box-shadow: var(--shadow-sm); border: 1px solid var(--border); transition: all 0.2s ease; display: flex; align-items: center; gap: 6px; user-select: none; }
.cat-chip:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary); color: var(--primary); }

.cat-chip.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.6); transform: scale(1.05); }
.cat-chip.active:hover { transform: scale(1.05) translateY(-2px); box-shadow: 0 12px 25px -8px rgba(99, 102, 241, 0.7); }

.cat-chip i { width: 16px; height: 16px; transition: color 0.2s; }