/* youtube-analytics/css/style.css */
/* YouTube Analytics Dashboard - 공통 스타일 */

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

:root {
    --primary-color: #ff6b35;
    --secondary-color: #00ff88;
    --error-color: #ff3366;
    --warning-color: #ffaa00;
    --success-color: #4CAF50;
    --background-dark: #0a0a0a;
    --background-card: rgba(255, 255, 255, 0.03);
    --background-elevated: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 10px 20px rgba(0, 0, 0, 0.2);
    --shadow-heavy: 0 20px 40px rgba(0, 0, 0, 0.3);
}

body {
    background: linear-gradient(135deg, var(--background-dark) 0%, #1a1a1a 50%, #0f0f0f 100%);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    line-height: 1.6;
}

/* 컨테이너 */
.container {
    width: 100%;
    max-width: none;
    padding: 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* 헤더 */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 30px;
    background: var(--background-card);
    border-radius: 20px;
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.1), transparent);
    animation: shimmer 4s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.header h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
    text-shadow: 0 0 30px rgba(255, 107, 53, 0.3);
}

.header p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-muted);
    margin-bottom: 25px;
}

.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.stat-number {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: bold;
    color: var(--secondary-color);
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* 네비게이션 탭 */
.nav-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 15px;
    flex-wrap: wrap;
    padding: 0 20px;
}

.nav-tab {
    padding: 12px 25px;
    background: var(--background-card);
    border: 2px solid transparent;
    border-radius: 25px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.nav-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.2), transparent);
    transition: left 0.5s;
}

.nav-tab:hover::before {
    left: 100%;
}

.nav-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.nav-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.4);
    transform: translateY(-2px);
}

/* 콘텐츠 그리드 */
.content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* 카드 */
.card {
    background: var(--background-card);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(15px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
    border-color: rgba(255, 107, 53, 0.3);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 랭킹 아이템 */
.ranking-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.ranking-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transition: width 0.3s ease;
    border-radius: 12px 0 0 12px;
}

.ranking-item:hover::before {
    width: 4px;
}

.ranking-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(8px);
}

.rank-number {
    font-size: 1.2rem;
    font-weight: bold;
    margin-right: 15px;
    width: 35px;
    text-align: center;
    color: var(--text-secondary);
}

.rank-number.top-3 {
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
}

.channel-info, .video-info {
    flex: 1;
}

.channel-name, .video-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    font-size: 1rem;
    line-height: 1.4;
}

.channel-stats, .video-stats {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.stat-value {
    color: var(--secondary-color);
    font-weight: 600;
}

/* 차트 컨테이너 */
.chart-container {
    height: 350px;
    background: var(--background-elevated);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid var(--border-color);
    position: relative;
}

.chart-container canvas {
    max-width: 100% !important;
    max-height: 100% !important;
}

/* 통계 그리드 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.02);
    padding: 25px 20px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-3px);
    border-color: rgba(255, 107, 53, 0.3);
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 버튼 */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-size: 0.95rem;
    text-align: center;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(255, 107, 53, 0.3);
}

.btn-secondary {
    background: var(--secondary-color);
    color: #000;
}

.btn-secondary:hover:not(:disabled) {
    background: #00dd77;
    transform: translateY(-2px);
}

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

.btn-danger:hover:not(:disabled) {
    background: #e52955;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
}

/* 액션 버튼 그룹 */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

/* 알림 메시지 */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease;
}

.alert-error {
    background: rgba(255, 51, 102, 0.1);
    border: 1px solid var(--error-color);
    color: var(--error-color);
}

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.alert-warning {
    background: rgba(255, 170, 0, 0.1);
    border: 1px solid var(--warning-color);
    color: var(--warning-color);
}

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 로딩 스피너 */
.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 50px auto;
}

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

/* 상태 그리드 (모니터링용) */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.status-card {
    background: var(--background-elevated);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.status-card:hover {
    border-color: rgba(255, 107, 53, 0.3);
    transform: translateY(-3px);
}

.status-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

/* 로그 컨테이너 */
.logs-container {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    padding: 20px;
    margin-top: 30px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.log-entry {
    padding: 8px 12px;
    margin-bottom: 5px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.log-info { background: rgba(0, 255, 136, 0.1); }
.log-warning { background: rgba(255, 170, 0, 0.1); }
.log-error { background: rgba(255, 51, 102, 0.1); }

/* 푸터 */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 10px;
}

.footer a:hover {
    text-decoration: underline;
}

/* 반응형 디자인 */
@media (max-width: 1200px) {
    .content {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
}

@media (max-width: 768px) {
    .container, .container-fluid {
        padding: 15px;
    }
    
    .header {
        padding: 30px 20px;
        margin-bottom: 30px;
    }
    
    .nav-tabs {
        flex-direction: column;
        align-items: stretch;
        padding: 0 10px;
    }
    
    .nav-tab {
        text-align: center;
        margin-bottom: 10px;
    }
    
    .content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .card {
        padding: 20px;
    }
    
    .stats-bar {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }
    
    .ranking-item {
        padding: 12px;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        margin-bottom: 10px;
    }
    
    .status-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .nav-tab {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .card-title {
        font-size: 1.2rem;
    }
    
    .stat-card {
        padding: 20px 15px;
    }
    
    .chart-container {
        height: 250px;
    }
}

/* 스크롤바 스타일링 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #e55a2b;
}

/* 선택 색상 */
::selection {
    background: rgba(255, 107, 53, 0.3);
    color: white;
}

::-moz-selection {
    background: rgba(255, 107, 53, 0.3);
    color: white;
}