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

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --border-color: #e5e7eb;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* 네비게이션 */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: #6b7280;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover, .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

/* 메인 컨테이너 */
.main-content {
    padding: 2rem;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

/* 헤더 */
.page-header {
    text-align: center;
    color: white;
    margin-bottom: 2rem;
    padding: 2rem 0;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.last-updated {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 알림 배너 */
.alert-banner {
    background: rgba(255, 255, 255, 0.95);
    border-left: 5px solid var(--warning-color);
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.alert-banner h3 {
    color: var(--warning-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* 대시보드 그리드 */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* 카드 */
.card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-icon {
    color: var(--primary-color);
}

/* 메트릭 카드 */
.metric-label {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0.75rem 0;
}

.metric-change {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.metric-change.up {
    background: #fee2e2;
    color: var(--danger-color);
}

.metric-change.down {
    background: #d1fae5;
    color: var(--success-color);
}

/* 차트 컨테이너 */
.large-chart {
    grid-column: 1 / -1;
}

.chart-container {
    position: relative;
    height: 400px;
    margin-top: 1rem;
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
}

/* 예측 섹션 */
.prediction-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 10px 35px rgba(0,0,0,0.2);
}

.prediction-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.prediction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.prediction-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.prediction-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    opacity: 0.95;
}

.prediction-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.75rem 0;
}

.prediction-range {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.75rem;
}

.confidence-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin: 0.75rem 0;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 4px;
    transition: width 1s ease;
}

.confidence-text {
    font-size: 0.85rem;
    opacity: 0.7;
}

.prediction-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* 모델 정보 */
.model-info {
    background: rgba(255, 255, 255, 0.1);
    border-left: 4px solid rgba(255, 255, 255, 0.5);
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.model-info h4 {
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 품목별 분류 */
.category-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.category-item {
    background: var(--light-color);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.category-item h4 {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.category-item .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

/* 버튼 */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

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

/* 로딩 */
.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner-large {
    background: white;
    padding: 2rem 3rem;
    border-radius: 12px;
    text-align: center;
}

.loading-spinner-large i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* 푸터 */
.footer {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1600px;
    margin: 0 auto;
}

.footer-sub {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* 반응형 */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .prediction-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 300px;
    }
}

/* Changelog 스타일 */
.changelog-timeline {
    position: relative;
    padding-left: 30px;
}

.changelog-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #6366f1, #8b5cf6);
}

.changelog-item {
    position: relative;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e5e7eb;
}

.changelog-item:last-child {
    border-bottom: none;
}

.changelog-item::before {
    content: '';
    position: absolute;
    left: -34px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6366f1;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #6366f1;
}

.changelog-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #6366f1;
    margin-bottom: 10px;
    font-size: 14px;
}

.changelog-content h3 {
    margin: 10px 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.changelog-content ul {
    margin: 15px 0;
    padding-left: 20px;
}

.changelog-content li {
    margin: 8px 0;
    color: #4b5563;
    line-height: 1.6;
}

.changelog-meta {
    margin-top: 15px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-primary {
    background: #e0e7ff;
    color: #3730a3;
}

/* 시스템 로그 */
.system-log-list {
    display: grid;
    gap: 15px;
}

.system-log-item {
    background: #f9fafb;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #6366f1;
}

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

.log-type {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-status {
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.log-message {
    color: #4b5563;
    margin-bottom: 8px;
}

.log-time {
    font-size: 12px;
    color: #9ca3af;
}

.log-error details {
    margin-top: 10px;
    padding: 10px;
    background: #fef2f2;
    border-radius: 6px;
    border: 1px solid #fecaca;
}

.log-error summary {
    cursor: pointer;
    font-weight: 600;
    color: #dc2626;
    user-select: none;
}

.log-error pre {
    margin-top: 10px;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 12px;
    color: #dc2626;
}
