/* 
 * Admin styles for Django Testimonials
 * Optimized for performance and better UX
 */

/* === TESTIMONIAL LIST VIEW === */

.testimonial-rating {
    font-size: 16px;
    color: #ffc107;
    white-space: nowrap;
}

.testimonial-rating .star {
    display: inline-block;
    margin-right: 1px;
}

.testimonial-rating .filled {
    color: #ffc107;
}

.testimonial-rating .empty {
    color: #dee2e6;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
    white-space: nowrap;
}

.status-badge.pending {
    background-color: #f8c291;
    color: #8B4513;
}

.status-badge.approved {
    background-color: #7bed9f;
    color: #2d5016;
}

.status-badge.rejected {
    background-color: #ff6b6b;
    color: #721c24;
}

.status-badge.featured {
    background-color: #70a1ff;
    color: #1e3a8a;
}

.status-badge.archived {
    background-color: #a4b0be;
    color: #374151;
}

/* Media thumbnails */
.media-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.video-thumbnail,
.audio-thumbnail,
.document-thumbnail {
    display: inline-block;
    width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 20px;
}

.video-thumbnail {
    background-color: #e3f2fd;
}

.audio-thumbnail {
    background-color: #f3e5f5;
}

.document-thumbnail {
    background-color: #fff3e0;
}

/* === TESTIMONIAL FORM === */

.testimonial-form .form-row {
    margin-bottom: 15px;
}

.testimonial-content {
    min-height: 120px;
    resize: vertical;
}

.json-field {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    resize: vertical;
}

/* === STAR RATING WIDGET === */

.star-rating-container {
    display: flex;
    gap: 4px;
    align-items: center;
}

.star-rating-item {
    position: relative;
}

.star-rating-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.star-rating-label {
    display: inline-block;
    font-size: 20px;
    color: #dee2e6;
    cursor: pointer;
    transition: color 0.2s ease;
    margin: 0;
    padding: 2px;
}

.star-rating-item input[type="radio"]:checked ~ .star-rating-label,
.star-rating-item input[type="radio"]:checked ~ .star-rating-label ~ .star-rating-label {
    color: #ffc107;
}

.star-rating-label:hover,
.star-rating-item:hover ~ .star-rating-item .star-rating-label {
    color: #ffc107;
}

/* === BULK ACTIONS === */

.bulk-action-form {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
}

.bulk-action-form h3 {
    margin-top: 0;
    color: #495057;
}

.bulk-action-form .form-group {
    margin-bottom: 15px;
}

.bulk-action-form label {
    font-weight: 600;
    color: #495057;
}

.bulk-action-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    resize: vertical;
}

.bulk-action-form .help-text {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

/* === MEDIA PREVIEW === */

.media-preview {
    max-width: 100%;
    max-height: 300px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-top: 10px;
}

.media-preview img {
    max-width: 100%;
    height: auto;
}

.media-preview video,
.media-preview audio {
    max-width: 100%;
}

.document-link {
    display: inline-block;
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 10px;
}

.document-link:hover {
    background-color: #0056b3;
    color: white;
    text-decoration: none;
}

/* === RESPONSIVE DESIGN === */

@media (max-width: 768px) {
    .star-rating-container {
        flex-wrap: wrap;
    }
    
    .star-rating-label {
        font-size: 18px;
    }
    
    .media-thumbnail {
        width: 40px;
        height: 40px;
    }
    
    .status-badge {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .bulk-action-form {
        padding: 15px;
    }
}

/* === PERFORMANCE OPTIMIZATIONS === */

/* GPU acceleration for smooth animations */
.star-rating-label,
.status-badge,
.media-thumbnail {
    will-change: transform;
    transform: translateZ(0);
}

/* Reduce layout thrashing */
.testimonial-rating,
.status-badge {
    contain: layout style;
}

/* === ACCESSIBILITY === */

.star-rating-item input[type="radio"]:focus + .star-rating-label {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

.status-badge {
    speak: literal-punctuation; /* For screen readers */
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .star-rating-label {
        border: 1px solid;
    }
    
    .status-badge {
        border: 2px solid;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .star-rating-label,
    .status-badge,
    .media-thumbnail {
        transition: none;
    }
}

/* === DASHBOARD SPECIFIC STYLES === */

.testimonials-dashboard .module {
    margin-bottom: 20px;
}

.testimonials-dashboard .dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.testimonials-dashboard .stat-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.testimonials-dashboard .stat-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 5px;
}

.testimonials-dashboard .stat-label {
    color: #6c757d;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === LOADING STATES === */

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* === PRINT STYLES === */

@media print {
    .testimonial-rating,
    .status-badge {
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    
    .media-thumbnail,
    .loading-spinner,
    .bulk-action-form {
        display: none;
    }
}