/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: #0f3057;
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-logo i {
    color: #0056b3;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background-color 0.2s;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
}

.comparison-counter {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #0f3057 0%, #0056b3 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #fff, #e0f7fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.search-bar {
    display: flex;
    max-width: 50%;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
}

.search-bar input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    outline: none;
    font-size: 1rem;
}

.search-bar button {
    padding: 1rem 1.5rem;
    background: #0056b3;
    border: none;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-bar button:hover {
    background: #004494;
}

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 4px;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background-color: #f8fafc;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.suggestion-text strong {
    background-color: #fef3c7;
    padding: 0 2px;
    border-radius: 2px;
}

.suggestion-type {
    font-size: 0.8rem;
    color: #64748b;
    background-color: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

/* Loading and Empty States */
.loading-cell,
.empty-cell {
    padding: 3rem 2rem !important;
    text-align: center;
    background-color: #f8fafc;
}

.loading-content,
.empty-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading-content i {
    font-size: 2rem;
    color: #0056b3;
}

.loading-content span {
    color: #64748b;
    font-size: 1.1rem;
}

.empty-content i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 0.5rem;
}

.empty-content h3 {
    color: #475569;
    margin-bottom: 0.5rem;
}

.empty-content p {
    color: #64748b;
    margin-bottom: 1rem;
}

/* Results Count */
.results-count {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Models Section */
.models-section {
    padding: 3rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #0f3057;
}

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filters select {
    padding: 0.5rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
}

.filters select:focus {
    outline: none;
    border-color: #0056b3;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background: #f7fafc;
    font-weight: 600;
    color: #0f3057;
    cursor: pointer;
    user-select: none;
}

th:hover {
    background: #edf2f7;
}

th i {
    margin-left: 0.5rem;
    opacity: 0.5;
}

tr:hover {
    background: #f8fafc;
}

/* Badge Styles */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-primary {
    background: #0056b3;
    color: white;
}

.badge-success {
    background: #38a169;
    color: white;
}

.badge-warning {
    background: #d69e2e;
    color: white;
}

/* Action Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #0056b3;
    color: white;
}

.btn-primary:hover {
    background: #004494;
}

.btn-outline {
    background: transparent;
    border: 2px solid #0056b3;
    color: #0056b3;
}

.btn-outline:hover {
    background: #0056b3;
    color: white;
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
}

/* Circular Buttons */
.btn-circle {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
}

.btn-circle.btn-sm {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
}

.btn-circle:hover {
    transform: scale(1.1);
    transition: all 0.2s ease;
}

.btn-circle i {
    margin: 0;
}

/* Circular button states */
.btn-circle.added {
    background: #38a169;
    border-color: #38a169;
    color: white;
}

.btn-circle.added:hover {
    background: #2f855a;
    border-color: #2f855a;
}

.btn-circle.added i::before {
    content: '\f00c'; /* FontAwesome check icon */
}

/* Updates Section */
.updates-section {
    padding: 3rem 0;
    background: #f1f5f9;
}

.updates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.update-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
}

.update-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #38a169;
    color: white;
}

.update-card h3 {
    color: #0f3057;
    margin-bottom: 0.5rem;
}

.update-card p {
    color: #64748b;
    margin-bottom: 1rem;
}

.update-date {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background: #0f3057;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: #e0f7fa;
}

.footer-section a {
    display: block;
    color: #cbd5e1;
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #1e40af;
    color: #94a3b8;
}

/* Action buttons in table rows */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Performance score styling */
.performance-score {
    font-weight: 600;
}

.score-high {
    color: #38a169;
}

.score-medium {
    color: #d69e2e;
}

.score-low {
    color: #e53e3e;
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Selected Models Display */
.selected-models-container {
    margin-bottom: 2rem;
}

.selected-models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.selected-model-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 2px solid #e2e8f0;
    transition: all 0.2s;
}

.selected-model-card:hover {
    border-color: #0056b3;
    box-shadow: 0 6px 12px rgba(0, 86, 179, 0.1);
}

.selected-model-card .model-info h4 {
    color: #0f3057;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.selected-model-card .model-info p {
    color: #64748b;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.selected-model-card .model-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
}

