/* Additional CSS styles for enhanced Apple-like design */

/* Line clamp utility for text truncation */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007AFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hover effects */
.video-card {
    transition: all 0.3s ease;
}

.video-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .video-card {
        margin-bottom: 1.5rem;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Improve mobile video cards */
    .video-card .flex {
        flex-direction: column;
    }
    
    .video-card .lg\:w-1\/3 {
        width: 100%;
    }
    
    .video-card .absolute.top-4.left-4 {
        top: 8px;
        left: 8px;
    }
    
    .video-card .absolute.top-4.right-4 {
        top: 8px;
        right: 8px;
    }
    
    /* Mobile-friendly buttons */
    .video-card .flex.space-x-3 {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .video-card .flex.space-x-3 > * {
        margin: 0;
        text-align: center;
    }
    
    /* Mobile stats grid */
    .grid.grid-cols-2.md\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    /* Mobile hero section */
    .text-4xl.md\:text-5xl {
        font-size: 2rem;
        line-height: 1.1;
    }
    
    .text-xl {
        font-size: 1.125rem;
        line-height: 1.4;
    }
}

/* Focus states for accessibility */
select:focus,
button:focus,
a:focus {
    outline: 2px solid #007AFF;
    outline-offset: 2px;
}

/* Enhanced button styles */
.btn-primary {
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

/* Card animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-card {
    animation: fadeInUp 0.5s ease-out;
}

/* Trending score indicator */
.trending-score {
    background: linear-gradient(135deg, #34C759 0%, #30D158 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Category tags */
.category-tag {
    background: rgba(0, 122, 255, 0.1);
    color: #007AFF;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Mobile navigation */
@media (max-width: 768px) {
    .mobile-nav {
        display: block;
    }
    
    .desktop-nav {
        display: none;
    }
    
    .mobile-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        transition: left 0.3s ease;
        z-index: 1000;
    }
    
    .mobile-menu.open {
        left: 0;
    }
    
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-overlay.open {
        opacity: 1;
        visibility: visible;
    }
}

/* Enhanced Apple-style components */
.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.gradient-text {
    background: linear-gradient(135deg, #007AFF 0%, #AF52DE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Improved video thumbnails */
.video-thumbnail {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.video-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.video-thumbnail:hover::before {
    transform: translateX(100%);
}

/* Status indicators */
.status-new {
    background: linear-gradient(135deg, #34C759 0%, #30D158 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.status-trending {
    background: linear-gradient(135deg, #FF3B30 0%, #FF9500 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-popular {
    background: linear-gradient(135deg, #AF52DE 0%, #007AFF 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Enhanced metrics display */
.metric-card {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.1) 0%, rgba(175, 82, 222, 0.1) 100%);
    border: 1px solid rgba(0, 122, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.15);
}

/* Responsive grid improvements */
@media (max-width: 640px) {
    .grid-responsive {
        grid-template-columns: 1fr;
    }
    
    .grid-responsive-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .grid-responsive {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-responsive-2 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1025px) {
    .grid-responsive {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-responsive-2 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Loading states */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-apple-blue {
        background-color: #0000FF !important;
    }
    
    .text-apple-gray {
        color: #000000 !important;
    }
    
    .border-gray-200 {
        border-color: #000000 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #000000;
        color: #ffffff;
    }
    
    .bg-white {
        background-color: #1C1C1E !important;
    }
    
    .text-apple-dark {
        color: #ffffff !important;
    }
    
    .text-apple-gray {
        color: #98989D !important;
    }
    
    .bg-apple-light-gray {
        background-color: #2C2C2E !important;
    }
    
    .glass-card {
        background: rgba(28, 28, 30, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .skeleton {
        background: linear-gradient(90deg, #2C2C2E 25%, #3A3A3C 50%, #2C2C2E 75%);
        background-size: 200% 100%;
    }
}