/* ===================================
   MODERN UI - OpenAI/ChatGPT Style
   =================================== */

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

:root {
    --primary: #10a37f;
    /* OpenAI Green */
    --primary-hover: #0d7d61;
    --sidebar-bg: #202123;
    /* ChatGPT Dark Sidebar */
    --main-bg: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6e6e80;
    --text-sidebar: #ececf1;
    --border: #ececf1;
    --border-sidebar: #4d4d4f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    font-family: var(--font-body);
    background: var(--main-bg);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ================
   SIDEBAR
   ================ */

.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-sidebar);
}

.logo h1 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.logo .subtitle {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Wing Navigation in Sidebar */
.wing-nav {
    flex-grow: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wing-btn,
.wing-link {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-sidebar);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.wing-btn:hover,
.wing-link:hover {
    background: #2a2b32;
    color: #ffffff;
}

.wing-btn.active,
.wing-link.active {
    background: #343541;
    color: #ffffff;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-sidebar);
}

.user-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #9ca3af;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary);
}

/* ================
   MAIN CONTENT
   ================ */

.main-container {
    flex-grow: 1;
    margin-left: 260px;
    padding: 40px 60px;
    max-width: 100%;
}

/* ================
   ARTICLE HEADER NAV (ChatGPT-style)
   ================ */

.article-header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 950;
    min-height: 56px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-btn {
    background: none;
    border: none;
    padding: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: #f3f4f6;
    color: var(--text-primary);
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.breadcrumbs .separator {
    color: #d1d5db;
}

.breadcrumbs .active {
    color: var(--text-primary);
}

.mobile-header {
    display: none;
    padding: 12px 16px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 900;
}

.logo-small {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.content-header {
    margin-bottom: 40px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.content-header h2 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.content-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Article Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Article Card */
.article-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    border-color: #d1d5db;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-image {
    width: 100%;
    height: 180px;
    background-color: #f3f4f6;
    background-size: cover;
    background-position: center;
}

.card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.article-card h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
    color: var(--text-primary);
}

.article-card .meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.article-card .category {
    color: var(--primary);
    text-transform: uppercase;
}

.article-card .excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card .stats {
    margin-top: auto;
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #9ca3af;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ================
   STATES
   ================ */

.empty-state,
.loading-state {
    text-align: center;
    padding: 80px 24px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

@media (max-width: 1024px) {
    .main-container {
        padding: 40px 24px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-container {
        margin-left: 0;
        padding-top: 20px;
    }

    .mobile-header {
        display: flex;
    }

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