/* Score Badge Styles */
.mn-rest-score-badge {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 10;
    transition: all 0.3s ease;
    user-select: none;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.mn-rest-score-badge:hover {
    transform: scale(1.2) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: none;
}

/* Badge positioning */
.mn-rest-badge-wrapper {
    position: relative;
    display: inline-block;
}

.mn-rest-badge-wrapper.position-top-right .mn-rest-score-badge {
    top: -5px;
    right: -5px;
}

.mn-rest-badge-wrapper.position-top-left .mn-rest-score-badge {
    top: -5px;
    left: -5px;
}

.mn-rest-badge-wrapper.position-bottom-right .mn-rest-score-badge {
    bottom: -5px;
    right: -5px;
}

.mn-rest-badge-wrapper.position-bottom-left .mn-rest-score-badge {
    bottom: -5px;
    left: -5px;
}

/* Score Details Popup */
.mn-rest-score-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.mn-rest-score-popup-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mn-rest-score-popup {
    background: #ffffff;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Popup Header */
.mn-rest-popup-header {
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    position: relative;
}

.mn-rest-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background 0.2s ease;
}

.mn-rest-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mn-rest-popup-user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mn-rest-popup-user-info .avatar {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

.mn-rest-popup-user-name {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.mn-rest-popup-total-score {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
}

.mn-rest-popup-total-label {
    font-size: 12px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Popup Content */
.mn-rest-popup-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.mn-rest-activities-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mn-rest-activity-item {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 16px;
    transition: background 0.2s ease;
}

.mn-rest-activity-item:hover {
    background: #f9fafb;
}

.mn-rest-activity-item:last-child {
    border-bottom: none;
}

.mn-rest-activity-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.mn-rest-activity-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.mn-rest-activity-details {
    flex: 1;
    min-width: 0;
}

.mn-rest-activity-description {
    font-size: 15px;
    font-weight: 500;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.mn-rest-activity-meta {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.mn-rest-activity-endpoint {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #9ca3af;
    margin: 4px 0 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mn-rest-activity-score {
    flex-shrink: 0;
    font-size: 18px;
    font-weight: 700;
    color: #10b981;
    align-self: center;
}

/* Popup Footer */
.mn-rest-popup-footer {
    padding: 16px 24px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mn-rest-popup-pagination {
    display: flex;
    gap: 8px;
}

.mn-rest-popup-pagination button {
    background: #ffffff;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.mn-rest-popup-pagination button:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.mn-rest-popup-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mn-rest-popup-info {
    font-size: 13px;
    color: #6b7280;
}

/* Loading State */
.mn-rest-popup-loading {
    padding: 60px;
    text-align: center;
    color: #6b7280;
}

.mn-rest-popup-loading .spinner {
    margin: 0 auto 16px;
    float: none;
}

/* Empty State */
.mn-rest-popup-empty {
    padding: 60px 24px;
    text-align: center;
    color: #6b7280;
}

.mn-rest-popup-empty .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    opacity: 0.3;
    margin-bottom: 16px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mn-rest-score-popup {
        max-width: 100%;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .mn-rest-popup-header {
        padding: 20px;
    }
    
    .mn-rest-popup-user-name {
        font-size: 18px;
    }
    
    .mn-rest-popup-total-score {
        font-size: 28px;
    }
    
    .mn-rest-activity-item {
        padding: 16px 20px;
    }
    
    .mn-rest-activity-icon {
        width: 36px;
        height: 36px;
    }
    
    .mn-rest-activity-description {
        font-size: 14px;
    }
    
    .mn-rest-popup-footer {
        flex-direction: column;
        gap: 12px;
    }
}

/* Settings Page Styles */
.mn-rest-settings-page {
    max-width: 900px;
}

.mn-rest-settings-section {
    background: #ffffff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.mn-rest-settings-section h3 {
    margin-top: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.mn-rest-network-control {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
}

.mn-rest-network-control h3 {
    color: #0369a1;
    border-bottom-color: #0ea5e9;
}

.mn-rest-settings-form input[disabled],
.mn-rest-settings-form select[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f5f5f5;
}

.mn-rest-settings-form tr:has(input[disabled]) {
    background: #fafafa;
}

.mn-rest-plugin-inactive {
    color: #d97706;
    font-weight: 500;
}

.mn-rest-settings-preview {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    margin-top: 20px;
}

.mn-rest-preview-container {
    margin-top: 16px;
}

.mn-rest-preview-avatar {
    position: relative;
    display: inline-block;
}
