/* 기본 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 헤더 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.last-update {
    font-size: 0.9rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.refresh-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.refresh-btn:hover {
    opacity: 1;
    transform: rotate(180deg);
    background: rgba(255, 255, 255, 0.1);
}

/* 네비게이션 */
.nav {
    background: white;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-list {
    display: flex;
    list-style: none;
    overflow-x: auto;
    padding: 0;
}

.nav-link {
    display: block;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* 메인 콘텐츠 */
.main {
    padding: 2rem 0;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.news-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
}

/* 뉴스 이미지 스타일 */
.news-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    background-color: #f8f9fa;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* 이미지가 없는 카드의 경우 헤더에 패딩 추가 */
.news-card:not(:has(.news-image)) .news-header {
    padding-top: 1.5rem;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}



.news-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f1f3f4;
}

.news-source {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.source-logo {
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
    border-radius: 3px;
}

.source-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
}

.news-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.news-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.news-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-title a:hover {
    color: #1976d2;
}

.news-summary {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #999;
}

.news-time {
    display: flex;
    align-items: center;
}

.news-time::before {
    content: "🕒";
    margin-right: 0.25rem;
}

.news-hits {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: #666;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    margin-left: 0.5rem;
}

.news-hits i {
    color: #667eea;
    font-size: 0.8rem;
}

.hits-count {
    font-weight: 500;
    color: #333;
}

/* 로딩 스피너 */
.loading {
    text-align: center;
    padding: 3rem 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 푸터 */
.footer {
    background: #2c3e50;
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

.footer p {
    margin-bottom: 0.5rem;
}

.sources {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .nav-list {
        justify-content: flex-start;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .news-card {
        margin-bottom: 1rem;
    }
    
    .news-image {
        height: 150px;
    }
    
    .news-header {
        padding: 1rem;
    }
    
    .news-title {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1.5rem 0;
    }
    
    .logo {
        font-size: 1.8rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .main {
        padding: 1rem 0;
    }
    
    .news-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* 카테고리별 색상 */
.category-politics { background: #ffebee; color: #c62828; }
.category-economy { background: #e8f5e8; color: #2e7d32; }
.category-society { background: #fff3e0; color: #ef6c00; }
.category-international { background: #e3f2fd; color: #1976d2; }
.category-culture { background: #f3e5f5; color: #7b1fa2; }
.category-sports { background: #e0f2f1; color: #00695c; }

/* 숨김 클래스 */
.hidden {
    display: none !important;
} 