/**
 * Halloween YouTube Projector Pro - Frontend CSS
 * Base styles for all themes
 */

/* Reset and base styles */
.hyp-widget {
    position: relative;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 1.5rem;
    border-radius: 20px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    box-sizing: border-box;
}

.hyp-widget *,
.hyp-widget *::before,
.hyp-widget *::after {
    box-sizing: inherit;
}

/* Floating ghosts animation */
.hyp-floating-ghosts {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.hyp-ghost {
    position: absolute;
    font-size: 2rem;
    animation: hyp-float 6s ease-in-out infinite;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 10px rgba(255, 210, 63, 0.6));
    user-select: none;
}

.hyp-ghost:hover,
.hyp-ghost:focus {
    transform: scale(1.2) rotate(15deg);
    animation-duration: 2s;
    outline: none;
}

.hyp-ghost-1 {
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.hyp-ghost-2 {
    top: 20%;
    right: 10%;
    animation-delay: -2s;
}

.hyp-ghost-3 {
    bottom: 30%;
    left: 15%;
    animation-delay: -4s;
}

.hyp-ghost-4 {
    bottom: 10%;
    right: 5%;
    animation-delay: -1s;
}

@keyframes hyp-float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-15px) rotate(5deg); }
    66% { transform: translateY(-10px) rotate(-3deg); }
}

/* Header styles */
.hyp-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 5;
}

.hyp-title {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    position: relative;
}

.hyp-title::after {
    content: '🎃👻🎃';
    display: block;
    font-size: 1.5rem;
    margin-top: 0.5rem;
    animation: hyp-bounce 2s infinite;
}

.hyp-subtitle {
    font-size: 1.1rem;
    margin: 0;
    font-weight: 500;
    opacity: 0.9;
}

@keyframes hyp-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Videos grid */
.hyp-videos-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 5;
}

/* Responsive grid - Mobile first */
.hyp-videos-grid[data-mobile-cols="1"] {
    grid-template-columns: 1fr;
}

.hyp-videos-grid[data-mobile-cols="2"] {
    grid-template-columns: repeat(2, 1fr);
}

