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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 10px 20px;
}

/* Icons */
i.fas {
    margin-right: 6px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Header */
header {
    text-align: center;
    border-bottom: 3px solid #FF9900;
    padding-bottom: 10px;
}

header h1 {
    font-size: 2em;
    color: #232f3e;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 5px;
}

.last-updated {
    font-size: 0.8em;
    color: #999;
    font-style: italic;
}

/* Filters */
.filters-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group > label {
    display: none;
    font-weight: 600;
    margin-bottom: 8px;
    color: #232f3e;
    font-size: 0.95em;
}

.filter-input,
.filter-select {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95em;
    transition: border-color 0.3s ease;
    height: 38px;
    line-height: 1.4;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #FF9900;
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.1);
}

.reset-btn {
    display: none;
}

.reset-btn:hover {
    display: none;
}

/* Multi-Select Dropdown */
.multi-select-wrapper {
    position: relative;
}

.multi-select-trigger {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.3s ease;
    user-select: none;
    font-size: 0.95em;
    height: 38px;
    line-height: 1.4;
}

.multi-select-trigger:hover {
    border-color: #FF9900;
}

.multi-select-trigger.active {
    border-color: #FF9900;
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.1);
}

.selected-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    margin-left: 8px;
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.multi-select-trigger.active .dropdown-arrow {
    transform: rotate(180deg);
}

.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow: hidden;
    flex-direction: column;
}

.multi-select-dropdown.active {
    display: flex;
}

.multi-select-search {
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.dropdown-search {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.9em;
}

.dropdown-search:focus {
    outline: none;
    border-color: #FF9900;
}

.multi-select-options {
    overflow-y: auto;
    max-height: 250px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
}

.checkbox-option:hover {
    background: #f8f9fa;
}

.checkbox-option input[type="checkbox"] {
    margin-right: 10px;
    margin-left: 0px;
    cursor: pointer;
}

input[type="checkbox"] {
    margin-right: 4px !important;
}

.multi-select-options::-webkit-scrollbar {
    width: 8px;
}

.multi-select-options::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.multi-select-options::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.multi-select-options::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Results Info */
.results-info {
    margin-bottom: 20px;
    padding: 10px 20px;
    background: #e8f4f8;
    border-left: 4px solid #0073bb;
    border-radius: 4px;
}

.results-info p {
    color: #232f3e;
    font-weight: 500;
}

/* Models Grid - Card Layout */
.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.model-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

.model-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.model-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 10px;
}

.model-card-title {
    flex: 1;
}

.model-id {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    font-weight: 600;
    color: #232f3e;
    word-break: break-all;
    margin-bottom: 4px;
}

.model-name {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 8px;
}

.model-provider {
    display: inline-block;
    padding: 4px 8px;
    background: #fff3e0;
    color: #e65100;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 500;
}

.model-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.model-card-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.model-card-row-inline {
    flex-direction: row;
    gap: 16px;
    align-items: flex-start;
}

.model-card-inline-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 0;
    min-width: 0;
}

@media (max-width: 520px) {
    .model-card-row-inline {
        flex-direction: column;
    }
}

.model-card-label {
    font-size: 0.75em;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.model-card-content {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.region-group {
    display: inline-block;
    padding: 2px 6px;
    background: #f0f0f0;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.region-group:hover {
    background: #e0e0e0;
}

.region-tooltip {
    position: fixed;
    background: #232f3e;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    max-width: 300px;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.region-tooltip .region-item {
    padding: 3px 0;
    white-space: nowrap;
}

.region-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.region-tooltip.sticky {
    pointer-events: auto;
    cursor: pointer;
}

.model-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.8em;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-legacy {
    background: #f8d7da;
    color: #721c24;
}

.streaming-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.8em;
    background: #e8f4f8;
    color: #0073bb;
}

.beta-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.8em;
    background: #fff3cd;
    color: #ff9900;
    border: 1px solid #ffc107;
    cursor: help;
    position: relative;
}

.beta-badge:hover {
    background: #ffe9a6;
    border-color: #ffb700;
    box-shadow: 0 2px 8px rgba(255, 153, 0, 0.3);
}

.beta-tooltip {
    position: fixed;
    background: #232f3e;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    max-width: 300px;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.beta-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.beta-tooltip.sticky {
    pointer-events: auto;
    cursor: pointer;
}

.profiles-btn {
    padding: 8px 14px;
    background: #FF9900;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    transition: background 0.3s ease;
    white-space: nowrap;
    margin-left: auto;
}

.profiles-btn:hover {
    background: #e68a00;
}

.profiles-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Old table styles hidden */
.table-wrapper {
    display: none;
}

.models-table {
    display: none;
}

/* Table Cell Styles */
.modality-tag {
    display: inline;
    font-size: 0.9em;
    color: #0073bb;
}

.region-tag {
    display: inline;
    font-size: 0.9em;
    color: #333;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.85em;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-legacy {
    background: #f8d7da;
    color: #721c24;
}

/* Buttons */
.profiles-btn {
    padding: 8px 14px;
    background: #FF9900;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    transition: background 0.3s ease;
}

.profiles-btn:hover {
    background: #e68a00;
}

.profiles-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.modal-header h2 {
    color: #232f3e;
    font-size: 1.3em;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #000;
}

.modal-body {
    padding: 15px 20px;
}

.profiles-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.profile-item 2px 1{
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.profile-item:hover {
    background: #f0f0f0;
}

.profile-name {
    font-weight: 600;
    color: #232f3e;
    margin-bottom: 8px;
    font-size: 1.05em;
}

.profile-description {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.profile-id-section {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.profile-id-label {
    font-size: 0.85em;
    color: #666;
    font-weight: 500;
}

.profile-id-value {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    padding: 6px 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.85em;
    word-break: break-all;
    flex: 1;
}

.copy-btn {
    padding: 6px 12px;
    background: #0073bb;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: background 0.3s ease;
}

.copy-btn:hover {
    background: #005a96;
}

.copy-btn.copied {
    background: #28a745;
}

.profile-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 0.85em;
    color: #666;
}

.profile-meta-item {
    display: flex;
    justify-content: space-between;
}

.profile-meta-label {
    font-weight: 500;
}

.profile-meta-value {
    color: #333;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 0.85em;
}

footer p {
    margin-bottom: 8px;
}

footer a {
    color: #FF9900;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .filters-container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .models-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .filters-container {
        grid-template-columns: 1fr;
    }

    .reset-btn {
        align-self: stretch;
    }

    .models-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-width: 95vw;
    }

    .profile-meta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
        border-radius: 0;
    }

    header h1 {
        font-size: 1.4em;
    }

    header {
        padding-bottom: 15px;
    }

    .models-grid {
        grid-template-columns: 1fr;
    }

    .profiles-btn {
        padding: 6px 10px;
        font-size: 0.8em;
    }

    .profile-id-section {
        flex-direction: column;
    }

    .copy-btn {
        width: 100%;
    }
}
