@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #000000;
    --secondary: #666666;
    --accent: #FF5A5F;
    --bg-light: #F8F9FA;
    --white: #FFFFFF;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --text-main: #111827;
    --text-muted: #6B7280;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius-full: 9999px;
    --radius-lg: 24px;
    --radius-md: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--white);
    color: var(--text-main);
    overflow-x: hidden;
    padding-bottom: 80px;
    /* Space for bottom nav */
}

/* Layout Containers */
.container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 15px;
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 20px;
    }
}

/* Typography */
h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 20px;
    font-weight: 600;
}

.text-muted {
    color: var(--text-muted);
    font-size: 14px;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--gray-200);
}

.logo-text {
    font-weight: 800;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 28px;
    height: 28px;
}

/* Featured Card (Trending) */
.trending-card {
    position: relative;
    width: 100%;
    height: 300px;
    background: #f0f0f0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

@media (min-width: 480px) {
    .trending-card {
        height: 350px;
    }
}

@media (min-width: 768px) {
    .trending-card {
        height: 400px;
    }
}

.trending-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
}

.badge-trending {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin: 8px 0;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    opacity: 0.9;
}

/* Category Chips */
.category-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 10px 20px 10px;
    scrollbar-width: none;
    margin: 0 -10px;
}

@media (min-width: 768px) {
    .category-scroll {
        padding: 4px 20px 20px 20px;
        margin: 0 -20px;
    }
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

.chip {
    padding: 10px 20px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.chip.active {
    background: var(--accent);
    color: white;
}

/* Article List Item */
.article-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-100);
}

.article-content {
    flex: 1;
}

.article-image {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background-color: var(--gray-100);
    /* Placeholder color while loading */
}

.article-category {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.article-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 450px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding: 12px 0 24px 0;
    border-top: 1px solid var(--gray-100);
    z-index: 200;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    gap: 4px;
    transition: all 0.2s;
}

.nav-item.active {
    color: var(--text-main);
}

.nav-icon {
    font-size: 20px;
}

.nav-item i {
    font-size: 22px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0.5;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade {
    animation: fadeIn 0.3s ease-out forwards;
}

/* Container Space Reservation */
.trending-card {
    min-height: 400px;
}

.category-scroll {
    min-height: 50px;
}

.article-item {
    min-height: 120px;
}