/* ==========================================
   Metadata Browser Styles
   ========================================== */

:root {
    --metadata-primary: #6366f1;
    --metadata-secondary: #a855f7;
    --metadata-accent: #ec4899;
    --metadata-bg: #f8fafc;
    --metadata-card-bg: #ffffff;
    --metadata-border: #e2e8f0;
    --metadata-text-main: #1e293b;
    --metadata-text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.2);
}

.metadata-container {
    min-height: 100vh;
    padding-bottom: 80px;
    background-color: var(--metadata-bg);
}

/* Header Section */
.metadata-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #c026d3 100%);
    padding: 100px 0 140px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.metadata-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 86c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm66-3c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zm-40-39c.552 0 1-.448 1-1s-.448-1-1-1-1 .448-1 1 .448 1 1 1zm50 38c.552 0 1-.448 1-1s-.448-1-1-1-1 .448-1 1 .448 1 1 1zM21 39c.552 0 1-.448 1-1s-.448-1-1-1-1 .448-1 1 .448 1 1 1zm18-15c.552 0 1-.448 1-1s-.448-1-1-1-1 .448-1 1 .448 1 1 1zm-6 32c.552 0 1-.448 1-1s-.448-1-1-1-1 .448-1 1 .448 1 1 1z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.4;
}

