/* API Explorer Layout */
.api-explorer {
    padding-top: 72px; /* Account for fixed header */
    min-height: 100vh;
    background: var(--bg-darker);
}

/* Logo and Product Name */
.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo .logo-svg {
    height: 32px;
    width: auto;
}

/* Make this selector more specific to override product.css */
.header .logo .product-name {
    display: inline-block !important; /* Force display */
    color: var(--text-light);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-left: 1rem;
    opacity: 1;
    z-index: 10;
}

/* API Navigation */
.api-nav {
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.api-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.api-tabs {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.api-tabs a {
    color: var(--text-gray);
    text-decoration: none;
    padding: 0.5rem 0;
    font-weight: 500;
    position: relative;
}

.api-tabs a.active {
    color: var(--text-light);
}

.api-tabs a.active::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.api-actions {
    display: flex;
    gap: 1rem;
}

/* Split Interface */
.api-interface {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    height: calc(100vh - 136px);
    background: var(--border-color);
}

/* Common Section Styles */
.query-section,
.results-section {
    background: var(--bg-darker);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.query-header,
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.query-header h2,
.results-header h2 {
    font-size: 1.25rem;
    color: var(--text-light);
}

.query-actions,
.results-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Query Editor */
.query-editor {
    flex: 1;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Inter', monospace;
    font-size: 1rem;
    color: var(--text-light);
    outline: none;
    resize: none;
    overflow-y: auto;
}

.query-editor:focus {
    border-color: var(--primary-color);
}

/* Entity Highlighting */
.entity {
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-weight: 500;
}

.entity.event {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

.entity.player {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

.entity.time {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

/* Query Suggestions */
.query-suggestions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.query-suggestions h3 {
    font-size: 0.875rem;
    color: var(--text-gray);
    margin-bottom: 0.75rem;
}

.suggestion-list {
    list-style: none;
    padding: 0;
}

.suggestion-list li {
    color: var(--text-gray);
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-list li:hover {
    background: var(--bg-dark);
    color: var(--text-light);
}

/* Results Viewer */
.results-viewer {
    flex: 1;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow-y: auto;
}

.results-viewer pre {
    margin: 0;
    padding: 0;
}

.results-viewer code {
    display: block;
    padding: 1rem;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    tab-size: 2;
}

/* Optional: Customize the highlight.js theme */
.hljs {
    background: var(--bg-dark) !important;
}

/* Add the Fira Code font for better code display */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&display=swap');

/* Button Styles */
.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--bg-dark);
    color: var(--text-light);
    border-color: var(--primary-color);
}

.format-select {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
}

/* AI Improvement Styles */
.improve-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.improve-btn i {
    color: #60a5fa;
}

.ai-suggestion {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    display: none;
}

.ai-suggestion.visible {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.ai-suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.ai-suggestion-header h4 {
    color: var(--text-light);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-suggestion-header h4 i {
    color: #60a5fa;
}

.ai-suggestion-actions {
    display: flex;
    gap: 0.5rem;
}

.ai-suggestion-text {
    color: var(--text-gray);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.improved-query {
    background: var(--bg-dark);
    padding: 0.75rem;
    border-radius: 6px;
    color: var(--text-light);
    font-family: 'Inter', monospace;
    margin-bottom: 0.75rem;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .api-interface {
        grid-template-columns: 1fr;
        height: auto;
        gap: 1rem;
    }

    .query-section,
    .results-section {
        height: 50vh;
    }
}

@media (max-width: 768px) {
    .api-nav .container {
        flex-direction: column;
        gap: 1rem;
    }

    .api-tabs {
        width: 100%;
        justify-content: center;
    }

    .query-section,
    .results-section {
        padding: 1rem;
    }

    .query-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .improve-btn {
        flex: 1;
        justify-content: center;
    }
}

/* Video Container Styles */
.video-container {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.video-container.hidden {
    display: none;
}

.video-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.video-header h3 {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
}

.result-video {
    width: 100%;
    max-height: 300px;
    background: black;
}

/* Loading State */
.export-video-btn.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.export-video-btn.loading i {
    animation: spin 1s linear infinite;
}

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

/* Format Views */
.format-view {
    height: 100%;
    overflow: auto;
}

.format-view.hidden {
    display: none;
}

/* Table View Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-dark);
    color: var(--text-light);
    font-weight: 500;
    white-space: nowrap;
}

.data-table td {
    color: var(--text-gray);
}

.data-table tbody tr:hover {
    background: var(--bg-dark);
}

/* Summary row styling */
.data-table tr.summary-row {
    background: rgba(59, 130, 246, 0.1);
    font-weight: 500;
}

.data-table tr.summary-row td {
    color: var(--text-light);
    border-bottom: 2px solid var(--border-color);
}

/* Metric value styling */
.data-table td:nth-child(3),
.data-table td:nth-child(4) {
    font-family: 'Fira Code', monospace;
    text-align: right;
}

/* Team comparison styling */
.data-table td:nth-child(4)[class*="+"]:not(:empty) {
    color: #34d399;
}

.data-table td:nth-child(4)[class*="-"]:not(:empty) {
    color: #f87171;
}

/* Details column styling */
.data-table td:last-child {
    color: var(--text-light);
    opacity: 0.8;
    font-size: 0.8125rem;
}

/* Graph View Styles */
.graph-view {
    padding: 1rem;
}

#resultsChart {
    width: 100% !important;
    height: 100% !important;
    min-height: 300px;
}

/* Query Interface Styles */
.query-interface {
    display: none;
    height: 100%;
}

.query-interface.active {
    display: block;
}

/* Natural Language Interface */
.natural-interface .query-editor {
    font-family: 'Inter', sans-serif;
}

/* GraphQL Interface */
.graphql-interface .query-editor {
    font-family: 'Fira Code', monospace;
    tab-size: 2;
    -moz-tab-size: 2;
}

/* REST Interface */
.rest-interface {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rest-params {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}

.param-group {
    margin-bottom: 1rem;
}

.param-group:last-child {
    margin-bottom: 0;
}

.param-group label {
    display: block;
    color: var(--text-gray);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.param-inputs {
    display: grid;
    gap: 0.5rem;
}

.param-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 0.5rem;
    align-items: center;
}

.param-row label {
    color: var(--text-light);
    font-size: 0.875rem;
    margin: 0;
}

.param-row input {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    color: var(--text-light);
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
}

.rest-url {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    color: var(--text-light);
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.rest-url .method {
    color: #10b981;
    font-weight: 500;
}

.rest-url .url {
    color: var(--text-gray);
    word-break: break-all;
}

/* Tab-specific elements */
.natural-only,
.graphql-only,
.rest-only {
    display: none;
}

.tab-natural .natural-only,
.tab-graphql .graphql-only,
.tab-rest .rest-only {
    display: flex;
}

/* Endpoint Select Styles */
.endpoint-select {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
    color: var(--text-light);
    font-size: 0.875rem;
    min-width: 200px;
}

.endpoint-select option {
    background: var(--bg-darker);
    color: var(--text-light);
    padding: 0.5rem;
}

/* GraphQL Example Queries */
.graphql-interface .suggestion-list li {
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
}

/* Active Tab Styles */
.api-tabs a.active {
    color: var(--text-light);
    position: relative;
}

.api-tabs a.active::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

/* Query Editor Language-specific Styles */
.query-editor {
    flex: 1;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text-light);
    outline: none;
    resize: none;
    overflow-y: auto;
    min-height: 200px;
}

.graphql-interface .query-editor,
.rest-interface .query-editor {
    font-family: 'Fira Code', monospace;
    white-space: pre;
}

/* Syntax Highlighting */
.graphql-interface .query-editor {
    color: #c678dd; /* GraphQL keywords */
}

.graphql-interface .query-editor .field {
    color: #98c379; /* Field names */
}

.graphql-interface .query-editor .argument {
    color: #d19a66; /* Arguments */
}

.graphql-interface .query-editor .string {
    color: #98c379; /* String values */
}

/* REST Error Messages */
.rest-error {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    color: #ef4444;
    font-size: 0.875rem;
}

/* Parameter Description Tooltips */
.param-row {
    position: relative;
}

.param-row label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.param-row label::after {
    content: attr(data-description);
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-gray);
    width: 200px;
    z-index: 10;
}

.param-row label:hover::after {
    display: block;
}

/* Multi-select Styles */
.multi-select-container {
    position: relative;
}

.multi-select {
    width: 100%;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    color: var(--text-light);
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
}

.multi-select option {
    padding: 0.25rem 0.5rem;
}

.selected-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

.remove-tag {
    background: none;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-tag:hover {
    color: var(--text-light);
}

/* Size the multi-select appropriately */
.multi-select[multiple] {
    height: 120px;
} 