/* GenAIList - Custom Styles */

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a0b;
}

::-webkit-scrollbar-thumb {
    background: #27272a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3f3f46;
}

/* Selection */
::selection {
    background: rgba(34, 211, 238, 0.3);
    color: #fafafa;
}

/* Focus ring */
*:focus-visible {
    outline: 2px solid #22d3ee;
    outline-offset: 2px;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Loader Spinner */
.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(34, 211, 238, 0.2);
    border-top-color: #22d3ee;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Timeline styles */
.timeline-container {
    position: relative;
    overflow: visible;
    padding: 2rem 0;
    min-height: 400px;
    width: 100%;
    display: block;
}

/* Timeline Table */
.timeline-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 0;
    padding: 0;
}

.timeline-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
}

.timeline-table-header {
    background: #0a0a0b;
    z-index: 25;
}

.timeline-table-header th {
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #27272a;
    background: #0a0a0b;
}

.timeline-table-header th.timeline-org-header {
    text-align: right;
    padding-right: 1rem;
    width: 200px;
    min-width: 200px;
}

.timeline-table-header th:not(.timeline-org-header) {
    width: calc((100% - 200px) / 12);
}

.timeline-table tbody tr {
    border-bottom: 1px solid rgba(39, 39, 42, 0.3);
    transition: background-color 0.2s ease;
}

.timeline-table tbody tr:hover {
    background-color: rgba(39, 39, 42, 0.1);
}

.timeline-org-cell {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fafafa;
    text-align: right;
    width: 200px;
    min-width: 200px;
    border-right: 1px solid rgba(39, 39, 42, 0.3);
}

.timeline-month-cell {
    padding: 0.5rem;
    font-size: 0.75rem;
    text-align: center;
    position: relative;
    background: #0a0a0b;
    border: 1px solid rgba(39, 39, 42, 0.2);
}

.timeline-month-cell.multiple {
    background: rgba(34, 211, 238, 0.1);
    border-color: rgba(34, 211, 238, 0.3);
    cursor: pointer;
    font-weight: 600;
    color: #22d3ee;
}

.timeline-month-cell.multiple:hover {
    background: rgba(34, 211, 238, 0.2);
    border-color: rgba(34, 211, 238, 0.5);
}

/* Timeline month buttons (for aggregated view) */
.timeline-month-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #22d3ee;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timeline-month-btn:hover {
    background: rgba(34, 211, 238, 0.2);
    border-color: rgba(34, 211, 238, 0.5);
    transform: translateY(-1px);
}

.timeline-month-btn.active {
    background: #22d3ee;
    color: #000;
    border-color: #22d3ee;
}

.timeline-month-btn.active:hover {
    background: #06b6d4;
    border-color: #06b6d4;
}

.timeline-cell-link {
    color: #fafafa;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0.25rem;
    border-radius: 0.125rem;
}

.timeline-cell-link:hover {
    color: #22d3ee;
    background: rgba(34, 211, 238, 0.1);
}

.timeline-cell-hover {
    position: absolute;
    bottom: calc(100% + 0.25rem);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1d;
    border: 1px solid #22d3ee;
    border-radius: 0.5rem;
    padding: 0.75rem;
    min-width: 200px;
    max-width: 500px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: visible;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    box-sizing: border-box;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.timeline-cell-hover::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.timeline-cell-hover::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #22d3ee;
    z-index: 1001;
}

.timeline-cell-hover::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 9px solid #1a1a1d;
    margin-top: -1px;
    z-index: 1000;
}

.timeline-cell-model-link {
    display: block;
    color: #fafafa;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.15s ease;
    font-size: 0.875rem;
    line-height: 1.4;
    border-left: 2px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.timeline-cell-model-link:hover {
    background-color: rgba(34, 211, 238, 0.15);
    color: #22d3ee;
    border-left-color: #22d3ee;
}

/* Timeline toggle button */
#toggleTimelineBtn {
    transition: all 0.2s ease;
}

#toggleTimelineBtn svg {
    transition: transform 0.2s ease;
}

#toggleTimelineBtn:hover {
    color: #22d3ee;
}

/* Timeline Marker (Model) */
.timeline-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.timeline-marker:hover {
    z-index: 1000;
}

.timeline-marker:hover .timeline-marker-label {
    z-index: 1000 !important;
}

