/* 🔒 Atlassian Design System Festival Analysis Styles - Production Version */
/* UPDATED: Design Proposal A (Dark Mode & Neon) */

:root {
    /* Base Colors */
    --bg-color: #0f172a;
    --surface-color: rgba(30, 41, 59, 0.7);
    --surface-hover: rgba(255, 255, 255, 0.08);
    
    /* Brand Colors */
    --primary-color: #38bdf8; /* Cyan */
    --secondary-color: #f472b6; /* Pink */
    --accent-color: #818cf8; /* Indigo */
    
    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Gradients */
    --accent-gradient: linear-gradient(135deg, #38bdf8, #818cf8);
    --festival-gradient: linear-gradient(135deg, #f472b6, #fbbf24);
    --livehouse-gradient: linear-gradient(135deg, #38bdf8, #818cf8);
    
    /* Glassmorphism */
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    /* Legacy Variables Mapping (for JS compatibility) */
    --ds-background-brand-bold: var(--primary-color);
    --ds-background-neutral: var(--surface-color);
    --ds-background-danger: #ef4444;
    --ds-background-warning: #f59e0b;
    --ds-background-success: #10b981;
    --ds-text: var(--text-primary);
    --ds-text-subtle: var(--text-secondary);
    --ds-border: rgba(255, 255, 255, 0.1);
    
    /* Spacing */
    --ds-space-050: 4px;
    --ds-space-100: 8px;
    --ds-space-200: 16px;
    --ds-space-300: 24px;
    --ds-space-400: 32px;
    --ds-space-500: 40px;
    
    /* Radius */
    --ds-border-radius: 8px;
    --ds-border-radius-200: 16px;
}

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

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(244, 114, 182, 0.1) 0%, transparent 40%);
    min-height: 100vh;
    padding-bottom: 80px; /* Space for bottom ad */
}

.modern-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.modern-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    border-bottom: var(--glass-border);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.05em;
}

/* Main Content */
.modern-main {
    flex: 1;
    padding: 0 2rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Search Section */
.search-container {
    text-align: center;
    margin-bottom: 4rem;
    padding: 2rem 0;
}

.search-header h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.search-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.modern-search-form {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-input-wrapper {
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    padding: 0.5rem;
    border-radius: 1rem;
    border: var(--glass-border);
    display: flex;
    box-shadow: var(--glass-shadow);
}

.modern-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem;
    color: white;
    font-size: 1.1rem;
    outline: none;
    width: 100%;
}

.modern-button {
    background: var(--accent-gradient);
    border: none;
    padding: 0 2rem;
    border-radius: 0.75rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.modern-button:hover {
    transform: scale(1.05);
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Progress Bar */
.progress-container {
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.progress-header h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-percentage {
    font-weight: 700;
    color: var(--primary-color);
    min-width: 3rem;
    text-align: right;
}

.progress-details, .progress-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-align: right;
}

/* Results Section */
.results-section {
    animation: fadeIn 0.5s ease;
}

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

/* Artist Overview */
.artist-overview {
    margin-bottom: 3rem;
}

.artist-name {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-align: center;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.analysis-info {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.festival-stat .stat-icon { color: var(--secondary-color); }
.livehouse-stat .stat-icon { color: var(--primary-color); }
.total-stat .stat-icon { color: var(--accent-color); }

.stat-content {
    flex: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
}

.stat-unit {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 0.25rem;
}

/* Rankings */
.rankings-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
}

.ranking-column {
    background: transparent;
}

.ranking-header {
    margin-bottom: 1.5rem;
}

.ranking-title h3 {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.festival-header h3 { color: var(--secondary-color); }
.livehouse-header h3 { color: var(--primary-color); }

.ranking-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
}

.ranking-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.rank {
    font-size: 1.2rem;
    font-weight: 800;
    width: 2.5rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.ranking-item:nth-child(1) .rank { color: #fbbf24; }
.ranking-item:nth-child(2) .rank { color: #94a3b8; }
.ranking-item:nth-child(3) .rank { color: #b45309; }

.song-info {
    flex: 1;
    min-width: 0; /* Prevent flex item overflow */
}

.song-name {
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.performance-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.count-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 0.5rem;
    font-size: 0.75rem;
}

/* Specialized Songs */
.specialized-songs-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
}

.specialized-column {
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
}

.specialized-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.specialized-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.specialized-song {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
}

.specialized-song:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Comparison Section */
.comparison-section {
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 4rem;
}

.comparison-title {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.comparison-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.basic-ranking-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.75rem;
    border: 1px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
}

.basic-ranking-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.basic-rank {
    font-weight: 700;
    width: 2rem;
    color: var(--text-secondary);
}

.basic-song-info {
    flex: 1;
    margin-left: 0.5rem;
}

.basic-song-name {
    font-weight: 600;
    display: block;
}

.basic-song-rate {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Modal */
.modern-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
}

.modal-container {
    position: relative;
    background: #1e293b;
    border: var(--glass-border);
    border-radius: 1rem;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--glass-shadow);
    overflow: hidden;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.modal-close:hover {
    color: white;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.performance-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.stat-group {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.festival-stats .stat-number { color: var(--secondary-color); }
.livehouse-stats .stat-number { color: var(--primary-color); }

.stat-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stat-percentage {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.stat-divider {
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.timeline-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.timeline-date {
    color: var(--text-secondary);
    font-family: monospace;
}

.timeline-venue {
    flex: 1;
}

.timeline-type {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    height: fit-content;
}

.timeline-type.festival {
    background: rgba(244, 114, 182, 0.2);
    color: var(--secondary-color);
}

.timeline-type.livehouse {
    background: rgba(56, 189, 248, 0.2);
    color: var(--primary-color);
}

/* Footer */
.modern-footer {
    text-align: center;
    padding: 2rem;
    border-top: var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Ads */
.bottom-ad-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-top: var(--glass-border);
    padding: 0.5rem;
    display: flex;
    justify-content: center;
    z-index: 90;
}

/* Responsive */
@media (max-width: 768px) {
    .search-header h2 {
        font-size: 2rem;
    }
    
    .rankings-container, 
    .specialized-songs-section {
        grid-template-columns: 1fr;
    }
    
    .modern-header {
        padding: 1rem;
    }
    
    .modern-main {
        padding: 0 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}

/* Error Message */
.modern-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    text-align: center;
}
