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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
    position: relative;
}

header {
    text-align: center;
    padding: 20px 20px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    flex-shrink: 0;
}

header h1 {
    font-size: 2em;
    margin-bottom: 5px;
    font-weight: 700;
}

header p {
    font-size: 1em;
    opacity: 0.9;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 5px;
    backdrop-filter: blur(10px);
}

.tab-button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    min-width: 120px;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.tab-button.active {
    background: rgba(255, 255, 255, 0.9);
    color: #4facfe;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Tab Content */
.tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Vote Tab Styles */
.vote-section {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.vote-header {
    text-align: center;
    padding: 20px 30px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.vote-header h2 {
    color: #4facfe;
    margin-bottom: 5px;
    font-size: 1.8em;
}

.vote-header p {
    color: #666;
    font-size: 1em;
}

/* Queue Status Visualization */
.queue-status-container {
    margin-top: 15px;
    padding: 15px;
    background: rgba(79, 172, 254, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(79, 172, 254, 0.2);
}

.queue-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.queue-label {
    font-weight: 600;
    color: #4facfe;
    font-size: 1em;
}

.queue-count {
    background: #4facfe;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

.queue-visualization {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    margin-bottom: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    min-height: 80px;
    align-content: flex-start;
}

.queue-square {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.queue-square.filled {
    background: #4CAF50;
    border-color: #45a049;
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.4);
}

.queue-square.loading {
    background: #FF9800;
    border-color: #f57c00;
    animation: pulse 1.5s infinite;
    box-shadow: 0 0 4px rgba(255, 152, 0, 0.4);
}

.queue-square.empty {
    background: #f5f5f5;
    border-color: #ddd;
}

.queue-square.error {
    background: #f44336;
    border-color: #d32f2f;
    box-shadow: 0 0 4px rgba(244, 67, 54, 0.4);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.queue-legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 0.8em;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
}

.legend-square {
    width: 8px;
    height: 8px;
    border-radius: 1px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.legend-square.filled {
    background: #4CAF50;
    border-color: #45a049;
}

.legend-square.loading {
    background: #FF9800;
    border-color: #f57c00;
}

.legend-square.empty {
    background: #f5f5f5;
    border-color: #ddd;
}

.vote-controls {
    flex: 0 0 350px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    overflow: hidden;
    position: relative;
    transition: flex-basis 0.3s ease;
}

.vote-controls.collapsed {
    flex: 0 0 60px;
}

.vote-controls.collapsed .model-info-panel {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-100%);
}

.collapse-toggle {
    position: absolute;
    top: 20px;
    right: 3px;
    width: 30px;
    height: 30px;
    border: none;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.collapse-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
}

.collapse-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.vote-controls.collapsed .collapse-icon {
    transform: rotate(180deg);
}

.model-info-panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: all 0.3s ease;
}

.triangle-filter-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    flex-shrink: 0;
}

.triangle-filter-section h4 {
    color: #4facfe;
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
}

.triangle-filter-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.triangle-filter-controls label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
}

#triangleLimit {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

#triangleLimit:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.lighting-controls-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    flex-shrink: 0;
}

.lighting-controls-section h4 {
    color: #4facfe;
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
}

.lighting-filter-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lighting-filter-controls label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
}

#voteLightingMode {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

#voteLightingMode:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.vote-model-details {
    flex: 1;
    overflow-y: auto;
}

.loading-message {
    text-align: center;
    color: #666;
    padding: 40px 20px;
}

.loading-message h3 {
    color: #4facfe;
    margin-bottom: 10px;
}

.model-details-content {
    padding: 0;
}

.model-details-content h3 {
    color: #4facfe;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.model-detail-item {
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.model-detail-item:last-child {
    border-bottom: none;
}

.model-detail-item strong {
    color: #333;
    display: inline-block;
    min-width: 80px;
}

.model-detail-item span {
    color: #666;
}

.vote-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.next-model-btn {
    padding: 15px 25px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.next-model-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 172, 254, 0.3);
}

