/**
 * Custom CSS
 * Only essential styles that can't be achieved with Tailwind utilities
 * Most styles should be migrated to Tailwind classes
 */

/* Theme variables for dark mode compatibility */
:root {
    --accent-primary: #ff0055;
    --accent-secondary: #ff4081;
}

/* Prevent layout shift for images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Media container - renamed from embed-responsive to avoid ad detection */
.media-container {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
}

.media-container::before {
    content: "";
    display: block;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

.media-content {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Legacy class support - keep for backward compatibility */
.embed-responsive {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
}

.embed-responsive::before {
    content: "";
    display: block;
    padding-top: 56.25%;
}

.embed-responsive-item {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Loading spinner */
.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Optimize animations for compositing */
.loading-spinner,
.engagement-widget,
.tag-link,
.btn-primary,
.btn-secondary {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Dark mode loading spinner */
.dark .loading-spinner {
    border-color: #374151;
    border-top-color: var(--accent-primary);
}

/* Media placeholder styles - renamed from webcam-placeholder to avoid ad detection */
.media-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.media-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(255,0,85,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.media-placeholder:hover {
    background: linear-gradient(135deg, #1f1f3a 0%, #1a2744 50%, #141428 100%);
    transform: scale(1.01);
}

.media-placeholder:hover .play-button {
    transform: scale(1.15);
    box-shadow: 0 8px 32px rgba(255, 0, 85, 0.5);
}

.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 1;
}

.play-button {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ff0055 0%, #ff4081 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 4px 24px rgba(255, 0, 85, 0.4);
    transition: all 0.3s ease;
    padding-left: 6px;
}

.placeholder-text {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.placeholder-subtext {
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .play-button {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    .placeholder-text {
        font-size: 1.2rem;
    }
}

/* Card component */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
}

.dark .card {
    background: #1f2937;
    border-color: #374151;
}

/* Tag link styling */
.tag-link {
    display: inline-block;
    padding: 0.5rem 0.875rem;
    background: #f3f4f6;
    color: #1f2937;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: transform 0.2s, background-color 0.2s;
    text-decoration: none;
    min-height: 32px;
    line-height: 1.5;
}

.tag-link:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
    will-change: transform;
}

.dark .tag-link {
    background: #374151;
    color: #f9fafb;
}

.dark .tag-link:hover {
    background: #4b5563;
}

/* Button styles - using Tailwind classes but keeping for backward compatibility */
.btn-primary {
    background-color: #ff0055;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    border: none;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    line-height: 1.5;
}

.btn-primary:hover {
    background-color: #e6004c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 0, 85, 0.3);
    will-change: transform;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s, background-color 0.2s;
    border: none;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    line-height: 1.5;
}

.btn-secondary:hover {
    background-color: #4b5563;
    transform: translateY(-1px);
    will-change: transform;
}

.dark .btn-primary {
    background-color: #ff0055;
}

.dark .btn-secondary {
    background-color: #6b7280;
}

/* Engagement Widgets */
.engagement-widget {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e5e7eb;
}

.dark .engagement-widget {
    background: #1f2937;
    border-color: #374151;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.engagement-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    will-change: transform;
}

.dark .engagement-widget:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.engagement-widget h3 {
    color: #ff0055;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.dark .engagement-widget h3 {
    color: #ff4081;
    border-bottom-color: #374151;
}

/* Widgets Grid */
.widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .widgets-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Live Count Widget */
.engagement-widget.live-count {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #ff0055, #ff4081);
    color: white;
    border: none;
}

.engagement-widget.live-count:hover {
    background: linear-gradient(135deg, #e6004c, #e6396f);
}

.widget-icon {
    font-size: 2rem;
    margin-right: 1rem;
}

.widget-content {
    flex: 1;
}

.widget-number {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
    color: white;
}

.widget-label {
    font-size: 0.9rem;
    opacity: 0.9;
    color: white;
}

/* Popular Tags Widget */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-badge {
    display: inline-block;
    background: linear-gradient(45deg, #ff0055, #ff4081);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tag-badge:hover {
    background: linear-gradient(45deg, #e6004c, #e6396f);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 0, 85, 0.3);
}

.tag-badge .count {
    opacity: 0.9;
    font-size: 0.8rem;
    margin-left: 4px;
}

/* Recent Activity Widget */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f3f4f6;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.dark .activity-item {
    background: #374151;
}

.activity-item:hover {
    background: #e5e7eb;
}

.dark .activity-item:hover {
    background: #4b5563;
}

.activity-username {
    font-weight: 600;
    color: #ff0055;
}

.dark .activity-username {
    color: #ff4081;
}

.activity-username a {
    color: inherit;
    text-decoration: none;
}

.activity-username a:hover {
    text-decoration: underline;
}

.activity-show {
    color: #6b7280;
    font-size: 0.9rem;
    flex: 1;
    margin: 0 1rem;
}

.dark .activity-show {
    color: #9ca3af;
}

.activity-viewers {
    color: #10b981;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Testimonials Widget */
.testimonials-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.testimonial-item {
    padding: 1rem;
    background: #f3f4f6;
    border-radius: 8px;
    border-left: 4px solid #ff0055;
}

.dark .testimonial-item {
    background: #374151;
    border-left-color: #ff4081;
}

.testimonial-rating {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 0.5rem;
    color: #374151;
}

.dark .testimonial-text {
    color: #d1d5db;
}

.testimonial-author {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.9rem;
}

.dark .testimonial-author {
    color: #9ca3af;
}

/* Stats Widget */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.dark .stat-item {
    background: linear-gradient(135deg, #374151, #4b5563);
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff0055;
    line-height: 1;
}

.dark .stat-number {
    color: #ff4081;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.dark .stat-label {
    color: #9ca3af;
}

/* Responsive Widgets */
@media (max-width: 768px) {
    .engagement-widget {
        padding: 1rem;
    }
    
    .live-count {
        flex-direction: column;
        text-align: center;
    }
    
    .widget-icon {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .activity-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .activity-show {
        margin: 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tags-list {
        justify-content: center;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
}
