* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary-color: #8a2be2; /* BlueViolet */
    --ghost-color: #f8f8ff;   /* Ghost White */
    --bg-color: #0d0b14;
    --text-color: #f8f8ff;
    --text-color-muted: #b0a8b9;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.12);
    --blur-value: 12px;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 80% 20%, rgba(138, 43, 226, 0.15), transparent 50%),
                      radial-gradient(circle at 20% 80%, rgba(138, 43, 226, 0.1), transparent 50%);
    background-attachment: fixed;
    color: var(--text-color);
    overflow-x: hidden;
}

/* SIDEBAR & OVERLAY */
.sidebar {
    height: 100%; width: 280px; position: fixed; z-index: 2000; top: 0; left: 0;
    background-color: rgba(13, 11, 20, 0.9); backdrop-filter: blur(var(--blur-value));
    border-right: 1px solid var(--glass-border); transform: translateX(-100%); transition: 0.3s;
}
.sidebar.open { transform: translateX(0); }
.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 1999; display: none; }
.sidebar-header { padding: 20px; border-bottom: 1px solid var(--glass-border); display: flex; justify-content: space-between; align-items: center; }
.sidebar-header .logo { color: var(--primary-color); font-size: 1.2em; font-weight: bold; }
.close-btn { background: none; border: none; color: #fff; font-size: 2em; cursor: pointer; }
.sidebar-nav ul { list-style: none; padding: 20px 0; }
.sidebar-nav li a { padding: 15px 20px; color: var(--text-color-muted); display: flex; align-items: center; gap: 15px; text-decoration: none; transition: 0.3s; }
.sidebar-nav li a:hover { color: var(--primary-color); background: rgba(255,255,255,0.05); }
.sidebar-footer { position: absolute; bottom: 0; width: 100%; padding: 20px; border-top: 1px solid var(--glass-border); font-size: 0.8em; color: var(--text-color-muted); }

/* TOP NAV */
.top-nav-social {
    position: sticky; top: 0; width: 100%; max-width: 600px; margin: 0 auto;
    display: flex; align-items: center; padding: 10px 15px; z-index: 1000;
    background: rgba(13, 11, 20, 0.7); backdrop-filter: blur(10px); border-bottom: 1px solid var(--glass-border);
}
.menu-icon { background: none; border: none; color: #fff; font-size: 1.2em; cursor: pointer; margin-right: 15px; }
.search-bar-container { position: relative; flex-grow: 1; display: flex; align-items: center; }
.search-icon-inside { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-color-muted); }

#main-search-input {
    width: 100%; padding: 10px 45px 10px 40px; border-radius: 20px; border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.05); color: #fff; outline: none; transition: 0.3s;
}
#main-search-input:focus { border-color: var(--primary-color); background: rgba(255,255,255,0.1); }

/* VOICE BUTTON */
.voice-icon-btn {
    position: absolute; right: 8px; background: rgba(255,255,255,0.08); border: 1px solid var(--glass-border);
    color: var(--ghost-color); border-radius: 50%; width: 32px; height: 32px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: 0.3s;
}
.voice-icon-btn:hover { background: var(--primary-color); border-color: var(--primary-color); }

/* VOICE MODAL & ANIMATION */
.voice-modal-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(13, 11, 20, 0.9) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid var(--primary-color) !important;
}

.voice-wave-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    gap: 8px;
    margin-bottom: 20px;
}

.wave {
    width: 8px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 10px;
    animation: wave-pulse 1.2s ease-in-out infinite;
}

.wave:nth-child(2) { animation-delay: 0.1s; }
.wave:nth-child(3) { animation-delay: 0.2s; }
.wave:nth-child(4) { animation-delay: 0.3s; }
.wave:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave-pulse {
    0%, 100% { height: 20px; opacity: 0.4; }
    50% { height: 60px; opacity: 1; box-shadow: 0 0 20px var(--primary-color); }
}

#voice-transcript {
    margin-top: 15px;
    color: var(--text-color-muted);
    font-style: italic;
    min-height: 1.2em;
}

/* TABS & FEED */
.content-tabs { display: flex; max-width: 600px; margin: 0 auto; overflow-x: auto; background: rgba(13, 11, 20, 0.7); border-bottom: 1px solid var(--glass-border); }
.tab-button { padding: 15px 20px; background: none; border: none; color: var(--text-color-muted); font-weight: bold; cursor: pointer; white-space: nowrap; text-decoration: none; border-bottom: 3px solid transparent; transition: 0.3s; }
.tab-button.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }

