/* Leaderboard Specific Styles */

/* Custom Properties for Credo AI Brand Theme */
:root {
    --leaderboard-primary: #7B04CA;
    /* French Violet */
    --leaderboard-secondary: #C9B6FF;
    /* Soft Blue */
    --leaderboard-light: #E7C9FA;
    /* Pale Lavender */
    --leaderboard-gradient: linear-gradient(135deg, #FFD5E5 0%, #7B04CA 100%);
    /* Mimi Pink to French Violet */
    --button-gradient: linear-gradient(135deg, #BD7AE7 0%, #7B04CA 100%);
    /* Restricted gradient for buttons - starts ~50% through original */
    --leaderboard-glow: 0 0 20px rgba(123, 4, 202, 0.3);
    --leaderboard-shadow: none;
    --leaderboard-border: 1px solid #E6E1E5;
}

/* Container and Layout */
.leaderboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
}

/* Header Styles */
.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

.header-content {
    text-align: left;
}

.header-logo {
    margin-bottom: 1rem;
}

.logo {
    height: 60px;
    width: auto;
}

.header-actions {
    display: flex;
    align-items: center;
}

.login-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--leaderboard-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--leaderboard-primary);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.login-link:hover {
    background: var(--leaderboard-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--leaderboard-glow);
}

.leaderboard-subtitle {
    font-size: 1.2rem;
    color: var(--gray-text);
    opacity: 0;
    animation: fadeIn 1s ease-out 0.3s forwards;
}

/* Controls Section */
.controls-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: var(--leaderboard-border);
    animation: slideUp 0.8s ease-out 0.2s backwards;
}

/* Preset Controls */
.preset-controls h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 600;
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.preset-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 80px;
}

.preset-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FFD5E5 0%, #7B04CA 100%);
    transition: left 0.3s ease;
    z-index: -1;
}

.preset-btn:hover::before,
.preset-btn.active::before {
    left: 0;
}

.preset-btn:hover,
.preset-btn.active {
    border-color: var(--leaderboard-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--leaderboard-glow);
}

.preset-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.preset-allocation {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Dimension Legend */
.dimension-legend {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(255, 213, 229, 0.1) 0%, rgba(123, 4, 202, 0.05) 100%);
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dimension-name {
    cursor: help;
    position: relative;
    padding: 0.25rem 0;
    transition: color 0.2s ease;
}

.dimension-name:hover {
    color: var(--leaderboard-primary);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.capability-color {
    background-color: var(--capability-color);
}

.safety-color {
    background-color: var(--safety-color);
}

.affordability-color {
    background-color: var(--affordability-color);
}

.speed-color {
    background-color: var(--speed-color);
}

/* Filter Controls */
.filter-controls {
    display: flex;
    gap: 3rem;
    justify-content: center;
    margin-top: 2rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: opacity 0.3s ease;
}

.filter-group label {
    font-weight: 500;
    color: var(--gray-text);
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s ease;
    min-width: 200px;
    width: 100%;
}

.filter-select:focus {
    outline: none;
    border-color: var(--leaderboard-primary);
    box-shadow: 0 0 0 3px rgba(123, 4, 202, 0.1);
}

.loading-bars {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.loading-bar {
    height: 60px;
    background: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
}

.loading-bar-fill {
    height: 100%;
    background: var(--leaderboard-gradient);
    width: 0;
    animation: loadingPulse 1.5s ease-in-out infinite;
}

/* Leaderboard Content */
.leaderboard-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    border: var(--leaderboard-border);
    animation: slideUp 0.8s ease-out 0.4s backwards;
}

.ranking-context {
    text-align: center;
    margin-bottom: 1.5rem;
    font-style: italic;
    color: var(--gray-text);
    font-size: 1rem;
}

.ranking-emphasis {
    color: var(--leaderboard-primary);
    font-weight: 600;
    font-style: normal;
}

.leaderboard-header-row {
    display: grid;
    grid-template-columns: 2fr 3fr 1fr;
    gap: 2rem;
    padding: 1rem 0;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--gray-text);
}

/* Model List */
.model-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.model-item {
    display: grid;
    grid-template-columns: 2fr 3fr 1fr;
    gap: 2rem;
    align-items: center;
    padding: 1rem 0;
    border-radius: 8px;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}

.model-item:hover {
    background: linear-gradient(135deg, rgba(255, 213, 229, 0.08) 0%, rgba(123, 4, 202, 0.05) 100%);
    transform: translateY(-2px);
    border: var(--leaderboard-border);
}

.model-name {
    font-weight: 500;
    color: var(--text-color);
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.ranking-badge {
    font-size: 1.1rem;
    margin-right: 0.4rem;
    flex-shrink: 0;
}

/* Model Detail Card */
.model-detail-card {
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 8px 32px rgba(123, 4, 202, 0.25);
    border: 2px solid var(--leaderboard-primary);
    z-index: 1001;
    width: 280px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.model-item:hover .model-detail-card {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
    transition-delay: 0.3s;
}

.model-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.model-detail-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-detail-score {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--leaderboard-primary);
}

.dimension-bars {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.dimension-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.dimension-label {
    min-width: 70px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-text);
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.progress-fill.capability-fill {
    background: var(--capability-color);
}

.progress-fill.safety-fill {
    background: var(--safety-color);
}

.progress-fill.affordability-fill {
    background: var(--affordability-color);
}

.progress-fill.speed-fill {
    background: var(--speed-color);
}

.score-value {
    min-width: 30px;
    text-align: right;
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-color);
}

/* Score Bar Container and Animation */
.score-bar-container {
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
}

.score-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.score-bar-fill {
    height: 100%;
    background: var(--leaderboard-gradient);
    border-radius: 10px;
    position: relative;
    transform-origin: left;
}

.score-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.3) 50%,
            transparent 100%);
    /* Removed shimmer animation during bar animations to prevent conflicts */
    animation: shimmerBar 2s ease-in-out infinite 2s;
    animation-play-state: paused;
}

