/* Reset et variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #000;
    --secondary-color: #666;
    --background-color: #fff;
    --border-color: #e0e0e0;
    --hover-color: #f5f5f5;
    --heart-color: #ff3040;
    --max-width: 600px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* Base */
body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--primary-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.username {
    font-weight: 500;
    font-size: 14px;
}

.login-btn, .logout-btn {
    padding: 8px 16px;
    border: 1px solid var(--primary-color);
    background: var(--primary-color);
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border-radius: 0;
}

.logout-btn {
    background: transparent;
    color: var(--primary-color);
}

.login-btn:hover {
    background: #333;
    border-color: #333;
}

.logout-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Main Content */
.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding-top: 80px;
}

/* Feed Tabs */
.feed-tabs {
    background: var(--background-color);
    position: sticky;
    top: 73px;
    z-index: 45;
    border-bottom: 1px solid var(--border-color);
}

.tabs-container {
    display: flex;
    padding: 0 20px;
}

.tab-button {
    flex: 1;
    padding: 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 15px;
    font-weight: 600;
    color: var(--secondary-color);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-family);
}

.tab-button:hover {
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-label {
    display: inline-block;
}

/* Filters */
.filters {
    padding: 20px;
    background: var(--background-color);
    position: sticky;
    top: 125px;
    z-index: 40;
    border-bottom: 1px solid var(--border-color);
}

.filter-container {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-group {
    flex-shrink: 0;
}

.filter-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--secondary-color);
    margin-bottom: 4px;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: white;
    font-size: 14px;
    font-family: var(--font-family);
    cursor: pointer;
    min-width: 120px;
}

/* News Feed */
.news-feed {
    padding: 20px;
}

/* News Card */
.news-card {
    margin-bottom: 24px;
    border: 1px solid var(--primary-color);
    background: white;
    transition: transform 0.2s;
}

.news-card:hover {
    transform: translateY(-2px);
}

.news-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    background: var(--hover-color);
}

.news-content {
    padding: 20px;
}

.news-title {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 12px;
    color: var(--primary-color);
    text-decoration: none;
    display: block;
}

.news-title:hover {
    text-decoration: underline;
}

.news-description {
    font-size: 16px;
    line-height: 1.5;
    color: var(--secondary-color);
    margin-bottom: 16px;
}

.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-source {
    font-size: 13px;
    color: var(--secondary-color);
}

.like-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    transition: transform 0.2s;
}

.like-btn:hover {
    transform: scale(1.1);
}

.like-btn svg {
    width: 24px;
    height: 24px;
    stroke: var(--primary-color);
    fill: none;
    stroke-width: 2;
}

.like-btn.liked svg {
    fill: var(--heart-color);
    stroke: var(--heart-color);
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.no-more-news {
    text-align: center;
    padding: 40px;
    color: var(--secondary-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 40px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
}

.close:hover {
    color: var(--secondary-color);
}

.login-step h2 {
    margin-bottom: 16px;
    font-size: 24px;
    font-weight: 800;
}

.login-step p {
    margin-bottom: 24px;
    color: var(--secondary-color);
}

.login-step input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    font-size: 16px;
    margin-bottom: 16px;
    font-family: var(--font-family);
}

.login-step input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.submit-btn {
    width: 100%;
    padding: 12px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.submit-btn:hover {
    background: #333;
}

.timer {
    margin-top: 16px;
    font-size: 14px;
    color: var(--secondary-color);
    text-align: center;
}

/* Responsive */
@media (max-width: 480px) {
    .filter-container {
        gap: 8px;
    }
    
    .filter-select {
        min-width: 100px;
        font-size: 13px;
    }
    
    .news-image {
        height: 250px;
    }
    
    .news-title {
        font-size: 18px;
    }
    
    .news-description {
        font-size: 15px;
    }
}