:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent-color: #00b4d8;
    --accent-hover: #0096c7;
    --accent-gradient: linear-gradient(135deg, #00b4d8 0%, #0096c7 50%, #0077b6 100%);
    --bg-dark: #023e8a;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 30px rgba(0, 180, 216, 0.2);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
}

[data-theme="dark"] {
    --bg-primary: #0a1628;
    --bg-secondary: #0f1f35;
    --bg-tertiary: #1a2d47;
    --bg-card: #0f1f35;
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --accent-color: #00d4ff;
    --accent-hover: #00b4d8;
    --border-color: #1a2d47;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul { list-style: none; }

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* HEADER */
.header {
    grid-column: 1 / -1;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 32px;
    width: auto;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-primary);
    padding: 0.35rem;
    transition: color var(--transition-fast);
}

.sidebar-toggle:hover { color: var(--accent-color); }

.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    padding: 0 0.75rem;
    border: 1px solid var(--border-color);
    height: 34px;
    transition: border-color var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--accent-color);
}

.search-box input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    width: 140px;
    outline: none;
    font-family: inherit;
    height: 100%;
}

.search-box input::placeholder { color: var(--text-muted); }

.search-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    display: flex;
    align-items: center;
}

.search-btn:hover { color: var(--accent-color); }

.btn-login {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--accent-color);
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-login:hover {
    background: var(--accent-hover);
}

@media (max-width: 1024px) {
    .sidebar-toggle { display: flex; }
}

@media (max-width: 600px) {
    .search-box { display: none; }
    .btn-login span { display: none; }
}

.sidebar-toggle {
    display: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}



/* SIDEBAR */
.sidebar {
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo a {
    display: flex;
    align-items: center;
}

.sidebar-logo img {
    height: 32px;
    width: auto;
}

.sidebar-nav ul {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.875rem;
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.sidebar-nav a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-nav a.active {
    background: var(--accent-color);
    color: #fff;
}

.cat-icon { font-size: 1.1rem; width: 22px; text-align: center; }

.sidebar-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.sidebar-section h3 {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.75rem;
}

.tools-list {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.tools-list a {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.875rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.tools-list a::before {
    content: '#';
    color: var(--accent-color);
    font-weight: 700;
    margin-right: 0.5rem;
    opacity: 0;
    transition: all var(--transition-fast);
}

.tools-list a:hover {
    color: var(--accent-color);
    background: var(--bg-tertiary);
}

.tools-list a:hover::before { opacity: 1; }

/* SIDEBAR DROPDOWN MENU */
.sidebar-dropdown .sidebar-submenu {
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 1rem;
}

.sidebar-dropdown.open .sidebar-submenu {
    max-height: 600px;
}

.sidebar-dropdown-toggle {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.sidebar-dropdown-toggle span {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.sidebar-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.sidebar-submenu li a {
    font-size: 0.82rem;
    padding: 0.5rem 0.875rem 0.5rem 1rem;
}

.sidebar-submenu li a.active {
    background: var(--accent-color);
    color: #fff;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

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

/* MAIN CONTENT */
.main-content {
    padding: 20px;
    min-height: 100vh;
}

/* HERO */
.hero-banner {
    background: var(--bg-dark);
    border-radius: var(--border-radius-lg);
    padding: 4rem 3.5rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 180, 216, 0.3) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 150, 199, 0.3) 0%, transparent 70%);
    border-radius: 50%;
}

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

.hero-content h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.75rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.75rem;
    line-height: 1.1;
}

.hero-content h1 span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-bottom: 1.5rem;
    max-width: 500px;
}

.hero-btn {
    display: inline-flex;
    padding: 0.875rem 2rem;
    background: var(--accent-color);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.hero-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 180, 216, 0.3);
}

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

.section-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.view-all {
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 600;
}

.view-all:hover { text-decoration: underline; }

.featured-section,
.latest-section,
.tools-section {
    margin-bottom: 3rem;
}

/* ARTICLES */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.featured-grid { grid-template-columns: 1fr 1fr; }

.article-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-color);
}

.article-card.featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.article-image {
    position: relative;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.article-card:hover .article-image img { transform: scale(1.05); }

.article-card.featured .article-image img {
    height: 100%;
    min-height: 300px;
}

.article-category {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.3rem 0.75rem;
    background: var(--accent-color);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: var(--border-radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-content { padding: 1.25rem; }

.article-content h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.article-content h3 a:hover { color: var(--accent-color); }

.article-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.article-meta .author {
    color: var(--accent-color);
    font-weight: 600;
}

/* TOOLS */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color);
    box-shadow: var(--shadow-glow);
}

.tool-icon { font-size: 2.5rem; margin-bottom: 1rem; }

.tool-card h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
}

.tool-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* NEWSLETTER */
.newsletter-section {
    background: var(--bg-dark);
    border-radius: var(--border-radius-lg);
    padding: 3rem;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.newsletter-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(0, 150, 199, 0.3) 0%, transparent 70%);
    border-radius: 50%;
}

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

