:root {
    /* Color Palette */
    --bg-base: #0a0a0c;
    --bg-surface: rgba(255, 255, 255, 0.03);
    --bg-surface-border: rgba(255, 255, 255, 0.08);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --accent-primary: #10b981; /* Naver-ish Green / Emerald */
    --accent-secondary: #3b82f6; /* Blue */
    --accent-glow: rgba(16, 185, 129, 0.2);
    
    /* Gradients */
    --gradient-brand: linear-gradient(135deg, #00C73C 0%, #0093E9 100%);
    
    /* Metrics */
    --radius-lg: 1.5rem;
    --radius-md: 1rem;
    --radius-sm: 0.5rem;
    
    /* Animation */
    --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 4rem 1rem;
}

/* Background Ambient Orbs */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: rgba(16, 185, 129, 0.15); /* Green */
}

.orb-2 {
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: rgba(59, 130, 246, 0.15); /* Blue */
    animation-delay: -5s;
}

.orb-3 {
    top: 40%;
    left: 60%;
    width: 30vw;
    height: 30vw;
    background: rgba(139, 92, 246, 0.1); /* Purple */
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Container Layout */
.container {
    width: 100%;
    max-width: 800px;
    z-index: 10;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

.gradient-text {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
}

/* Input Form */
.search-section {
    margin-bottom: 3rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--bg-surface-border);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    padding-left: 1.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: var(--transition-smooth);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-glow), 0 4px 24px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
    margin-right: 1rem;
}

input[type="url"] {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.125rem;
    font-family: inherit;
    outline: none;
    padding: 1rem 0;
}

input[type="url"]::placeholder {
    color: rgba(156, 163, 175, 0.5);
}

button {
    background: var(--gradient-brand);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 14px rgba(0, 199, 60, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 199, 60, 0.4);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Loading & Error States */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    color: var(--accent-primary);
    font-weight: 500;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(16, 185, 129, 0.3);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-state {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 500;
}

.hidden {
    display: none !important;
}

/* Glassmorphism Classes */
.glass {
    background: var(--bg-surface);
    border: 1px solid var(--bg-surface-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Results Dashboard */
.results-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition-smooth);
}

.card:hover, .stat-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.header-card h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge.channel {
    color: var(--accent-primary);
    background: var(--accent-glow);
    border-color: rgba(16, 185, 129, 0.3);
}

.badge.date {
    color: var(--text-muted);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.stat-card {
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition-smooth);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.play-icon { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4); }
.like-icon { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4); }
.comment-icon { background: linear-gradient(135deg, #3b82f6, #2563eb); box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4); }

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

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

/* Tags */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.tag:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

/* Navigation */
.top-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 0.5rem;
    border-radius: 3rem;
    margin-bottom: 2.5rem;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.nav-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: white;
    background: var(--accent-glow);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Channel specific */
.channel-container {
    max-width: 1000px;
}

.input-grid {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.input-grid .input-wrapper {
    margin-bottom: 0;
}

.input-grid .input-wrapper:first-child {
    flex: 3;
}

.count-wrapper {
    flex: 1 !important;
    padding-left: 1rem !important;
}

.count-wrapper input {
    text-align: center;
    padding: 1rem 0.5rem !important;
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header-flex h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.secondary-btn {
    background: rgba(255,255,255,0.05);
    background-image: none;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: none;
    padding: 0.6rem 1.2rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
}

.secondary-btn:hover {
    background: rgba(255,255,255,0.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Table Design */
.table-container {
    overflow-x: auto;
}

.glass-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.glass-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 1rem;
    border-bottom: 1px solid var(--bg-surface-border);
    white-space: nowrap;
}

.glass-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 0.95rem;
    vertical-align: middle;
}

.glass-table tbody tr {
    transition: var(--transition-smooth);
}

.glass-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.glass-table a {
    color: var(--accent-primary);
    text-decoration: none;
}

.glass-table a:hover {
    text-decoration: underline;
}

.channel-search {
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .gradient-text {
        font-size: 2.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .input-wrapper {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    
    .input-grid {
        flex-direction: column;
    }

    .count-wrapper {
        width: 100%;
    }

    .search-icon {
        display: none;
    }
    
    input[type="url"], input[type="number"] {
        padding: 0.5rem;
        text-align: center;
        width: 100%;
    }
    
    button {
        width: 100%;
    }

    .top-nav {
        flex-direction: column;
        width: 100%;
    }
    .nav-link {
        text-align: center;
    }
    .card-header-flex {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}