.social-feed-container { max-width: 600px; margin: 0 auto; padding: 20px 10px; }
.news-card { background: rgba(138, 43, 226, 0.08); backdrop-filter: blur(var(--blur-value)); border: 1px solid var(--glass-border); border-radius: 20px; margin-bottom: 25px; overflow: hidden; cursor: pointer; transition: 0.3s ease; }
.news-card:hover { transform: translateY(-5px); border-color: var(--primary-color); }
.news-card-image-container { height: 200px; width: 100%; overflow: hidden; }
.news-card-image-container img { width: 100%; height: 100%; object-fit: cover; }
.news-card-content { padding: 20px; }
.news-card h3 { color: var(--ghost-color); margin-bottom: 10px; font-size: 1.1em; }
.news-card p { color: var(--text-color-muted); font-size: 0.9em; line-height: 1.4; }

/* MODALS */
.modal-fullscreen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 3000; background: var(--bg-color); display: none; overflow-y: auto; }
.modal-content-wrapper { width: 100%; min-height: 100%; padding: 80px 20px 40px; background: rgba(13, 11, 20, 0.98); backdrop-filter: blur(20px); }
.modal-close-btn { position: fixed; top: 20px; right: 20px; font-size: 1.8em; background: var(--primary-color); border: none; color: var(--ghost-color); width: 45px; height: 45px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 3100; }
.modal-body-content { max-width: 800px; margin: 0 auto; }
#modal-title { color: var(--ghost-color); font-size: 1.8em; margin-bottom: 10px; }
#modal-subtitle { color: var(--primary-color); font-weight: bold; margin-bottom: 20px; display: block; }
.modal-main-image { width: 100%; border-radius: 15px; margin-bottom: 25px; border: 1px solid var(--glass-border); }
#modal-text { color: var(--ghost-color); line-height: 1.6; font-size: 1.05em; }

/* SUBMODALS GERAL */
.submodal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(15px); z-index: 4000; display: none; align-items: center; justify-content: center; }
.submodal-content { background: rgba(20, 20, 30, 0.95); border: 1px solid var(--primary-color); border-radius: 25px; padding: 25px; width: 90%; max-width: 400px; }
.submodal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.submodal-header h3 { color: var(--ghost-color); }
.submodal-header button { background: none; border: none; color: var(--primary-color); font-size: 2em; cursor: pointer; }
.engines-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sub-engine-item { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border); border-radius: 12px; padding: 12px; color: var(--ghost-color); text-decoration: none; display: flex; align-items: center; gap: 10px; font-size: 0.85em; transition: 0.3s; }
.sub-engine-item:hover { background: var(--primary-color); }

/* SUGGESTIONS & FOOTER */
.suggestions-section { margin-top: 30px; margin-bottom: 20px; }
.horizontal-suggestions { display: flex; gap: 15px; overflow-x: auto; padding: 10px 5px; scrollbar-width: thin; scrollbar-color: var(--primary-color) transparent; }
.suggestion-card { flex: 0 0 160px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border); border-radius: 15px; overflow: hidden; cursor: pointer; transition: 0.3s; }
.suggestion-card:hover { border-color: var(--primary-color); transform: translateY(-3px); }
.suggestion-card img { width: 100%; height: 90px; object-fit: cover; }
.suggestion-card h4 { padding: 8px; font-size: 0.75em; color: var(--ghost-color); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }

.related-sites-section { margin-top: 20px; border-top: 1px solid var(--glass-border); padding-top: 25px; }
.related-sites-title { font-size: 1.1em; margin-bottom: 20px; color: var(--ghost-color); display: flex; align-items: center; gap: 10px; }
.search-engines-container { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.engine-item { flex: 0 0 100px; height: 90px; background: rgba(138, 43, 226, 0.1); border: 1px solid var(--glass-border); border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: var(--ghost-color); transition: 0.3s; cursor: pointer; }
.engine-item i { font-size: 1.4em; color: var(--primary-color); margin-bottom: 8px; }
.engine-item span { font-size: 0.75em; font-weight: bold; }
.engine-item:hover { background: rgba(138, 43, 226, 0.2); border-color: var(--primary-color); }

.modal-footer-link { margin-top: 30px; text-align: center; }
#modal-original-link { color: var(--primary-color); text-decoration: none; font-weight: bold; }
.load-more-button { background: var(--primary-color); color: #fff; border: none; padding: 10px 25px; border-radius: 20px; cursor: pointer; font-weight: bold; transition: 0.3s; }
.load-more-button:hover { opacity: 0.8; }

@media (min-width: 1024px) {
    .sidebar { transform: translateX(0); }
    #main-content-wrapper { margin-left: 280px; }
    .menu-icon { display: none; }
    .top-nav-social, .content-tabs, .social-feed-container { max-width: 900px; }
                  }
