:root {
    /* Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --border-color: #e2e8f0;
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: #334155;
    --accent-primary: #60a5fa;
    --accent-secondary: #a78bfa;
    --accent-success: #34d399;
    --shadow: rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Navigation */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px var(--shadow);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.logo-icon {
    font-size: 2rem;
}

.highlight {
    color: var(--accent-primary);
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border-radius: 25px;
    padding: 0.5rem 1rem;
    width: 400px;
}

.search-bar input {
    background: transparent;
    border: none;
    outline: none;
    width: 100%;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.search-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
}

.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.cta-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow);
}

/* Category Navigation */
.nav-categories {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 2rem;
    overflow-x: auto;
    max-width: 1400px;
    margin: 0 auto;
}

.category-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.category-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.category-link.active {
    background: var(--accent-primary);
    color: white;
}

/* Hero Section */
.hero-section {
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
}

.featured-card {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    padding: 3rem;
    border-radius: 20px;
    color: white;
    box-shadow: 0 10px 40px var(--shadow);
}

.featured-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.4rem 1rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.featured-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.featured-excerpt {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.featured-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.meta-item {
    font-size: 0.95rem;
}

.read-more-btn {
    background: white;
    color: var(--accent-primary);
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 25px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Content Grid */
.content-section {
    padding: 3rem 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.section-title {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    font-weight: 800;
}

/* Article Cards */
.article-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
    border-color: var(--accent-primary);
}

.card-tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.card-tag.wifi { background: #dbeafe; color: #1e40af; }
.card-tag.security { background: #fee2e2; color: #991b1b; }
.card-tag.bluetooth { background: #e0e7ff; color: #3730a3; }
.card-tag.troubleshooting { background: #fef3c7; color: #92400e; }
.card-tag.iot { background: #d1fae5; color: #065f46; }

.card-title {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.card-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.card-meta {
    display: flex;
    gap: 0.5rem;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-widget {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.widget-title {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 700;
}

/* Trending List */
.trending-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.trending-item {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0.8rem;
    background: var(--bg-tertiary);
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.trending-item:hover {
    transform: translateX(5px);
}

.trending-number {
    background: var(--accent-primary);
    color: white;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    flex-shrink: 0;
}

.trending-item h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.trending-views {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* Newsletter Widget */
.newsletter {
    background: linear-gradient(135deg, var(--accent-success), #059669);
    color: white;
}

.newsletter .widget-title {
    color: white;
}

.newsletter p {
    opacity: 0.9;
    margin-bottom: 1rem;
}

.newsletter-input {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 10px;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.newsletter-btn {
    width: 100%;
    background: white;
    color: var(--accent-success);
    padding: 0.8rem;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-btn:hover {
    transform: translateY(-2px);
}

/* Sidebar Podcast List */
.sidebar-podcast-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-podcast-item {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.sidebar-podcast-meta {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.sidebar-podcast-num {
    background: var(--accent-primary);
    color: white;
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.sidebar-podcast-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.sidebar-podcast-audio {
    display: none;
}

.sidebar-podcast-actions {
    display: flex;
    gap: 0.5rem;
}

.sidebar-play-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    flex: 1;
}

.sidebar-play-btn:hover {
    background: var(--accent-secondary);
}

.sidebar-play-btn.playing {
    background: #dc2626;
}

.sidebar-podcast-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.sidebar-podcast-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
}

.sidebar-podcast-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-primary);
    border-radius: 4px;
    transition: width 0.3s linear;
}

.sidebar-podcast-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
}

.newsletter-coming-soon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-align: center;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
}

/* Quick Links */
.quick-links {
    list-style: none;
}

.quick-links li {
    margin-bottom: 0.8rem;
}

.quick-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.quick-links a:hover {
    color: var(--accent-primary);
    padding-left: 5px;
}

/* Ad Widget */
.ad-placeholder {
    background: var(--bg-tertiary);
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 2px dashed var(--border-color);
}

/* Categories Section */
.categories-section {
    padding: 3rem 0;
    background: var(--bg-primary);
}

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

.category-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--shadow);
    border-color: var(--accent-primary);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.category-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.category-card p {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

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

.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 700;
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.6;
}

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

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--accent-primary);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-tertiary);
}

.visitor-counter {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Search Box */
.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.articles-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    flex: 1;
}

.category-chip {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.3rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.category-chip:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.category-chip.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.sort-controls {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
}

.sort-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.sort-btn:hover {
    background: var(--bg-tertiary);
}

.sort-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.search-input {
    width: 100%;
    padding: 0.75rem 2.8rem 0.75rem 1.1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
}

/* Search Results */
.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.search-result-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.2rem 1.5rem;
    transition: all 0.25s ease;
}

.search-result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px var(--shadow);
    border-color: var(--accent-primary);
}

.search-result-tag {
    display: inline-block;
    background: #e0f2fe;
    color: #0284c7;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.search-result-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.search-result-title:hover {
    color: var(--accent-primary);
}

.search-result-excerpt {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.6rem;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    flex-wrap: wrap;
}

.search-result-podcast-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.25rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-result-podcast-btn:hover {
    background: var(--accent-secondary);
}

.search-result-podcast-btn.playing {
    background: #dc2626;
}

.search-no-results {
    color: var(--text-tertiary);
    font-size: 0.95rem;
    padding: 1rem 0;
}

/* Podcast Cards */
.podcasts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 2rem;
}

.podcast-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.3s ease;
}

.podcast-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px var(--shadow);
    border-color: var(--accent-primary);
}

.podcast-episode-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    text-transform: uppercase;
    width: fit-content;
}

.podcast-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}

.podcast-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.podcast-player {
    width: 100%;
    border-radius: 8px;
    accent-color: var(--accent-primary);
}

.podcast-article-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.podcast-article-link:hover {
    color: var(--accent-secondary);
}

/* Responsive */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .search-bar {
        width: 100%;
    }

    .featured-title {
        font-size: 1.8rem;
    }

    .nav-categories {
        padding: 1rem;
    }
}