.vote-buttons {
    display: flex;
    gap: 10px;
}

.vote-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vote-btn.upvote {
    background: linear-gradient(135deg, #4caf50 0%, #8bc34a 100%);
    color: white;
}

.vote-btn.upvote:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(76, 175, 80, 0.3);
}

.vote-btn.downvote {
    background: linear-gradient(135deg, #f44336 0%, #ff5722 100%);
    color: white;
}

.vote-btn.downvote:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(244, 67, 54, 0.3);
}

#voteThreejsContainer {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

/* Canvas overlaid vote buttons */
.canvas-vote-buttons {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 1000;
    pointer-events: none;
    width: auto;
    height: auto;
}

.canvas-vote-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: all;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.canvas-vote-btn.canvas-upvote {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.9) 0%, rgba(139, 195, 74, 0.9) 100%);
    color: white;
}

.canvas-vote-btn.canvas-upvote:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 1) 0%, rgba(139, 195, 74, 1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
}

.canvas-vote-btn.canvas-downvote {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.9) 0%, rgba(255, 87, 34, 0.9) 100%);
    color: white;
}

.canvas-vote-btn.canvas-downvote:hover {
    background: linear-gradient(135deg, rgba(244, 67, 54, 1) 0%, rgba(255, 87, 34, 1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(244, 67, 54, 0.4);
}

/* History Tab Styles */
.history-section {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.vote-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 15px 30px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

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

.stat-number {
    display: block;
    font-size: 2em;
    font-weight: 700;
    color: #4facfe;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
}

.history-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin: 15px 30px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    padding: 3px;
    flex-shrink: 0;
}

.history-search {
    display: flex;
    align-items: center;
    margin: 0 30px 20px;
    position: relative;
    flex-shrink: 0;
}

#historySearchInput {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#historySearchInput:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

#historySearchClear {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

#historySearchClear:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #666;
}

.history-tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.history-tab-btn:hover {
    background: rgba(79, 172, 254, 0.1);
    color: #4facfe;
}

.history-tab-btn.active {
    background: #4facfe;
    color: white;
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
}

.history-grid-container {
    flex: 1;
    padding: 20px 30px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.history-grid {
    display: none;
    flex: 1;
    overflow-y: auto;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-gap: 20px;
    padding: 10px;
    align-content: start;
}

.history-grid.active {
    display: grid;
}

.model-preview-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    aspect-ratio: 1;
    position: relative;
}

.model-preview-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.model-preview-item.upvote {
    border-top: 3px solid #4caf50;
}

.model-preview-item.downvote {
    border-top: 3px solid #f44336;
}

.model-preview-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.model-preview-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 12px;
    text-align: center;
}

.model-preview-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 15px 10px 10px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.no-votes {
    text-align: center;
    color: #999;
    padding: 60px 20px;
}

.no-votes p:first-child {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.vote-item {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 4px solid transparent;
}

.vote-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.vote-item.upvote {
    border-left-color: #4caf50;
}

.vote-item.downvote {
    border-left-color: #f44336;
}

.vote-item-header {
    display: flex;
    justify-content: between;
    align-items: start;
    margin-bottom: 10px;
}

.vote-item-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    flex: 1;
}

.vote-item-timestamp {
    font-size: 12px;
    color: #999;
    font-style: italic;
}

.vote-item-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 12px;
    color: #666;
}

.vote-item-meta div {
    display: flex;
    align-items: center;
    gap: 5px;
}

.vote-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.vote-badge.upvote {
    background: #4caf50;
}

.vote-badge.downvote {
    background: #f44336;
}

/* WebGL Warning */
.webgl-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    color: #856404;
}

.webgl-warning p {
    margin: 5px 0;
}

.webgl-warning p:first-child {
    font-weight: 600;
}