.newsletter-content h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.newsletter-content p {
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

.newsletter-form {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    max-width: 450px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 1px solid #334155;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    background: #1e293b;
    color: #fff;
    outline: none;
    font-family: inherit;
}

.newsletter-form input:focus { border-color: var(--accent-color); }

.newsletter-form button {
    padding: 0.875rem 1.5rem;
    background: var(--accent-color);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.newsletter-form button:hover { background: var(--accent-hover); }

/* RIGHT SIDEBAR */
.right-sidebar {
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    padding: 1.5rem;
    height: calc(100vh);
    position: sticky;
    top: 0px;
    overflow-y: auto;
}

.widget {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.widget:last-child { border-bottom: none; }

.widget h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.trending-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.trending-list li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.trending-list li:hover {
    background: var(--bg-tertiary);
    transform: translateX(2px);
}

.trend-number {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-color);
    min-width: 28px;
}

.trend-content a {
    font-size: 0.85rem;
    font-weight: 600;
    display: block;
    margin-bottom: 0.125rem;
}

.trend-content a:hover { color: var(--accent-color); }

.trend-author {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* TAGS */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.875rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 100px;
    transition: all var(--transition-fast);
}

.tag::before {
    content: '#';
    color: var(--accent-color);
    margin-right: 0.125rem;
    font-weight: 700;
}

.tag:hover {
    background: var(--accent-color);
    color: #fff;
}

/* NAV WIDGET */
.nav-widget {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.nav-widget a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.nav-widget a:hover {
    background: var(--bg-tertiary);
    color: var(--accent-color);
}

/* FOOTER */
.footer {
    grid-column: 1 / -1;
    background: var(--bg-dark);
    margin-top: auto;
    z-index: 999;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.875rem 1.5rem;
}

.footer-copy {
    font-size: 0.78rem;
    color: #94a3b8;
    white-space: nowrap;
}

.footer-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.footer-nav a {
    font-size: 0.78rem;
    color: #94a3b8;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    transition: color var(--transition-fast);
    white-space: nowrap;
}

.footer-nav a:hover {
    color: #fff;
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    color: #94a3b8;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.footer-social a:hover {
    background: var(--accent-color);
    color: #fff;
}

@media (max-width: 768px) {
    .footer-inner {
        flex-direction: column;
        text-align: center;
        padding: 0.75rem 1rem;
    }
    .footer-nav { justify-content: center; }
    .footer-social { justify-content: center; }
}

/* CATEGORY HEADER */
.category-hero {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    margin-bottom: 2.5rem;
    background: var(--bg-dark);
}

.category-icon-large { font-size: 3.5rem; }

.category-hero h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.375rem;
}

.category-hero p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    body { grid-template-columns: 220px 1fr; }
    .right-sidebar { display: none; }
}

@media (max-width: 1024px) {
    body { grid-template-columns: 1fr; }
    
    .sidebar {
        position: fixed;
        left: -280px;
        top: 20px;
        height: 100vh;
        width: 280px;
        z-index: 999;
        transition: left var(--transition-normal);
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.active { left: 0; }
    .sidebar-toggle { display: flex; }
    .featured-grid { grid-template-columns: 1fr; }
    .article-card.featured { grid-template-columns: 1fr; }
    .footer-container { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .header-container { padding: 0.75rem 1rem; }
    .search-box { display: none; }
    .hero-banner { padding: 2.5rem 1.5rem; }
    .hero-content h1 { font-size: 1.75rem; }
    .main-content { padding: 20px; }
    .articles-grid { grid-template-columns: 1fr; }
    .tools-grid { grid-template-columns: 1fr 1fr; }
    .newsletter-form { flex-direction: column; }
    .footer-container { grid-template-columns: 1fr; }
    .banner-sidebar { display: none; }
}

/* ============================================
   BANNER SYSTEM STYLES
   ============================================ */

.banner-placeholder {
    min-height: 0;
    margin: 1.5rem 0;
    position: relative;
}

.banner-placeholder:empty {
    display: none;
}

.banner-placeholder:empty::after {
    content: none;
}

.banner-topo {
    text-align: center;
    padding: 0.5rem 0;
}

.banner-sidebar {
    margin-bottom: 1.5rem;
}

.banner-meio {
    text-align: center;
    padding: 0.5rem 0;
}

.banner-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-sm);
    background: var(--bg-tertiary);
}

.banner-link {
    display: block;
    line-height: 0;
}

.banner-image {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.2s;
}

.banner-link:hover .banner-image {
    opacity: 0.9;
}

.banner-content {
    width: 100%;
}

.banner-content img {
    max-width: 100%;
    height: auto;
}

.banner-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    padding: 2px 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: var(--bg-tertiary);
}

.banner-loaded {
    animation: bannerFadeIn 0.3s ease;
}

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