/* 보안 뉴스 대시보드 스타일 */

:root {
    /* 색상 팔레트 - 다크 모드 프리미엄 */
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-hover: #1f3460;

    --text-primary: #eaeaea;
    --text-secondary: #a0a0a0;
    --text-muted: #6a6a7a;

    --accent-primary: #00d9ff;
    --accent-secondary: #7b2cbf;
    --accent-success: #00c853;
    --accent-warning: #ffc107;
    --accent-danger: #ff4757;

    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-card: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);

    --border-color: #2a2a4a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 8px 30px rgba(0, 217, 255, 0.15);

    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 헤더 */
.header {
    background: var(--gradient-primary);
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

.header-content {
    position: relative;
    z-index: 1;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.logo-img {
    height: 2.5rem;
    width: auto;
    vertical-align: middle;
}

.tagline {
    font-size: 1rem;
    opacity: 0.9;
}

/* 메인 콘텐츠 */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* 통계 섹션 */
.stats-section {
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-card.total {
    border-left: 4px solid var(--accent-primary);
}

.stat-card.legacy {
    border-left: 4px solid var(--accent-warning);
}

.stat-card.security {
    border-left: 4px solid var(--accent-success);
}

.stat-card.date {
    border-left: 4px solid var(--accent-secondary);
}

.stat-icon {
    font-size: 2rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 필터 섹션 */
.filter-section {
    margin-bottom: 2rem;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.filter-group select {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-group select:hover {
    border-color: var(--accent-primary);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

/* 기간 조회 스타일 추가 */
.range-group {
    flex: 1;
    margin-left: auto;
    min-width: 300px;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-input {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    flex: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.date-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.7;
    cursor: pointer;
}

.date-input:hover {
    border-color: var(--accent-primary);
}

.range-sep {
    color: var(--text-muted);
    font-weight: bold;
}

.btn-filter {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-filter:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.4);
}

.btn-filter:active {
    transform: translateY(0);
}

/* 기사 섹션 */
.articles-section {
    margin-bottom: 2rem;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.article-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

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

.article-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-primary);
}

.article-card[data-source-type="security"] {
    border-top: 3px solid var(--accent-success);
}

.article-card[data-source-type="legacy"] {
    border-top: 3px solid var(--accent-warning);
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.article-source {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-source.security {
    background: rgba(0, 200, 83, 0.2);
    color: var(--accent-success);
}

.article-source.legacy {
    background: rgba(255, 193, 7, 0.2);
    color: var(--accent-warning);
}

.article-lang {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.article-category {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(0, 217, 255, 0.1);
    color: var(--accent-primary);
}

.cat-ransomware {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
}

.cat-data_breach {
    background: rgba(255, 165, 2, 0.2);
    color: #ffa502;
}

.cat-malware {
    background: rgba(123, 44, 191, 0.2);
    color: #9c88ff;
}

.cat-phishing {
    background: rgba(0, 206, 201, 0.2);
    color: #00cec9;
}

.cat-ddos {
    background: rgba(253, 121, 168, 0.2);
    color: #fd79a8;
}

.cat-apt {
    background: rgba(99, 110, 114, 0.2);
    color: #b2bec3;
}

.cat-vulnerability {
    background: rgba(0, 184, 148, 0.2);
    color: #00b894;
}

.cat-umv {
    background: rgba(118, 75, 162, 0.2);
    color: #764ba2;
}

.cat-webshell {
    background: rgba(0, 217, 255, 0.2);
    color: var(--accent-primary);
}

.article-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-title a:hover {
    color: var(--accent-primary);
}

.article-summary {
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex: 1;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.article-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.article-link {
    font-size: 0.8rem;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.article-link:hover {
    color: var(--accent-secondary);
}

/* 기사 없음 */
.no-articles {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px dashed var(--border-color);
}

.no-articles-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.no-articles h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.no-articles p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.no-articles .hint {
    margin-top: 1rem;
}

.no-articles code {
    background: var(--bg-card);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    color: var(--accent-primary);
}

/* 카테고리 통계 */
.category-stats-section {
    margin-bottom: 2rem;
}

.category-stats {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.category-stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.category-stat-item:last-child {
    margin-bottom: 0;
}

.category-name {
    min-width: 100px;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-align: center;
}

.category-bar-container {
    flex: 1;
    height: 8px;
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
}

.category-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.category-count {
    min-width: 30px;
    text-align: right;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 푸터 */
.footer {
    background: var(--bg-secondary);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
}

/* 반응형 */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .header {
        padding: 1.5rem;
    }

    .logo {
        font-size: 1.5rem;
    }

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

    .filter-form {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-card {
    animation: fadeIn 0.3s ease forwards;
}

.article-card:nth-child(1) {
    animation-delay: 0.05s;
}

.article-card:nth-child(2) {
    animation-delay: 0.1s;
}

.article-card:nth-child(3) {
    animation-delay: 0.15s;
}

.article-card:nth-child(4) {
    animation-delay: 0.2s;
}

.article-card:nth-child(5) {
    animation-delay: 0.25s;
}

.article-card:nth-child(6) {
    animation-delay: 0.3s;
}