/* Simple Model Items */
.simple-model-item {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.simple-model-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.simple-model-item.upvote {
    border-left-color: #4caf50;
}

.simple-model-item.downvote {
    border-left-color: #f44336;
}

.simple-model-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.simple-model-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.simple-model-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.simple-model-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
}

.simple-model-footer .timestamp {
    font-style: italic;
}

.simple-model-footer .source-link {
    color: #4facfe;
    text-decoration: none;
    font-weight: 600;
}

.simple-model-footer .source-link:hover {
    text-decoration: underline;
}

.search-section {
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.search-container {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 300px;
}

#searchInput {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

#searchButton {
    padding: 12px 30px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#searchButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 172, 254, 0.3);
}

.search-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-info span {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.cache-status {
    display: flex;
    align-items: center;
    gap: 15px;
}

#cacheStatus {
    font-size: 14px;
    color: #666;
}

#initCacheBtn {
    padding: 8px 16px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#initCacheBtn:hover {
    background: #ff5252;
}

.main-content {
    display: flex;
    gap: 20px;
    padding: 20px 30px;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    overflow: hidden;
}

.results-panel, .controls-panel {
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.controls-panel {
    flex-shrink: 0;
    height: fit-content;
    max-height: 350px;
}

.results-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.results-panel h3, .controls-panel h3 {
    margin-bottom: 15px;
    color: #4facfe;
    font-weight: 600;
}

.keyboard-help {
    background: linear-gradient(135deg, #ff9800 0%, #ffb74d 100%);
    color: white;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 12px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.keyboard-help p {
    margin: 2px 0;
}

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

.results-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.result-item {
    padding: 12px;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.result-item:hover {
    border-color: #4facfe;
    background: #f8fcff;
}

.result-item.selected {
    border-color: #4facfe;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.result-item.keyboard-selected {
    border-color: #ff9800;
    background: linear-gradient(135deg, #ff9800 0%, #ffb74d 100%);
    color: white;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.3);
}

.result-item h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-item .meta {
    font-size: 12px;
    opacity: 0.7;
}

.no-results {
    text-align: center;
    color: #999;
    padding: 40px 20px;
}

.search-summary {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.results-list {
    /* Container for actual result items */
}

.load-more-indicator {
    text-align: center;
    padding: 15px;
    color: #666;
    font-size: 14px;
    font-style: italic;
    border-top: 1px solid #f0f0f0;
    margin-top: 10px;
    transition: opacity 0.3s ease;
}

.control-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.control-group label {
    font-weight: 500;
    color: #666;
}

.control-group input, .control-group select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.control-group button {
    padding: 8px 16px;
    background: #4facfe;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-group button:hover {
    background: #3d8bfe;
}

.viewer-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    overflow: hidden;
}

#threejsContainer {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.viewer-info {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
    z-index: 1;
}

.viewer-info h3 {
    color: #4facfe;
    margin-bottom: 10px;
}

.viewer-tips {
    margin-top: 20px;
    text-align: left;
}

.viewer-tips ul {
    list-style: none;
    padding-left: 0;
}

.viewer-tips li {
    margin-bottom: 5px;
    font-size: 14px;
}

.model-info {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    max-height: 200px;
    overflow-y: auto;
}

.model-meta {
    margin: 15px 0;
}

.model-meta p {
    margin-bottom: 8px;
    font-size: 14px;
}

.model-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.model-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

#downloadBtn {
    background: #4caf50;
    color: white;
}

#downloadBtn:hover {
    background: #45a049;
}

#viewSourceBtn {
    background: #2196f3;
    color: white;
}

#viewSourceBtn:hover {
    background: #1976d2;
}

/* Loading indicator - centered over vote container */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    align-items: center;
    gap: 8px;
    background: rgba(79, 172, 254, 0.95);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
    animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
    from { 
        opacity: 0; 
        transform: scale(0.8) translateY(-10px); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    }
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

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

