/* Resources Page Styles */

/* Supported Resources Section */
.supported-resources {
    padding: 2.5rem 0;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.supported-resources h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--gold);
    font-size: 1.75rem;
    font-weight: 800;
}

.supported-resources > .container > p {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Tab Navigation */
.resource-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
    background: var(--bg-card);
    border-radius: 10px;
    padding: 0.4rem;
    border: 1px solid var(--border);
    box-shadow: 0 2px 10px var(--shadow);
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tab-button:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
}

.tab-button.active {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

.tab-icon {
    font-size: 1.1rem;
}

.tab-count {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-secondary);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
}

.tab-button.active .tab-count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* Tab Content */
.tab-content {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px var(--shadow);
    overflow: hidden;
    margin-bottom: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.tab-pane {
    display: none;
    padding: 0; /* Remove padding to make table edge-to-edge like admin dashboards */
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
}

.tab-pane.active {
    display: block;
    overflow-x: auto;
}

.resource-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem; /* Add padding here instead of tab-pane */
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
}

.resource-header h3 {
    color: var(--gold);
    font-size: 1.2rem;
    margin: 0;
    font-weight: 700;
}

.resource-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.stat-item {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-item span {
    color: var(--accent-blue);
    font-weight: 700;
}

/* Resource Table - Admin Dashboard Style */
.resource-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    font-size: 0.9rem;
    /* Use auto layout to respect content, preventing "scattered" fixed columns */
    table-layout: auto; 
    min-width: 100%;
}

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

.resource-table th {
    background: rgba(0, 0, 0, 0.2);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    white-space: nowrap; /* Prevent headers from wrapping awkwardly */
}

.resource-table td {
    color: var(--text-primary);
    vertical-align: middle;
}

/* Specific styling for columns to prevent layout shifts */
.resource-table td .monospace-text,
.resource-table td .link-text {
    display: inline-block;
    max-width: 300px; /* Limit width of long hashes/URLs */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.resource-table tbody tr {
    transition: background-color 0.2s ease;
}

.resource-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.resource-table tbody tr:last-child td {
    border-bottom: none;
}

.table-cell-with-icon {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.resource-icon-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.resource-icon-small[data-type="blockchain"],
.resource-icon-small[data-type="currency"],
.resource-icon-small[data-type="contract"] {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

.resource-icon-small[data-type="blockchain"] {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
}

.resource-icon-small[data-type="rpc-endpoint"] {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
}

.resource-icon-small[data-type="currency"] {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--dark-blue);
}

.resource-icon-small[data-type="contract"] {
    background: linear-gradient(135deg, var(--accent-blue), var(--primary-blue));
    color: white;
}

.resource-container {
    width: 100%;
    overflow-x: auto;
}

.resource-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.monospace-text {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
    font-style: italic;
}

.link-text {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

.link-text:hover {
    color: var(--secondary-blue);
    text-decoration: underline;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.status-badge.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.resource-grid {
    display: block; /* Override grid for table layout */
    width: 100%;
    overflow-x: auto;
}

.resource-grid::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.resource-grid::-webkit-scrollbar-track {
    background: rgba(51, 65, 85, 0.3);
    border-radius: 4px;
}

.resource-grid::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
}

.resource-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

.loading {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 1.1rem;
    width: 100%;
    display: block;
}

.sync-controls {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.sync-controls .btn-primary,
.sync-controls .btn-gold {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
}

.sync-status {
    font-size: 0.95rem;
    color: var(--text-secondary);
    min-height: 24px;
    text-align: center;
}

.sync-status.success {
    color: var(--success);
    font-weight: 600;
}

.sync-status.error {
    color: var(--error);
    font-weight: 600;
}

/* Responsive design for resources page */
@media (max-width: 1024px) {
    .resource-table {
        min-width: 1000px; /* Ensure horizontal scroll on tablets */
    }
}

@media (max-width: 768px) {
    .resource-tabs {
        flex-direction: column;
    }

    .tab-button {
        width: 100%;
        justify-content: center;
    }

    .resource-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .resource-stats {
        width: 100%;
        justify-content: space-between;
    }

    .tab-pane {
        padding: 0;
    }
    
    .resource-table th,
    .resource-table td {
        padding: 0.75rem 1rem;
    }
    
    .resource-table td .monospace-text,
    .resource-table td .link-text {
        max-width: 150px;
    }
}