.model-score {
    font-weight: 600;
    color: var(--leaderboard-primary);
    font-size: 1.1rem;
    text-align: right;
    opacity: 1;
    /* Removed automatic CSS animation - controlled by JavaScript */
}

/* Call to Action */
.cta-section {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(255, 213, 229, 0.15) 0%, rgba(123, 4, 202, 0.1) 100%);
    border-radius: 16px;
    animation: slideUp 0.8s ease-out 0.6s backwards;
}

.cta-section h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.cta-section p {
    margin-bottom: 1.5rem;
    color: var(--gray-text);
}

.cta-button {
    display: inline-block;
    background: var(--button-gradient);
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--leaderboard-glow);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


@keyframes subtlePulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.85;
    }
}

@keyframes shimmer {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes shimmerBar {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

@keyframes loadingPulse {

    0%,
    100% {
        width: 0;
    }

    50% {
        width: 60%;
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .leaderboard-container {
        padding: 1rem;
    }

    .leaderboard-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .header-content {
        text-align: center;
    }


    .preset-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .filter-controls {
        flex-direction: column;
        gap: 1rem;
    }

    .leaderboard-header-row,
    .model-item {
        grid-template-columns: 1fr 2fr 0.8fr;
        gap: 1rem;
    }

    .dimension-legend {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Custom Tooltips */
.tooltip {
    position: relative;
    display: block;
    width: 100%;
}

.tooltip .tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #FFD5E5 0%, #7B04CA 100%);
    color: white;
    text-align: center;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    z-index: 1000;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.3;
    min-width: 320px;
    max-width: 400px;
    box-shadow: 0 4px 15px rgba(123, 4, 202, 0.3);
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.tooltip .tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--leaderboard-primary) transparent transparent transparent;
}

.tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
    transition-delay: 0.1s;
}

/* Animation Suppression for Dynamic Elements */
.no-animations,
.no-animations * {
    animation: none !important;
    transition: none !important;
    animation-duration: 0s !important;
    transition-duration: 0s !important;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .score-bar-fill::after {
        display: none;
    }
}

/* Ecosystem Partners Section */
.ecosystem-partners-section {
    margin-top: 60px;
    padding: 40px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-top: 1px solid #e9ecef;
}

.partners-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.ecosystem-partners-section h3 {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
}

.partners-intro {
    font-size: 16px;
    color: #5a6c7d;
    margin-bottom: 30px;
    line-height: 1.6;
}

.partners-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    padding: 20px 0;
}

.partner-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.partner-logo-container:hover {
    transform: translateY(-5px);
}

.partner-logo {
    max-height: 60px;
    max-width: 180px;
    height: auto;
    width: auto;
    object-fit: contain;
    filter: grayscale(20%);
    opacity: 0.8;
    transition: all 0.3s ease;
}

.partner-logo-container a {
    display: block;
}

.partner-logo-container:hover .partner-logo {
    filter: grayscale(0%);
    opacity: 1;
}

@media (max-width: 768px) {
    .partners-logos {
        gap: 30px;
    }

    .partner-logo {
        max-height: 50px;
        max-width: 150px;
    }

    .ecosystem-partners-section {
        padding: 30px 0;
    }
}