/* Reset & Base */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-dark: #1e0b36;
    --bg-card: #2a124a;
    --bg-sidebar: #130024;
    --bg-header: #130024;
    --text-main: #ffffff;
    --text-muted: #bca5d1;
    --accent: #ffaf00;
    --accent-hover: #ffcc4d;
    --border-color: #3d1b6a;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
    border-radius: var(--radius-sm);
}

/* Layout Grid */
.app-container {
    display: grid;
    grid-template-areas: 
        "header header header"
        "sidebar-left main sidebar-right"
        "footer footer footer";
    grid-template-columns: 240px 1fr 300px;
    grid-template-rows: 70px 1fr auto;
    min-height: 100vh;
}

/* Header */
.main-header {
    grid-area: header;
    background-color: var(--bg-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-bar {
    flex: 0 1 400px;
    position: relative;
}

.search-input {
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    color: var(--text-main);
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.header-actions {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 14px;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--accent);
    color: #000;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Sidebar Left */
.sidebar-left {
    grid-area: sidebar-left;
    background-color: var(--bg-sidebar);
    padding: 24px 16px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.nav-menu h3 {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-left: 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
}

.nav-link:hover, .nav-link.active {
    background-color: var(--bg-card);
    color: var(--text-main);
}

.nav-icon {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    grid-area: main;
    padding: 24px;
    overflow-y: auto;
}

/* Hero Section */
.hero-card {
    background: linear-gradient(135deg, #4a1c85 0%, #2a124a 100%);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.hero-content {
    flex: 1;
    z-index: 2;
}

.hero-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.2;
}

.hero-subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 16px;
    max-width: 80%;
}

.hero-image {
    flex: 0 0 40%;
    z-index: 1;
    opacity: 0.8;
}

/* Grid Layout for Articles */
.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.article-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow);
    border-color: var(--border-color);
}

.card-image {
    height: 140px;
    background-color: #3d1b6a;
    position: relative;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-excerpt {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.read-btn {
    background-color: var(--accent);
    color: #000;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* Sidebar Right (Activity/Feed) */
.sidebar-right {
    grid-area: sidebar-right;
    background-color: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feed-item {
    background-color: var(--bg-card);
    padding: 12px;
    border-radius: var(--radius-sm);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.feed-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #000;
    font-size: 12px;
}

.feed-content {
    flex: 1;
}

.feed-user {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 4px;
}

.feed-action {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Article Detail Page Styles */
.article-detail {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
}

.article-header {
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
}

.article-header h1 {
    font-size: 36px;
    margin-bottom: 16px;
    color: var(--text-main);
}

.article-meta {
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    gap: 16px;
}

.article-body {
    font-size: 18px;
    line-height: 1.8;
    color: #e0e0e0;
}

.article-body h2 {
    color: var(--accent);
    margin-top: 40px;
    margin-bottom: 20px;
    font-size: 24px;
}

.article-body p {
    margin-bottom: 20px;
}

.article-body ul {
    list-style: disc;
    margin-left: 24px;
    margin-bottom: 24px;
    color: var(--text-muted);
}

.article-body li {
    margin-bottom: 10px;
}

.faq-section {
    margin-top: 60px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.faq-item {
    margin-bottom: 24px;
}

.faq-question {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    font-size: 18px;
}

.faq-answer {
    color: var(--text-muted);
}

/* Footer */
.main-footer {
    grid-area: footer;
    background-color: var(--bg-sidebar);
    padding: 40px 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
}

.footer-links a:hover {
    color: var(--accent);
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 200px 1fr;
        grid-template-areas: 
            "header header"
            "sidebar-left main"
            "footer footer";
    }
    .sidebar-right {
        display: none;
    }
}

@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "header"
            "main"
            "footer";
    }
    
    .sidebar-left {
        display: none; /* Hidden by default on mobile, toggled via JS */
        position: fixed;
        top: 70px;
        left: 0;
        bottom: 0;
        width: 250px;
        z-index: 99;
    }

    .sidebar-left.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .hero-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-image {
        display: none;
    }
    
    .article-detail {
        padding: 20px;
    }
    
    .article-header h1 {
        font-size: 28px;
    }
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 24px;
    cursor: pointer;
}

@media (min-width: 769px) {
    .menu-toggle {
        display: none;
    }
}
