/* Modern CS Portfolio Styles - YouTube Inspired */
:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #181818;
    --bg-elevated: #212121;
    --bg-hover: #272727;
    --text-primary: #f1f1f1;
    --text-secondary: #aaaaaa;
    --text-muted: #717171;
    --accent: #667eea;
    --accent-hover: #764ba2;
    --success: #4ade80;
    --error: #f87171;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

html {
    min-height: 100%;
    background: linear-gradient(to bottom, #000000 0%, #0a0a0a 50%, #1a0a2e 100%);
    background-attachment: fixed;
}

body {
    background: transparent;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

[x-cloak] {
    display: none !important;
}

/* Header */
.header {
    background: linear-gradient(to bottom, rgba(255, 215, 0, 0.1) 0%, #0b0c10 30%, #0b0c10 100%);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.5px;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    font-family: 'Quantico', sans-serif;
    padding: 8px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 14px;
}

.nav-link:hover {
    border-color: #FFD700;
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.nav-link.active {
    background-color: #FFD700;
    color: #000;
    border-color: #FFD700;
    font-weight: 600;
}

/* Hero Section */
.hero {
    padding: 140px 24px 120px;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-family: 'Audiowide', cursive;
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.instantly-yellow {
    color: #FFD700;
    font-weight: 600;
}

.hero-subtitle {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
}

.hero-description {
    font-family: 'Audiowide', cursive;
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 80px;
}

/* Search Container */
.search-container {
    margin-bottom: 24px;
}

.search-box {
    display: flex;
    max-width: 650px;
    margin: 0 auto;
    background-color: var(--bg-elevated);
    border-radius: 40px;
    padding: 4px;
    border: 2px solid #ff0080;
    transition: all 0.3s;
    box-shadow: 0 0 10px rgba(255, 0, 128, 0.3);
}

.search-box:hover {
    border-color: #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.search-box:focus-within {
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.search-input {
    font-family: 'Quantico', sans-serif;
    flex: 1;
    background: none;
    border: none;
    padding: 14px 20px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
    font-family: 'Quantico', sans-serif;
    font-size: 14px;
}

.search-button {
    font-family: 'Audiowide', cursive;
    padding: 12px 24px;
    background: #ff0080;
    color: white;
    border: 2px solid #ff0080;
    border-radius: 36px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 10px rgba(255, 0, 128, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    justify-content: center;
}

.search-button:hover:not(:disabled) {
    transform: translateY(-2px);
    background: #FFD700;
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    color: #000;
}

.search-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loading-spinner {
    display: flex;
    align-items: center;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    max-width: 600px;
    margin: 16px auto 0;
    background-color: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--error);
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Example Links */
.example-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    max-width: 650px;
    margin: 24px auto 0;
    gap: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

.example-link {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.example-link:hover {
    background-color: rgba(102, 126, 234, 0.1);
    color: var(--accent-hover);
}

/* Results Section */
.results {
    padding: 0 24px 80px;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-content {
    max-width: 1400px;
    margin: 0 auto;
}

/* Value Card */
.value-card {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-secondary) 100%);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 32px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.value-label {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

.value-amount {
    font-size: clamp(48px, 8vw, 72px);
    font-weight: 800;
    background: linear-gradient(135deg, var(--success) 0%, #22c55e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 32px;
}

.value-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.stat-divider {
    width: 1px;
    height: 40px;
    background-color: var(--border);
}

/* Analysis Grid */
.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

/* Cards */
.chart-card,
.categories-card,
.top-items-card {
    background-color: var(--bg-elevated);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
}

/* Chart */
.chart-wrapper {
    max-width: 320px;
    margin: 0 auto;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.category-item {
    background-color: var(--bg-secondary);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.category-item:hover {
    transform: translateY(-2px);
    border-color: var(--category-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.category-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--category-color);
}

.category-name {
    font-family: 'Audiowide', cursive;
    font-size: 14px;
    font-weight: 600;
}

.category-value {
    font-family: 'Quantico', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.category-count {
    font-family: 'Audiowide', cursive;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Top Items */
.items-grid {
    display: grid;
    gap: 12px;
}

.item-card {
    display: grid;
    grid-template-columns: 32px 1fr 180px 120px;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.item-card:hover {
    background-color: var(--bg-hover);
    transform: translateX(4px);
}

.item-rank {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.item-info {
    min-width: 0;
}

.item-name {
    font-family: 'Audiowide', cursive;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-meta {
    font-family: 'Audiowide', cursive;
    font-size: 14px;
    color: #FFD700;
    text-align: center;
    white-space: nowrap;
    justify-self: center;
}

.item-meta:empty {
    display: block;
}

.item-total-value {
    font-family: 'Audiowide', cursive;
    font-size: 18px;
    font-weight: 700;
    color: var(--success);
    text-align: right;
    white-space: nowrap;
}

/* Main wrapper */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 40px 24px;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-main {
    font-family: 'VT323', monospace;
    font-size: 20px;
}

.gg-yellow {
    color: #FFD700;
}

.footer-note {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 8px;
    font-family: 'Quantico', sans-serif;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        padding: 0 16px;
    }
    
    .nav {
        display: none;
    }
    
    .hero {
        padding: 80px 16px 60px;
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    
    .value-stats {
        gap: 24px;
    }
    
    .stat-divider {
        display: none;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}