/* ========================================
   GLOBAL STYLES
   ======================================== */

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

:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #667eea;
    --text-color: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --border-color: #ecf0f1;
    --shadow: 0 2px 10px rgba(0,0,0,0.05);
    --shadow-hover: 0 5px 20px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */

.site-header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.logo a:hover {
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s;
}

.nav-menu a:hover::after {
    width: 100%;
}

.mega-trigger .arrow {
    font-size: 0.8rem;
    margin-left: 0.3rem;
    transition: transform 0.3s;
}

.has-mega-menu:hover .arrow {
    transform: rotate(180deg);
}

.random-link {
    background: var(--bg-light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.search-link {
    font-size: 1.2rem;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5rem 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,133.3C960,128,1056,96,1152,96C1248,96,1344,128,1392,144L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    animation: fadeInUp 0.8s ease;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 3rem;
    opacity: 0.95;
    animation: fadeInUp 0.8s ease 0.2s both;
}

/* Search Box */
.search-box {
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.search-input {
    width: 100%;
    padding: 1.2rem 3.5rem 1.2rem 1.5rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    transition: box-shadow 0.3s;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 6px 30px rgba(0,0,0,0.3);
}

.search-button {
    position: absolute;
    right: 5px;
    top: 5px;
    bottom: 5px;
    padding: 0 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.search-button:hover {
    background: #2980b9;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-top: 0.5rem;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

/* Popular Tags */
.popular-tags {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.6s both;
}

.popular-tag {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.3);
}

.popular-tag:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* ========================================
   CATEGORY GRID
   ======================================== */

.categories {
    padding: 4rem 0;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color) 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

.category-card h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.category-count {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.category-topics {
    list-style: none;
    color: var(--text-light);
    font-size: 0.9rem;
}

.category-topics li {
    padding: 0.3rem 0;
}

/* Category Hover Effect */
.category-hover {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(52, 152, 219, 0.95);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.category-card:hover .category-hover {
    opacity: 1;
    transform: scale(1);
}

.category-hover p {
    margin-bottom: 1rem;
    text-align: center;
}

.btn-explore {
    background: white;
    color: var(--primary-color);
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-explore:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* ========================================
   CONTENT SECTIONS
   ======================================== */

.content-section {
    padding: 3rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    color: var(--secondary-color);
    font-size: 2rem;
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.view-all:hover {
    transform: translateX(5px);
}

/* Trending List */
.trending-list {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.trending-item {
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s;
}

.trending-item:hover {
    background: var(--bg-light);
    margin: 0 -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.trending-item:last-child {
    border-bottom: none;
}

.trending-number {
    font-size: 2rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--accent-color) 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    width: 40px;
}

.trending-content {
    flex: 1;
}

.trending-title {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.3rem;
}

.trending-title:hover {
    color: var(--primary-color);
}

.trending-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
}

.category-tag {
    background: var(--bg-light);
    padding: 0.2rem 0.6rem;
    border-radius: 15px;
    color: var(--text-light);
}

.read-time {
    color: #95a5a6;
}

/* Featured Grid */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.featured-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.featured-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.featured-image {
    height: 200px;
    background: linear-gradient(135deg, var(--accent-color) 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.featured-icon {
    font-size: 4rem;
    color: white;
    animation: float 3s ease-in-out infinite;
}

.featured-category {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.9);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.featured-content {
    padding: 1.5rem;
}

.featured-content h3 {
    color: var(--secondary-color);
    margin-bottom: 0.8rem;
}

.featured-content p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s;
}

.read-more:hover {
    transform: translateX(5px);
}

/* Topic Explorer */
.topic-explorer-section {
    background: white;
    border-radius: 15px;
    padding: 3rem;
    margin: 3rem 0;
}

.topic-explorer {
    text-align: center;
}

.explorer-prompt {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.topic-tag {
    background: var(--bg-light);
    border: 2px solid transparent;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-color);
    font-weight: 500;
}

.topic-tag:hover {
    background: white;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.surprise-me-btn {
    background: linear-gradient(135deg, var(--accent-color) 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    animation: pulse 2s infinite;
}

.surprise-me-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* ========================================
   FOOTER
   ======================================== */

.site-footer {
    background: var(--secondary-color);
    color: white;
    padding: 3rem 1rem 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    line-height: 2;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.newsletter {
    background: rgba(255,255,255,0.1);
    padding: 1.5rem;
    border-radius: 10px;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.newsletter-form input {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 5px;
    background: rgba(255,255,255,0.9);
}

.newsletter-form button {
    padding: 0.8rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.newsletter-form button:hover {
    background: #2980b9;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #95a5a6;
}

/* ========================================
   MOBILE MENU
   ======================================== */

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    overflow-y: auto;
    z-index: 1001;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
}

.mobile-nav {
    list-style: none;
    padding: 1rem;
}

.mobile-nav li {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
}

.mobile-categories {
    padding: 1rem;
}

.mobile-categories h4 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.mobile-category-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.mobile-category {
    background: var(--bg-light);
    padding: 0.8rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-color);
    text-align: center;
    transition: all 0.3s;
}

.mobile-category:hover {
    background: var(--primary-color);
    color: white;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

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

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .topic-tags {
        gap: 0.5rem;
    }
    
    .topic-tag {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
}