/* Tablet breakpoint */
@media (min-width: 768px) {
    .hyp-videos-grid[data-tablet-cols="1"] {
        grid-template-columns: 1fr;
    }
    
    .hyp-videos-grid[data-tablet-cols="2"] {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hyp-videos-grid[data-tablet-cols="3"] {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop breakpoint */
@media (min-width: 1024px) {
    .hyp-videos-grid[data-desktop-cols="2"] {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hyp-videos-grid[data-desktop-cols="3"] {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .hyp-videos-grid[data-desktop-cols="4"] {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Video cards */
.hyp-video-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.hyp-video-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* Thumbnail container */
.hyp-thumbnail-container {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.hyp-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hyp-video-card:hover .hyp-thumbnail {
    transform: scale(1.05);
}

/* Play overlay */
.hyp-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(44, 24, 16, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hyp-video-card:hover .hyp-play-overlay {
    opacity: 1;
}

.hyp-play-button {
    width: 60px;
    height: 60px;
    background: #ff6b35;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    transform: scale(0.8);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.hyp-video-card:hover .hyp-play-button {
    transform: scale(1);
    background: #ffd23f;
    color: #2c1810;
}

/* Video content */
.hyp-video-content {
    padding: 1.2rem;
}

.hyp-video-title {
    margin: 0 0 0.8rem 0;
    font-size: 1.1rem;
    line-height: 1.4;
    font-weight: 600;
}

.hyp-video-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hyp-video-link:hover,
.hyp-video-link:focus {
    color: #ff6b35;
    outline: none;
}

.hyp-video-meta {
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hyp-video-meta::before {
    content: '🕐';
}

/* CTA Section */
.hyp-cta-section {
    position: relative;
    z-index: 5;
    margin-top: 3rem;
}

/* Scroll indicator */
.hyp-scroll-indicator {
    text-align: center;
    margin-bottom: 2rem;
    animation: hyp-pulse 2s infinite;
}

.hyp-scroll-arrow {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    animation: hyp-bounce-down 2s infinite;
}

.hyp-scroll-text {
    color: #666;
    font-size: 1rem;
    margin: 0;
    font-style: italic;
}

@keyframes hyp-bounce-down {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

@keyframes hyp-pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* CTA Card */
.hyp-cta-card {
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

/* CTA Image */
.hyp-cta-image-container {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.hyp-cta-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hyp-cta-card:hover .hyp-cta-image {
    transform: scale(1.1);
}

/* Image overlay with particles */
.hyp-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 0%, rgba(44, 24, 16, 0.6) 100%);
}

.hyp-spooky-particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.hyp-particle {
    position: absolute;
    font-size: 1.5rem;
    animation: hyp-particle-float 4s ease-in-out infinite;
    opacity: 0.8;
}

.hyp-particle:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.hyp-particle:nth-child(2) {
    top: 60%;
    right: 15%;
    animation-delay: -1s;
}

.hyp-particle:nth-child(3) {
    bottom: 30%;
    left: 20%;
    animation-delay: -2s;
}

.hyp-particle:nth-child(4) {
    top: 40%;
    right: 30%;
    animation-delay: -0.5s;
}

@keyframes hyp-particle-float {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.8; }
    33% { transform: translateY(-20px) rotate(120deg); opacity: 1; }
    66% { transform: translateY(-10px) rotate(240deg); opacity: 0.6; }
}

/* CTA Content */
.hyp-cta-content {
    padding: 2rem;
}

.hyp-cta-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hyp-cta-description {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

/* Features grid */
.hyp-cta-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.hyp-feature {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.8rem;
    border-radius: 10px;
    text-align: center;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 210, 63, 0.3);
    transition: all 0.3s ease;
}

.hyp-feature:hover {
    background: rgba(255, 210, 63, 0.2);
    transform: translateY(-2px);
}

/* CTA Button */
.hyp-cta-button {
    display: inline-block;
    background: linear-gradient(45deg, #ff6b35, #ffd23f);
    color: #2c1810;
    padding: 1.2rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
    position: relative;
    overflow: hidden;
}

.hyp-cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.hyp-cta-button:hover::before {
    left: 100%;
}

.hyp-cta-button:hover,
.hyp-cta-button:focus {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 35px rgba(255, 107, 53, 0.6);
    background: linear-gradient(45deg, #ffd23f, #ff6b35);
    outline: none;
}

/* Disclaimer */
.hyp-affiliate-disclaimer {
    margin-top: 1rem;
    text-align: center;
    opacity: 0.7;
    font-size: 0.85rem;
}

/* Error message */
.hyp-error {
    text-align: center;
    color: #ff6b35;
    font-size: 1.1rem;
    padding: 2rem;
    background: rgba(255, 107, 53, 0.1);
    border-radius: 10px;
    border: 2px dashed #ff6b35;
    margin: 2rem 0;
}

/* Screen reader only */
.hyp-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;
}

/* Mobile optimizations */
@media (max-width: 767px) {
    .hyp-widget {
        margin: 1rem;
        padding: 1rem;
        border-radius: 15px;
    }
    
    .hyp-title {
        font-size: 1.8rem;
    }
    
    .hyp-ghost {
        font-size: 1.5rem;
    }
    
    .hyp-cta-content {
        padding: 1.5rem;
    }
    
    .hyp-cta-title {
        font-size: 1.5rem;
    }
    
    .hyp-cta-features {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hyp-cta-button {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .hyp-ghost,
    .hyp-scroll-arrow,
    .hyp-particle,
    .hyp-title::after {
        animation: none;
    }
    
    .hyp-video-card:hover,
    .hyp-cta-button:hover {
        transform: none;
    }
    
    .hyp-thumbnail,
    .hyp-cta-image {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hyp-video-card {
        border: 2px solid currentColor;
    }
    
    .hyp-play-button {
        border: 2px solid currentColor;
    }
    
    .hyp-cta-button {
        border: 2px solid currentColor;
    }
}

/* Print styles */
@media print {
    .hyp-floating-ghosts,
    .hyp-play-overlay,
    .hyp-scroll-indicator,
    .hyp-spooky-particles {
        display: none;
    }
    
    .hyp-video-card,
    .hyp-cta-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