.metadata-header h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.metadata-header p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Stats Section Overlay */
.stats-container {
    margin-top: -60px;
    position: relative;
    z-index: 10;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.stat-card {
    background: white;
    border-radius: 24px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(226, 232, 240, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 35px -5px rgba(99, 102, 241, 0.2);
    border-color: #6366f1;
}

.stat-icon {
    width: 64px;
    height: 64px;
    background: #f1f5f9;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: #4f46e5;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.stat-card:hover .stat-icon {
    background: #4f46e5;
    color: white;
    transform: scale(1.1) rotate(5deg);
}

.stat-value {
    font-size: 2.75rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 4px;
    line-height: 1;
}

.stat-label {
    font-size: 1rem;
    color: #64748b;
    font-weight: 600;
}

/* Search Bar */
.search-section {
    margin: 60px 0 40px;
}

.search-bar {
    display: flex;
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 10px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--metadata-border);
}

.search-input {
    flex: 1;
    padding: 16px 24px;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    color: #1e293b;
}

.search-input:focus {
    outline: none;
}

.search-btn, .clear-btn {
    padding: 12px 32px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.search-btn {
    background: #4f46e5;
    color: white;
    border: none;
}

.search-btn:hover {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.clear-btn {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.clear-btn:hover {
    background: #e2e8f0;
}

/* Quick Filter */
.filter-section {
    margin: 40px 0;
}

.filter-section h3 {
    font-size: 1.25rem;
    margin-bottom: 24px;
    text-align: center;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.filter-btn {
    padding: 12px 24px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 100px;
    color: #475569;
    font-weight: 600;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.filter-btn:hover {
    background: #f8fafc;
    border-color: #4f46e5;
    color: #4f46e5;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Asset Sections */
.metadata-grid {
    display: flex;
    flex-direction: column;
    gap: 120px;
    margin-top: 60px;
    margin-bottom: 100px;
}

.asset-type-section {
    background: white;
    border-radius: 32px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.03);
    margin-bottom: 40px;
}

.asset-type-header {
    padding: 32px 40px 48px 40px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.asset-type-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 16px;
}

.asset-type-icon {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    color: #4f46e5;
}

.asset-type-badge {
    background: #eef2ff;
    color: #4f46e5;
    padding: 8px 20px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.9rem;
}

.tabs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 40px 40px 60px 40px;
    margin-bottom: 24px;
}

/* Tab Cards */
.tab-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 24px;
    transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tab-card:hover {
    border-color: #4f46e5;
    transform: translateY(-5px);
    box-shadow: 0 12px 25px -5px rgba(79, 70, 229, 0.15);
}

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

.tab-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
    padding-right: 30px;
}

.copy-icon {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    opacity: 0;
    transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
    border: none;
    cursor: pointer;
}

.tab-card:hover .copy-icon {
    opacity: 1;
}

.tab-card:hover .copy-icon:hover {
    background: #4f46e5;
    color: white;
}

.tab-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #4f46e5;
    background: #f5f3ff;
    padding: 6px 12px;
    border-radius: 8px;
    display: inline-block;
    align-self: flex-start;
    word-break: break-all;
    overflow-wrap: anywhere;
}

/* API Examples Section */
.api-reference {
    background: white;
    border-radius: 32px;
    padding: 60px;
    margin: 80px 0;
    border: 1px solid #e2e8f0;
}

.api-reference h2 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 40px;
    text-align: center;
}

.api-examples {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.api-example-card {
    background: #f8fafc;
    border-radius: 24px;
    padding: 32px;
    border: 1px solid #e2e8f0;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.api-example-card:hover {
    border-color: #4f46e5;
    background: white;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.api-example-card h4 {
    font-size: 1.25rem;
    margin-bottom: 16px;
}

.code-block {
    background: #1e293b;
    padding: 16px;
    border-radius: 12px;
    color: #e2e8f0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    margin: 20px 0;
    overflow-x: auto;
}

.example-note {
    font-size: 0.9rem;
    color: #64748b;
}

/* Export Section */
.export-section {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 32px;
    padding: 60px;
    color: white;
    text-align: center;
}

.export-section h3 {
    font-size: 2rem;
    margin-bottom: 40px;
}

.export-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.export-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 16px 32px;
    border-radius: 16px;
    font-weight: 700;
    backdrop-filter: blur(10px);
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.export-btn:hover {
    background: white;
    color: #1e293b;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .api-examples { grid-template-columns: 1fr; }
}

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

    .metadata-header {
        padding: 32px 0;
    }

    .metadata-header h1 {
        font-size: 1.75rem;
    }

    .metadata-header p {
        font-size: 0.9rem;
    }

    .stats-container {
        padding: 24px 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .search-section {
        padding: 20px 0;
    }

    .search-bar {
        flex-direction: column;
        padding: 16px;
        border-radius: 16px;
        gap: 12px;
    }

    .search-input {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    .search-btn,
    .clear-btn {
        width: 100%;
        padding: 12px;
        font-size: 0.9rem;
    }

    .filter-section {
        padding: 20px 0;
    }

    .filter-section h3 {
        font-size: 1rem;
        margin-bottom: 16px;
    }

    .filter-buttons {
        flex-wrap: wrap;
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .content-section {
        padding: 24px 0;
    }

    .metadata-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .asset-type-card {
        padding: 20px;
    }

    .asset-type-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 16px;
    }

    .asset-type-title {
        font-size: 1.2rem;
    }

    .tabs-grid {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 12px;
    }

    .tab-card {
        padding: 16px;
    }

    .tab-card h4 {
        font-size: 1rem;
    }

    .tab-card p {
        font-size: 0.85rem;
    }

    .api-reference {
        padding: 32px 0;
    }

    .api-reference h2 {
        font-size: 1.5rem;
    }

    .api-examples {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .api-example-card {
        padding: 20px;
    }

    .api-example-card h4 {
        font-size: 1.1rem;
    }

    .code-block {
        padding: 12px;
        font-size: 0.8rem;
        overflow-x: auto;
    }

    .example-note {
        font-size: 0.85rem;
    }

    .export-section {
        padding: 32px 0;
    }

    .export-section h3 {
        font-size: 1.2rem;
    }

    .export-section p {
        font-size: 0.9rem;
    }

    .export-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .export-btn {
        width: 100%;
        padding: 14px;
        font-size: 0.9rem;
    }

    .no-results {
        padding: 40px 20px;
    }

    .no-results h3 {
        font-size: 1.2rem;
    }

    .no-results p {
        font-size: 0.9rem;
    }
}

/* Highlight Animation */
@keyframes highlight {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); border-color: #4f46e5; box-shadow: 0 0 20px rgba(79, 70, 229, 0.4); }
    100% { transform: scale(1); }
}

.tab-card.highlight {
    animation: highlight 0.4s ease;
    border-color: #4f46e5;
}
