/* --- RAZZ PREMIUM THEME --- */
:root {
    --bg: #0b0d11;
    --card: #161920;
    --primary: #00ff88;
    --text: #ffffff;
    --text-sec: #a0a6b3;
    --border: #262a33;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; outline: none; }

body {
    margin: 0; padding: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', sans-serif;
    overflow-x: hidden;
    padding-bottom: 140px; /* Space for Waifu */
}

/* NAVBAR */
nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 20px;
    background: rgba(11, 13, 17, 0.95);
    backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 1000;
    border-bottom: 1px solid var(--border);
}

.logo-center {
    position: absolute; left: 50%; transform: translateX(-50%);
    font-size: 22px; font-weight: 900; letter-spacing: -0.5px;
    color: #fff; cursor: pointer;
}
.highlight { color: var(--primary); text-shadow: 0 0 10px rgba(0, 255, 136, 0.4); }

.nav-btn { background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; }

/* SIDEBAR */
#sidebar {
    position: fixed; top: 0; left: -280px; width: 280px; height: 100%;
    background: #12151c; z-index: 2000; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid var(--border); padding: 20px;
    display: flex; flex-direction: column;
}
#sidebar.open { left: 0; }
#overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); z-index: 1500; display: none;
}
#overlay.active { display: block; }

.sidebar-header { display: flex; justify-content: space-between; margin-bottom: 30px; }
.close-btn { background: none; border: none; color: #666; font-size: 24px; cursor: pointer; }

.user-profile { text-align: center; padding-bottom: 20px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.avatar-circle { width: 60px; height: 60px; background: #222; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; font-size: 24px; color: #555; }
.avatar-img { width: 60px; height: 60px; border-radius: 50%; margin-bottom: 10px; border: 2px solid var(--primary); }
.login-trigger-btn { background: var(--primary); color: #000; border: none; padding: 8px 20px; border-radius: 20px; font-weight: bold; cursor: pointer; margin-top: 10px; }
.pro-badge { background: rgba(0, 255, 136, 0.1); color: var(--primary); padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: bold; border: 1px solid var(--primary); }

.nav-list { list-style: none; padding: 0; }
.nav-list li { padding: 15px; cursor: pointer; display: flex; gap: 15px; color: var(--text-sec); font-size: 16px; align-items: center; transition: 0.2s; }
.nav-list li:hover { color: #fff; background: rgba(255,255,255,0.05); border-radius: 10px; }

.sidebar-footer { margin-top: auto; text-align: center; font-size: 12px; color: #666; }

/* HERO */
.hero-section { text-align: center; padding: 30px 20px 10px; }
.main-title { font-size: 28px; line-height: 1.2; margin-bottom: 20px; }
.gradient-text { background: linear-gradient(to right, #00ff88, #00b8ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 800; }

.search-wrapper { position: relative; max-width: 100%; margin-bottom: 20px; }
.search-wrapper i { position: absolute; left: 15px; top: 14px; color: #666; }
input { width: 100%; padding: 12px 12px 12px 45px; background: #1c1f26; border: 1px solid var(--border); border-radius: 50px; color: #fff; font-size: 16px; }

.filter-wrapper { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.filter-pill { background: #1c1f26; border: 1px solid var(--border); color: #888; padding: 8px 20px; border-radius: 50px; font-size: 13px; cursor: pointer; transition: 0.3s; }
.filter-pill.active { background: var(--primary); color: #000; border-color: var(--primary); font-weight: bold; }

/* GRID LAYOUT (FIXED) */
#tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Strict 2 columns */
    gap: 12px;
    padding: 15px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 15px;
    display: flex; flex-direction: column; align-items: center; justify-content: space-between;
    position: relative;
    transition: 0.2s;
}
.card:active { transform: scale(0.98); }
.card img { width: 45px; height: 45px; border-radius: 10px; background: #fff; padding: 4px; object-fit: contain; margin-bottom: 10px; }
.card h3 { font-size: 13px; margin: 0 0 8px; text-align: center; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: 9px; padding: 3px 8px; border-radius: 4px; font-weight: bold; text-transform: uppercase; border: 1px solid; }
.tag.free { color: var(--primary); border-color: var(--primary); }
.tag.paid { color: #ff4757; border-color: #ff4757; }

.fav-icon { position: absolute; top: 10px; right: 10px; color: rgba(255,255,255,0.2); font-size: 16px; }
.fav-icon.active { color: #ff4757; }

/* WAIFU SYSTEM */
#waifu-system {
    position: fixed; bottom: 10px; right: 10px;
    z-index: 5000; display: flex; flex-direction: column; align-items: flex-end;
    pointer-events: none; /* Allows clicking through empty space */
}

#waifu-img {
    width: 110px; height: auto; cursor: pointer; pointer-events: auto;
    transition: transform 0.2s, filter 0.2s;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.5));
}

/* Animations */
.idle { animation: float 3s ease-in-out infinite; }
.angry { 
    animation: angryShake 0.1s infinite !important; 
    filter: drop-shadow(0 0 15px red) sepia(1) saturate(5) !important;
}

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes angryShake { 0% { transform: translate(1px, 1px); } 50% { transform: translate(-1px, -2px); } }

#chat-bubble {
    background: #fff; color: #000; padding: 12px;
    border-radius: 15px 15px 0 15px; font-size: 12px; font-weight: 800;
    max-width: 200px; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 2px solid #000; margin-bottom: 5px;
    display: none; opacity: 0; transform: scale(0.9); transition: 0.3s;
}
#chat-bubble.show { display: block; opacity: 1; transform: scale(1); }

/* LOGIN MODAL */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 6000;
    align-items: center; justify-content: center; backdrop-filter: blur(5px);
}
.modal-box {
    background: #1c1f26; width: 85%; max-width: 320px;
    border-radius: 20px; padding: 25px; text-align: center;
    border: 1px solid var(--border); position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.modal-icon { font-size: 40px; color: var(--primary); margin-bottom: 15px; }
.modal-box h2 { margin: 0 0 10px; font-size: 20px; }
.modal-box p { color: #aaa; font-size: 13px; margin-bottom: 20px; }
.close-modal { position: absolute; top: 15px; right: 20px; font-size: 24px; cursor: pointer; color: #666; }

.google-btn {
    width: 100%; padding: 12px; background: #fff; color: #000;
    border: none; border-radius: 50px; font-weight: bold;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