.selected-model-card .model-params {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

.selected-model-card .model-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.empty-state .empty-content i {
    font-size: 2rem;
    color: #cbd5e1;
    margin-block: 0.5rem;
}

.empty-state .empty-content h3 {
    color: #475569;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.empty-state .empty-content p {
    color: #64748b;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.empty-state .browse-models-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
    color: white;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.3);
    font-size: 1.1rem;
}

.empty-state .browse-models-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 86, 179, 0.4);
    background: linear-gradient(135deg, #004494 0%, #003875 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Navigation */
    .nav-container {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 1.0rem;
    }

    /* Hero Section */
    .hero {
        padding: 2rem 0;
    }
    
    .hero-content h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-content p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        margin-inline: 1.0rem;
    }
    
    .search-bar {
        max-width: 90%;
        margin: 0 auto;
    }
    
    .search-bar input {
        padding: 0.75rem 0.875rem;
        font-size: 0.9rem;
    }
    
    .search-bar button {
        padding: 0.875rem 1.35rem;
    }

    /* Filters */
    .filters {
        flex-direction: row;
        gap: 0.75rem;
        width: 100%;
    }
    
    .filters select {
        width: 100%;
        flex: 1;
        min-width: 120px;
    }

    /* Table */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #modelsTable {
        min-width: 800px;
        font-size: 0.85rem;
    }
    
    #modelsTable th,
    #modelsTable td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }

    /* Buttons */
    .btn {
        padding: 0.5rem 0.5rem;
        font-size: 0.85rem;
    }

    /* Cards */
    .update-card {
        padding: 1rem;
    }
    
    .updates-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .selected-models-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Containers */
    .container {
        padding: 0 1rem;
    }
    
    .models-section {
        padding: 2rem 0;
    }

    /* Section Headers */
    .section-header {
        flex-direction: row;
        align-items: flex-start;
    }

    /* Loading and Empty States */
    .loading-cell,
    .empty-cell {
        padding: 2rem 1rem !important;
    }
    
    .empty-content h3 {
        font-size: 1.1rem;
    }
    
    .empty-content p {
        font-size: 0.9rem;
    }

    /* Search Suggestions */
    .search-suggestions {
        left: 0;
        right: 0;
        width: auto;
        margin: 4px 0 0 0;
    }
    
    .suggestion-item {
        padding: 1rem;
    }

    /* Footer responsive design */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .footer-section {
        text-align: center;
    }

    .footer-section p {
        margin-inline: 20%;
    }

    .footer-section h4 {
        font-size: 1.1rem;
    }

    .footer-section a {
        margin-bottom: 0.25rem;
        font-size: 0.9rem;
    }

    .footer-bottom {
        padding-top: 1.5rem;
        font-size: 0.8rem;
    }

    /* Browse Models Button */
    .empty-state .browse-models-btn {
        padding: 0rem 1rem;
        font-size: 1.1rem;
        border-radius: 8px;
    }

    .empty-state .browse-models-btn i {
        margin-block: 1rem;
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 0.5rem;
    }

    .hero {
        padding: 2rem 0;
    }

    .hero-content h1 {
        font-size: 1.75rem;
    }

    .hero-content p {
        align-content: center;
        margin-inline: 1rem;
        font-size: 0.9rem;
    }
    
    .search-bar {
        flex-direction: row;
        border-radius: 10px;
        max-width: 85%;
        position: relative;
    }
    
    .search-bar input {
        border-radius: 10px 0 0 10px;
        padding: 0.75rem 0.875rem;
        font-size: 0.9rem;
        width: auto;
    }
    
    .search-bar button {
        border-radius: 0 10px 10px 0;
        padding: 0.75rem 1rem;
        width: auto;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

    .footer-section p {
        margin-inline: 3%;
        font-size: 0.9rem;
    } 

    .footer-section h4 {
        font-size: 1rem;
    }
    
    .btn-circle:hover {
        transform: none; /* Disable hover scale on mobile */
    }

    /* Browse Models Button */
    .empty-state .browse-models-btn {
        padding: 0rem 1rem;
        font-size: 1rem;
        border-radius: 8px;
    }

    .empty-state .browse-models-btn i {
        margin-block: 0.75rem;
        font-size: 1.75rem;
    }
}
