/* Blazor Store Diagnostics Panel Styles */

.blazor-store-diagnostics {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Floating mode */
.blazor-store-diagnostics.floating {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 600px;
    max-height: 70vh;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

/* Inline mode */
.blazor-store-diagnostics.inline {
    width: 100%;
    max-width: 100%;
    margin: 20px 0;
}

/* Header */
.diagnostics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px 8px 0 0;
    cursor: move;
    user-select: none;
}

.diagnostics-title {
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.diagnostics-actions {
    display: flex;
    gap: 8px;
}

.diagnostics-actions button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.diagnostics-actions button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Content */
.diagnostics-content {
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.diagnostics-content.collapsed {
    display: none;
}

/* Tabs */
.diagnostics-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.diagnostics-tab {
    padding: 10px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.diagnostics-tab:hover {
    color: #333;
    background: #e9ecef;
}

.diagnostics-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 500;
}

/* Tab content */
.diagnostics-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    max-height: 500px;
}

/* Common elements */
.diagnostic-section {
    margin-bottom: 20px;
}

.diagnostic-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #333;
}

/* State view */
.state-snapshot {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.state-diff {
    margin-top: 12px;
}

.property-change {
    padding: 6px 8px;
    margin: 4px 0;
    border-radius: 4px;
    font-size: 12px;
}

.property-change.modified {
    background: #fff3cd;
    border-left: 3px solid #ffc107;
}

.property-change.added {
    background: #d1ecf1;
    border-left: 3px solid #17a2b8;
}

.property-change.removed {
    background: #f8d7da;
    border-left: 3px solid #dc3545;
}

.property-name {
    font-weight: 600;
    color: #495057;
}

/* Render view */
.render-table {
    width: 100%;
    border-collapse: collapse;
}

.render-table th {
    text-align: left;
    padding: 8px;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 12px;
    color: #495057;
}

.render-table td {
    padding: 8px;
    border-bottom: 1px solid #e9ecef;
    font-size: 12px;
}

.render-table tr:hover {
    background: #f8f9fa;
}

.render-count {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 11px;
}

.render-count.low {
    background: #d1ecf1;
    color: #0c5460;
}

.render-count.medium {
    background: #fff3cd;
    color: #856404;
}

.render-count.high {
    background: #f8d7da;
    color: #721c24;
}

/* Performance view */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.metric-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    text-align: center;
}

.metric-label {
    font-size: 11px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.metric-value {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.metric-unit {
    font-size: 11px;
    color: #6c757d;
    margin-left: 2px;
}

.action-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.action-item {
    padding: 8px 12px;
    margin: 4px 0;
    background: #f8f9fa;
    border-left: 3px solid #667eea;
    border-radius: 0 4px 4px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.action-name {
    font-weight: 500;
    color: #333;
}

.action-duration {
    color: #6c757d;
    font-family: 'Courier New', monospace;
}

/* Subscription view */
.subscription-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subscription-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
}

.subscription-card.inactive {
    opacity: 0.6;
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.subscription-name {
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.subscription-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.subscription-badge.active {
    background: #d1ecf1;
    color: #0c5460;
}

.subscription-badge.disposed {
    background: #e2e3e5;
    color: #383d41;
}

.subscription-details {
    font-size: 11px;
    color: #6c757d;
    display: flex;
    gap: 16px;
}

/* Scrollbar styling */
.diagnostics-tab-content::-webkit-scrollbar {
    width: 8px;
}

.diagnostics-tab-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.diagnostics-tab-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.diagnostics-tab-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

.empty-state-text {
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .blazor-store-diagnostics.floating {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
        bottom: 10px;
    }

    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
