/* YTK Note Service Style - Forbes Money Inspired */

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

:root {
    --primary-color: #000000;
    --accent-color: #007bff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --bg-primary: #ffffff;
    --bg-secondary: #f7f7f7;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

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

/* Navigation */
.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

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

.nav-brand {
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    color: inherit !important;
}

.nav-brand:hover {
    text-decoration: none !important;
}

.brand-title {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -1px;
    color: var(--text-primary) !important;
    text-decoration: none !important;
}

.brand-accent {
    color: var(--accent-color) !important;
}

.brand-tagline {
    font-size: 0.75rem;
    color: var(--text-secondary) !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none !important;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    position: relative;
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-color);
}

.debug-link {
    background: var(--bg-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.nav-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4rem 2rem;
}

.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
    color: white;
}

.hero-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.hero-title .highlight {
    background: rgba(255, 255, 255, 0.2);
    padding: 0 0.5rem;
    border-radius: 4px;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 300;
}

/* Main Content */
.main-content {
    min-height: 60vh;
    padding: 3rem 2rem;
    background: var(--bg-secondary);
}

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

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.section-filters {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1.2rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

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

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.video-card {
    background: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    background: #f0f0f0;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.video-content {
    padding: 1.5rem;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.channel-name {
    font-weight: 500;
    color: var(--accent-color);
}

.video-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-preview {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.view-count {
    color: var(--text-secondary);
}

.read-more {
    color: var(--accent-color);
    font-weight: 500;
}

/* Load More */
.load-more {
    text-align: center;
    margin: 3rem 0;
}

.load-more-btn {
    padding: 1rem 3rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.load-more-btn:hover {
    background: #333;
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: white;
    padding: 3rem 2rem 1rem;
    margin-top: 4rem;
}

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

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section p,
.footer-section ul {
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.footer-section a:hover {
    opacity: 1;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.6;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
    }
    
    .nav-menu {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 1rem;
    }
    
    .nav-stats {
        display: none;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .main-content {
        padding: 2rem 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-filters {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .brand-title {
        font-size: 1.5rem;
    }
    
    .nav-link {
        font-size: 0.85rem;
    }
    
    .filter-btn {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }
    
    .video-content {
        padding: 1rem;
    }
}

/* Loading State */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* Category Badge */
.category-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    background: rgba(0, 0, 0, 0.7);
}

.category-badge.category-투자 {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.category-badge.category-부동산 {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.category-badge.category-경제 {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.category-badge.category-시사 {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-indicator p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* No Results */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.no-results p {
    font-size: 1.1rem;
}

/* Error State */
.error-message {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    padding: 1rem;
    margin: 2rem 0;
    color: #c00;
}

/* Navigation Authentication Styles */
.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-auth {
    display: flex;
    align-items: center;
}

/* Login Button */
.login-btn {
    padding: 0.6rem 1.4rem;
    background: var(--accent-color);
    color: white !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: 2px solid var(--accent-color);
    display: inline-block;
}

.login-btn:hover {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.user-btn:hover {
    border-color: var(--accent-color);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.user-avatar {
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.2;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.dropdown-arrow {
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    margin-left: auto;
}

.user-btn:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    visibility: hidden;
    transition: all 0.2s ease;
    margin-top: 0.75rem;
    overflow: hidden;
}

.user-dropdown.show {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.dropdown-item {
    display: block;
    padding: 0.9rem 1.2rem;
    color: var(--text-primary);
    text-decoration: none !important;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--accent-color);
    text-decoration: none !important;
}

.dropdown-item.logout {
    color: #dc3545;
    border-top: 1px solid var(--border-color);
}

.dropdown-item.logout:hover {
    background: #fee;
    color: #c82333;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* Mobile Navigation Auth */
@media (max-width: 768px) {
    .nav-right {
        order: 2;
        gap: 1rem;
    }
    
    .nav-stats {
        display: none;
    }
    
    .user-btn {
        padding: 0.5rem 0.7rem;
        font-size: 0.85rem;
        gap: 0.5rem;
    }
    
    .user-info {
        display: none;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
    
    .user-dropdown {
        min-width: 180px;
        right: -20px;
    }
    
    .login-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .nav-right {
        order: 1;
        justify-content: flex-end;
        margin-bottom: 0.5rem;
    }
    
    .nav-menu {
        order: 2;
        justify-content: center;
    }
}