/* Footer removed to maintain viewport fit */

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .sidebar {
        flex-direction: row;
        height: auto;
        flex-shrink: 0;
    }
    
    .results-panel {
        flex: 2;
        max-height: 300px;
    }
    
    .controls-panel {
        flex: 1;
        max-height: 300px;
    }
    
    .viewer-section {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .search-section {
        padding: 15px 20px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    #searchInput {
        margin-bottom: 10px;
    }
    
    .main-content {
        padding: 15px 20px;
        gap: 15px;
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        flex-direction: column;
        height: auto;
        flex-shrink: 0;
        max-height: 40vh;
    }
    
    .results-panel {
        max-height: 25vh;
    }
    
    .controls-panel {
        max-height: 15vh;
    }
    
    .viewer-section {
        flex: 1;
        min-height: 0;
    }
}

/* Hide all scrollbars while maintaining scroll functionality */
* {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

*::-webkit-scrollbar {
    display: none; /* WebKit */
}

body {
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.container {
    overflow-x: hidden;
}

.results-container {
    overflow-y: auto;
    overflow-x: hidden;
}

.results-container::-webkit-scrollbar {
    display: none;
}

.main-content {
    overflow: hidden;
}

/* Animation controls */
#animationControls {
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
    margin-top: 15px;
}

#animationControls h3 {
    color: #ff6b6b;
    margin-bottom: 15px;
    font-weight: 600;
}

#animationSelect {
    min-width: 120px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

#pauseAnimationBtn, #stopAnimationBtn {
    padding: 6px 12px;
    margin-right: 8px;
    font-size: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#pauseAnimationBtn {
    background: #ff9800;
    color: white;
}

#pauseAnimationBtn:hover {
    background: #e68900;
}

#stopAnimationBtn {
    background: #f44336;
    color: white;
}

#stopAnimationBtn:hover {
    background: #d32f2f;
}

/* Viewport Loading System Styles */
.viewport-info {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
    color: #1976d2;
}

.model-preview-container {
    width: 250px;
    height: 250px;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    position: relative;
    overflow: hidden;
    margin: 0 auto;

}

.model-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.model-placeholder {
    color: #666;
    font-size: 18px;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border-radius: 6px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-placeholder {
    color: #666;
    font-size: 14px;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffcc02 100%);
    border-radius: 6px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 1.5s ease-in-out infinite;
}

.error-placeholder {
    color: #d32f2f;
    font-size: 14px;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-radius: 6px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.model-info {
    padding: 16px;
    background: white;
    border-radius: 0 0 8px 8px;
}

.model-info h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.model-author {
    color: #666;
    font-size: 14px;
    margin: 0 0 8px 0;
}

.model-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 12px;
    color: #777;
}

.model-actions {
    display: flex;
    gap: 8px;
}

.btn-download, .btn-source {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
}

.btn-download:hover {
    background: #2196f3;
    color: white;
    border-color: #2196f3;
}

.btn-source:hover {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

/* Error state styling */
.error-state {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-radius: 12px;
    border: 1px solid #ffcdd2;
}

.error-state h3 {
    color: #d32f2f;
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
}

.error-state p {
    color: #666;
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.4;
}

.retry-btn {
    padding: 10px 20px;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-top: 12px;
    transition: all 0.2s ease;
}

.retry-btn:hover {
    background: #1976d2;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.error-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.skip-btn {
    padding: 10px 20px;
    background: #ff9800;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.skip-btn:hover {
    background: #f57c00;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 152, 0, 0.3);
}

/* Enhanced notification styling */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-width: 400px;
    font-size: 14px;
    line-height: 1.4;
}

.notification.warning {
    background: linear-gradient(135deg, #fff3e0 0%, #ffcc02 100%);
    border-left: 4px solid #ff9800;
    color: #e65100;
}

.notification.error {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-left: 4px solid #f44336;
    color: #c62828;
}

.notification.success {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    border-left: 4px solid #4caf50;
    color: #2e7d32;
}