/* ========================================
   PFM-DenseBench Website Styles
   ======================================== */

/* === Base Styles === */
:root {
    --color-primary: #4f46e5;
    --color-primary-light: #6366f1;
    --color-primary-dark: #4338ca;
    --color-secondary: #8b5cf6;
    --color-accent: #06b6d4;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition-base: 0.3s ease;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--color-gray-800);
    background-color: #ffffff;
    overflow-x: hidden;
}

/* === Layout === */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 5rem 0;
}

.section-alt {
    background-color: var(--color-gray-50);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--color-gray-900);
}

.section-subtitle {
    font-size: 1.125rem;
    text-align: center;
    color: var(--color-gray-500);
    max-width: 700px;
    margin: 0 auto 3rem;
}

/* === Animations === */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

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

.animate-float {
    animation: float 3s ease-in-out infinite;
}

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

/* === Hero Section === */
.hero {
    padding: 6rem 0;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%234f46e5' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--color-gray-900);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--color-gray-600);
    max-width: 900px;
    margin: 0 auto 1.5rem;
    font-weight: 400;
    line-height: 1.5;
}

.hero-meta {
    font-size: 1rem;
    color: var(--color-gray-500);
    margin-bottom: 2.5rem;
}

.hero-meta strong {
    color: var(--color-primary);
    font-weight: 600;
}

/* === Buttons === */
.btn-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 4rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border-radius: 9999px;
    font-weight: 500;
    font-size: 1rem;
    text-decoration: none;
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
}

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

.btn-primary:hover {
    background-color: var(--color-gray-700);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: white;
    color: var(--color-gray-800);
    border: 1px solid var(--color-gray-200);
}

.btn-secondary:hover {
    background-color: var(--color-gray-50);
    border-color: var(--color-gray-300);
}

/* === Stats Grid === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 700px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(1, 1fr);
        max-width: 200px;
    }
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 1.5rem;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all var(--transition-base);
}

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

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-gray-900);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--color-gray-500);
}

/* === Why Section === */
.why-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

@media (max-width: 1024px) {
    .why-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .why-grid {
        grid-template-columns: 1fr;
    }
}

.why-card {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    text-align: center;
    transition: all var(--transition-base);
    border: 1px solid var(--color-gray-100);
}

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

.why-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
    transition: transform var(--transition-base);
}

.why-card:hover .why-icon {
    transform: scale(1.1);
}

.why-icon-blue { background: linear-gradient(135deg, #eff6ff, #dbeafe); }
.why-icon-rose { background: linear-gradient(135deg, #fdf2f8, #fce7f3); }
.why-icon-amber { background: linear-gradient(135deg, #fffbeb, #fef3c7); }
.why-icon-emerald { background: linear-gradient(135deg, #ecfdf5, #d1fae5); }
.why-icon-violet { background: linear-gradient(135deg, #f5f3ff, #ede9fe); }
.why-icon-cyan { background: linear-gradient(135deg, #ecfeff, #cffafe); }

.why-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-gray-900);
    margin-bottom: 0.75rem;
}

.why-desc {
    font-size: 0.9rem;
    color: var(--color-gray-500);
    line-height: 1.6;
}

/* === Main Figure === */
.main-figure {
    max-width: 1000px;
    margin: 0 auto 3rem;
    text-align: center;
}

.framework-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-gray-200);
}

.figure-caption {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--color-gray-600);
    line-height: 1.6;
    text-align: center;
}

.figure-caption strong {
    color: var(--color-gray-800);
}

/* === Benchmark Overview === */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

@media (max-width: 1024px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }
}

.overview-card {
    background: var(--color-gray-50);
    border-radius: 1.5rem;
    padding: 2rem;
}

.overview-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-gray-900);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.overview-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-gray-700);
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.overview-card h4:first-of-type {
    margin-top: 0;
}

.overview-card p {
    font-size: 0.875rem;
    color: var(--color-gray-500);
    line-height: 1.6;
}

.strategy-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.strategy-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.strategy-item span {
    font-size: 0.9rem;
    color: var(--color-gray-600);
}

/* === Performance Tables === */
.performance-section {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-gray-100);
}

.performance-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-gray-900);
    margin-bottom: 1.5rem;
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-gray-100);
}

.data-table th {
    background-color: var(--color-gray-50);
    font-weight: 600;
    color: var(--color-gray-700);
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background-color: var(--color-gray-50);
}

.method-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--color-gray-100);
    color: var(--color-gray-700);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
}

.rank-1 { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; }
.rank-2 { background: linear-gradient(135deg, #e5e7eb, #d1d5db); color: #374151; }
.rank-3 { background: linear-gradient(135deg, #fed7aa, #fdba74); color: #9a3412; }

.score-value {
    font-weight: 600;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    color: var(--color-gray-900);
}

/* === Bar Chart Styles === */
.bar-cell {
    min-width: 200px;
}

.bar-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bar-wrapper {
    flex: 1;
    height: 1.25rem;
    background: var(--color-gray-100);
    border-radius: 0.375rem;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    border-radius: 0.375rem;
    transition: width 0.5s ease-out;
}

.bar-fill-sota {
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

.bar-fill-rank {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.bar-value {
    font-weight: 600;
    font-size: 0.875rem;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    color: var(--color-gray-800);
    min-width: 50px;
    text-align: right;
}

/* === Citation Section === */
.citation-box {
    background: #ffffff;
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    max-width: 900px;
    margin: 0 auto;
    border: 1px solid var(--color-gray-200);
    box-shadow: var(--shadow-md);
}

.citation-box pre {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--color-gray-700);
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

.citation-box .key { color: #7c3aed; }
.citation-box .value { color: #059669; }
.citation-box .bracket { color: #db2777; }

/* === Authors Section (Hero inline) === */
.hero-authors {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.hero-authors-text {
    font-size: 0.9rem;
    color: var(--color-gray-600);
    line-height: 1.8;
    max-width: 900px;
    margin: 0 auto;
}

.hero-authors-note {
    font-size: 0.8rem;
    color: var(--color-gray-400);
    margin-top: 0.5rem;
}

.hero-affiliations {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--color-gray-500);
}

/* === Footer === */
.footer {
    background: var(--color-gray-50);
    padding: 2rem 0;
    border-top: 1px solid var(--color-gray-200);
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--color-gray-500);
    text-decoration: none;
    transition: color var(--transition-base);
}

.footer-links a:hover {
    color: var(--color-gray-900);
}

.footer-copyright {
    font-size: 0.875rem;
    color: var(--color-gray-400);
}

/* === Responsive Adjustments === */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .btn-group {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}
