/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

/* 헤더 */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header .subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

/* 컨트롤 영역 */
.controls {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: flex-start;
}

.filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-weight: 600;
    color: #555;
}

.filter-group select {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    transition: border-color 0.3s;
}

.filter-group select:focus {
    outline: none;
    border-color: #667eea;
}

.search-group {
    display: flex;
    gap: 10px;
}

.search-group input {
    padding: 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    width: 250px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.search-group input:focus {
    outline: none;
    border-color: #667eea;
}

.search-group button, .refresh-btn {
    padding: 10px 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.search-group button:hover, .refresh-btn:hover {
    background: #5a67d8;
}

/* 통계 영역 */
.stats {
    background: white;
    border-radius: 15px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    align-items: center;
    justify-content: space-between;
}

.stats .stat-item.last-update {
    flex-basis: 100%;
    justify-content: center;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #555;
}

.stat-item i {
    color: #667eea;
}

/* 로딩 */
.loading {
    text-align: center;
    padding: 40px;
    color: white;
    font-size: 1.2em;
}

.loading i {
    margin-right: 10px;
}

.hidden {
    display: none;
}

/* 게시물 컨테이너 */
.posts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* 게시물 카드 */
.post-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    border-left: 4px solid #667eea;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.site-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.site-badge.bobae {
    background: #ff6b6b;
    color: white;
}

.site-badge.ruliweb {
    background: #ff9f43;
    color: white;
}

.site-badge.ppomppu {
    background: #4ecdc4;
    color: white;
}

.site-badge.fmkorea {
    background: #45b7d1;
    color: white;
}

.site-badge.dcinside {
    background: #96ceb4;
    color: white;
}

.site-badge.dogdrip {
    background: #caabd6;
    color: white;
}

.category-badge {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
}

.category-badge.economy {
    background: #ffeaa7;
    color: #2d3436;
}

.category-badge.humor {
    background: #fd79a8;
    color: white;
}

.category-badge.entertainment {
    background: #fdcb6e;
    color: #2d3436;
}

.category-badge.tech {
    background: #74b9ff;
    color: white;
}

.category-badge.other {
    background: #ddd;
    color: #555;
}

.post-title {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
}

.site-prefix {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    margin-top: 2px;
}

.site-prefix.bobae {
    background: #ff6b6b;
    color: white;
}

.site-prefix.ppomppu {
    background: #4ecdc4;
    color: white;
}

.site-prefix.fmkorea {
    background: #45b7d1;
    color: white;
}

.site-prefix.dcinside {
    background: #96ceb4;
    color: white;
}

.site-prefix.dogdrip {
    background: #9b59b6;
    color: white;
}

.post-title a {
    color: #2d3436;
    text-decoration: none;
    font-weight: 600;
    line-height: 1.4;
    flex: 1;
}

.post-title a:hover {
    color: #667eea;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #636e72;
}

.post-author {
    font-weight: 500;
}

.post-stats {
    display: flex;
    gap: 15px;
}

.post-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-stats i {
    color: #667eea;
}

/* 더 보기 버튼 */
.load-more-container {
    text-align: center;
    margin-top: 30px;
}

.load-more-btn {
    padding: 12px 30px;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
}

.load-more-btn:hover {
    background: #667eea;
    color: white;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters {
        justify-content: center;
    }
    
    .search-group {
        margin-left: 0;
        justify-content: center;
    }
    
    .search-group input {
        width: 200px;
    }
    
    .stats {
        flex-direction: row;
        gap: 10px;
        justify-content: space-around;
        font-size: 0.9em;
    }
    
    .stat-item {
        flex: 1;
        text-align: center;
    }
    
    .stats .stat-item.last-update {
        flex-basis: 100%;
        justify-content: center;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #dee2e6;
    }
    
    .posts-container {
        grid-template-columns: 1fr;
    }
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: fadeIn 0.5s ease-out;
}