.timeline-marker-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--marker-color, #22d3ee);
    border: 2px solid #0a0a0b;
    box-sizing: border-box;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.timeline-marker:hover .timeline-marker-dot {
    transform: scale(1.5);
    box-shadow: 0 0 0 3px var(--marker-color, #22d3ee);
}

.timeline-marker-label {
    position: absolute;
    bottom: calc(100% + 0.25rem);
    left: 50%;
    margin-left: -50%;
    padding: 0.2rem 0.4rem;
    background: #141416;
    border: 1px solid var(--marker-color, #22d3ee);
    border-radius: 0.25rem;
    font-size: 0.65rem;
    font-weight: 500;
    color: #fafafa;
    white-space: nowrap;
    opacity: 0.9;
    transition: all 0.2s ease;
    pointer-events: auto;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    transform-origin: center bottom;
}

.timeline-marker-label.label-hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

.timeline-marker:hover .timeline-marker-label,
.timeline-marker-label:hover {
    z-index: 1000 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(2px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    border-color: var(--marker-color, #22d3ee);
    background: #1a1a1d;
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
}

/* Aggregated marker styles */
.timeline-marker-aggregated {
    cursor: pointer;
}

.timeline-marker-dot-aggregated {
    width: 16px;
    height: 16px;
    border-width: 3px;
    box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.3);
}

.timeline-marker-aggregated:hover .timeline-marker-dot-aggregated {
    transform: scale(1.3);
    box-shadow: 0 0 0 4px var(--marker-color, #22d3ee);
}

.timeline-marker-label-aggregated {
    font-weight: 600;
    background: #1a1a1d;
    border-width: 2px;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    white-space: normal;
    min-width: 100px;
    width: auto;
}

.timeline-marker-label-aggregated.showing-models {
    padding: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    max-width: 500px;
    width: max-content;
    min-width: 200px;
}

.timeline-label-model-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.timeline-label-model-link {
    display: block;
    color: #fafafa;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.15s ease;
    font-size: 0.7rem;
    line-height: 1.4;
    border-left: 2px solid transparent;
    white-space: nowrap;
}

.timeline-marker-aggregated:hover .timeline-marker-label-aggregated {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(-2px) scale(1.05) !important;
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
}

.timeline-marker-aggregated:hover .timeline-marker-label-aggregated.showing-models {
    transform: translateY(-2px) scale(1.05) !important;
    padding: 0.5rem !important;
}



/* Responsive adjustments */
@media (max-width: 768px) {
    .timeline-container {
        display: none;
    }
}

/* Model card */
.model-card {
    position: relative;
    display: block;
    background: #141416;
    border: 1px solid #27272a;
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.2s ease;
}

.model-card:hover {
    border-color: #3f3f46;
    background: #1a1a1d;
}

/* Mobile model card */
.mobile-model-card {
    position: relative;
    display: block;
    background: #141416;
    border: 1px solid #27272a;
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.2s ease;
    text-decoration: none;
    width: 100%;
}

.mobile-model-card:hover {
    border-color: #3f3f46;
    background: #1a1a1d;
}

.mobile-model-card h3 {
    line-height: 1.3;
    word-break: break-word;
}

.mobile-model-card p {
    margin: 0;
    line-height: 1.5;
}

.mobile-model-card .type-badge,
.mobile-model-card .avail-badge {
    white-space: nowrap;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
}

/* Type badge colors */
.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.type-language { background: rgba(34, 211, 238, 0.15); color: #22d3ee; }
.type-image { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.type-video { background: rgba(244, 63, 94, 0.15); color: #f43f5e; }
.type-audio { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.type-multimodal { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.type-vision { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.type-speech { background: rgba(236, 72, 153, 0.15); color: #ec4899; }
.type-code { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.type-robotics { background: rgba(99, 102, 241, 0.15); color: #6366f1; }
.type-embedding { background: rgba(100, 116, 139, 0.15); color: #64748b; }

/* Availability badge */
.avail-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.avail-proprietary { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.avail-open-weights { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.avail-open-source { background: rgba(34, 211, 238, 0.15); color: #22d3ee; }
.avail-open-weights-restricted { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

/* Skeleton loader */
.skeleton {
    background: linear-gradient(90deg, #141416 25%, #1a1a1d 50%, #141416 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
    border-radius: 0.375rem;
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Toast */
.toast {
    padding: 0.75rem 1rem;
    background: #141416;
    border: 1px solid #27272a;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    animation: slideIn 0.2s ease;
}

.toast-success { border-left: 3px solid #4ade80; }
.toast-error { border-left: 3px solid #f87171; }
.toast-info { border-left: 3px solid #22d3ee; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Provider table */
.provider-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #27272a;
    align-items: center;
}

.provider-row:last-child {
    border-bottom: none;
}

@media (max-width: 640px) {
    .provider-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* Tweet/Video embed container */
.embed-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 0.5rem;
}

.embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Filter chips */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: #141416;
    border: 1px solid #27272a;
    border-radius: 9999px;
    font-size: 0.875rem;
    color: #a1a1aa;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-chip:hover {
    border-color: #3f3f46;
    color: #fafafa;
}

.filter-chip.active {
    background: #22d3ee;
    border-color: #22d3ee;
    color: #0a0a0b;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #141416;
    border: 1px solid #27272a;
    border-radius: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: #22d3ee;
}

.stat-label {
    font-size: 0.75rem;
    color: #71717a;
    margin-top: 0.25rem;
}

/* Mobile/Tablet card view for timeline (< 1024px) */
@media (max-width: 1023px) {
    .timeline-container {
        display: none !important;
    }
    
    .mobile-timeline {
        display: block;
    }
    
    /* Hide desktop model grid on mobile/tablet */
    #modelGridSection {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    .mobile-timeline {
        display: none;
    }
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #22d3ee 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero section */
.hero-bg {
    background: radial-gradient(ellipse at top, rgba(34, 211, 238, 0.1) 0%, transparent 50%),
                radial-gradient(ellipse at bottom right, rgba(168, 85, 247, 0.05) 0%, transparent 50%);
}

/* Button styles */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: #22d3ee;
    color: #0a0a0b;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
}

.btn-primary:hover {
    background: #06b6d4;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: transparent;
    color: #a1a1aa;
    font-weight: 500;
    border: 1px solid #27272a;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
}

.btn-secondary:hover {
    border-color: #3f3f46;
    color: #fafafa;
}

/* Input styles */
.input {
    width: 100%;
    background: #0a0a0b;
    border: 1px solid #27272a;
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    color: #fafafa;
    transition: border-color 0.15s ease;
}

.input:focus {
    outline: none;
    border-color: #22d3ee;
}

.input::placeholder {
    color: #52525b;
}

/* Select styles */
.select {
    appearance: none;
    background: #0a0a0b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2371717a'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") right 0.75rem center no-repeat;
    background-size: 1rem;
    padding-right: 2.5rem;
}

/* Tab navigation */
.tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid #27272a;
}

.tab {
    padding: 0.75rem 1rem;
    color: #71717a;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s ease;
}

.tab:hover {
    color: #a1a1aa;
}

.tab.active {
    color: #22d3ee;
    border-bottom-color: #22d3ee;
}

/* Favorite button */
.favorite-btn {
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: #71717a;
    transition: all 0.2s ease;
    cursor: pointer;
}

.favorite-btn:hover {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

.favorite-btn.active {
    color: #fbbf24;
}

.favorite-btn.active svg {
    fill: #fbbf24;
}

/* Favorite star in cards */
.card-favorite-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.375rem;
    border-radius: 0.375rem;
    color: #71717a;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
}

.model-card:hover .card-favorite-btn,
.mobile-model-card:hover .card-favorite-btn,
.card-favorite-btn.active {
    opacity: 1;
}

.card-favorite-btn:hover {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.2);
}

.card-favorite-btn.active {
    color: #fbbf24;
}

.card-favorite-btn.active svg {
    fill: #fbbf24;
}

/* Organization Autocomplete Dropdown */
#organizationFilterDropdown,
#organizationFilterMobileDropdown {
    scrollbar-width: thin;
    scrollbar-color: #27272a #0a0a0b;
}

#organizationFilterDropdown::-webkit-scrollbar,
#organizationFilterMobileDropdown::-webkit-scrollbar {
    width: 6px;
}

#organizationFilterDropdown::-webkit-scrollbar-track,
#organizationFilterMobileDropdown::-webkit-scrollbar-track {
    background: #0a0a0b;
    border-radius: 0 0 0.5rem 0.5rem;
}

#organizationFilterDropdown::-webkit-scrollbar-thumb,
#organizationFilterMobileDropdown::-webkit-scrollbar-thumb {
    background: #27272a;
    border-radius: 3px;
}

#organizationFilterDropdown::-webkit-scrollbar-thumb:hover,
#organizationFilterMobileDropdown::-webkit-scrollbar-thumb:hover {
    background: #3f3f46;
}

