@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.8);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --accent: #f43f5e;
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --radius: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --primary: #818cf8;
    --primary-hover: #6366f1;
    --bg-main: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.05);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.5s ease;
    padding-top: 80px; /* Space for fixed navbar */
}

/* Background Decoration */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.15;
    filter: blur(100px);
    border-radius: 50%;
    animation: move 25s infinite alternate;
}

.blob-1 { top: -20%; left: -10%; animation-delay: 0s; }
.blob-2 { bottom: -20%; right: -10%; background: radial-gradient(circle, var(--accent) 0%, transparent 70%); animation-delay: -5s; }

@keyframes move {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(150px, 150px) scale(1.3); }
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.btn-theme {
    background: transparent;
    border: 1px solid var(--glass-border);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}

.btn-theme:hover {
    background: var(--primary);
    color: white;
}

/* Layout */
.container {
    width: 90%;
    max-width: 1000px;
    margin: 3rem auto;
}

header {
    text-align: center;
    margin-bottom: 4rem;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Hero Section */
.hero h1 {
    font-size: 4rem;
    background: linear-gradient(135deg, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Search Area */
.search-section {
    margin-bottom: 4rem;
}

.search-container {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.search-bar {
    width: 100%;
    padding: 1.5rem 2rem;
    padding-right: 4.5rem;
    font-size: 1.3rem;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
    color: var(--text-main);
    transition: var(--transition);
    outline: none;
}

.search-bar:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.search-icon {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1.5rem;
    cursor: pointer;
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    margin-top: 1rem;
    box-shadow: var(--shadow);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    border: 1px solid var(--glass-border);
}

.suggestion-item {
    padding: 1rem 2rem;
    cursor: pointer;
    transition: var(--transition);
}

.suggestion-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border-radius: var(--radius);
    padding: 2.5rem;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Featured Grid */
.featured-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.mini-card h3 {
    margin-bottom: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.stat-val {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Word of the Day */
.wotd {
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 2.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.wotd:hover {
    transform: scale(1.02);
}

.wotd h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.wotd .word {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

/* Action Cards */
.action-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.action-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    text-decoration: none;
    color: var(--text-main);
    transition: var(--transition);
}

.action-card i {
    font-size: 2.5rem;
    color: var(--primary);
}

.action-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

/* Alphabet Nav */
.alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.alpha-btn {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
    color: var(--text-main);
}

.alpha-btn:hover, .alpha-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-3px);
}

/* Word Index Grid */
.word-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.word-item {
    padding: 1rem;
    background: var(--bg-main);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-weight: 500;
}

.word-item:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

/* Definitions */
.word-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.word-title {
    font-size: 3rem;
    font-weight: 800;
}

.definition-item {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
    position: relative;
    line-height: 1.7;
    font-size: 1.1rem;
}

.definition-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7rem;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--accent);
    transform: scale(1.2);
}

/* About Content */
.about-card .content {
    line-height: 1.8;
}

.about-card h2 {
    margin: 2rem 0 1rem 0;
    color: var(--primary);
}

/* Footer */
footer {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-muted);
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
}

/* Utilities */
.hidden { display: none; }
.btn-small {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.btn-small:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.load-more {
    display: block;
    width: 200px;
    margin: 3rem auto 0;
    padding: 1.2rem;
    border-radius: var(--radius);
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
}

.load-more:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    .hero h1 { font-size: 3rem; }
    .featured-grid, .action-cards { grid-template-columns: 1fr; }
    .nav-links { display: none; }
}

/* ============================================
   HAMBURGER MOBILE MENU
   ============================================ */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Dropdown Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1100;
    padding: 1rem 0;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    animation: slideDown 0.3s ease;
}

.mobile-menu.open {
    display: flex;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.mobile-menu a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition);
}

.mobile-menu a:last-child { border-bottom: none; }

.mobile-menu a:hover, .mobile-menu a.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.06);
    padding-left: 2.5rem;
}

.mobile-menu a i {
    width: 22px;
    text-align: center;
    color: var(--primary);
}

@media (max-width: 768px) {
    .hamburger { display: flex; }
    .nav-links { display: none !important; }
    body { padding-left: 0 !important; padding-right: 0 !important; }
    .ad-left, .ad-right { display: none !important; }
    .ad-top, .ad-bottom { display: none !important; }
}

/* ============================================
   GOOGLE ADSENSE AD SLOTS - FIXED POSITIONS
   ============================================ */

/* TOP BANNER - Sticky Leaderboard 728x90 */
.ad-top {
    position: fixed;
    top: 80px; /* Below the navbar */
    left: 50%;
    transform: translateX(-50%);
    width: 728px;
    max-width: 95vw;
    height: 90px;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
    overflow: hidden;
}

/* BOTTOM BANNER - Sticky Leaderboard 728x90 */
.ad-bottom {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 728px;
    max-width: 95vw;
    height: 90px;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-border);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 20px rgba(99, 102, 241, 0.1);
    overflow: hidden;
}

/* LEFT SIDEBAR - Sticky Skyscraper 160x600 */
.ad-left {
    position: fixed;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    width: 160px;
    height: 600px;
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 4px 0 20px rgba(99, 102, 241, 0.1);
    overflow: hidden;
}

/* RIGHT SIDEBAR - Sticky Skyscraper 160x600 */
.ad-right {
    position: fixed;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 160px;
    height: 600px;
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: -4px 0 20px rgba(99, 102, 241, 0.1);
    overflow: hidden;
}

/* Placeholder text inside ad slot (shows while AdSense loads) */
.ad-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
    opacity: 0.5;
    pointer-events: none;
    text-align: center;
    padding: 0.5rem;
}

.ad-placeholder i {
    font-size: 1.4rem;
    color: var(--primary);
    opacity: 0.6;
}

/* Adjust body so content is not hidden behind fixed ads */
body {
    padding-left: 180px;
    padding-right: 180px;
    padding-bottom: 100px;
}

/* Hide side ads on smaller screens */
@media (max-width: 1300px) {
    .ad-left, .ad-right {
        display: none;
    }
    body {
        padding-left: 0;
        padding-right: 0;
    }
}

/* Hide top/bottom on very small screens */
@media (max-width: 740px) {
    .ad-top, .ad-bottom {
        display: none;
    }
    body {
        padding-bottom: 0;
    }
}
