/* Custom CSS for MindIntArt Landing Page */

/* Global Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 20px; /* Add some padding when scrolling to sections */
}

body {
    overflow-x: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Content sections spacing */
section {
    position: relative;
    z-index: 10;
    scroll-margin-top: 20px; /* Ensures smooth scroll positioning */
}

/* Video prominence */
.video-container {
    scroll-margin-top: 10px;
}

/* Video Container Styles */
.video-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Video and controls as cohesive unit */
.video-container > div:first-child {
    border-radius: 12px 12px 0 0;
}

.video-container > div[id*="Controls"] {
    border-radius: 0 0 12px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.video-container video {
    width: 100%;
    height: auto;
    display: block;
}

/* Loading Animation */
#videoLoading {
    backdrop-filter: blur(8px);
}

/* Availability Slots Animation */
.availability-slot {
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1);
}

.availability-slot.taking {
    animation: slotTaking 1s ease-in-out;
}

@keyframes slotTaking {
    0% {
        transform: scale(1);
        background-color: rgb(34, 197, 94); /* success green */
    }
    50% {
        transform: scale(1.1);
        background-color: rgb(245, 158, 11); /* warning yellow */
    }
    100% {
        transform: scale(1);
        background-color: rgb(239, 68, 68); /* error red */
    }
}

/* Pulse animation for urgent availability */
.availability-urgent {
    animation: urgentPulse 2s infinite;
}

@keyframes urgentPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }
}

/* Stats Cards */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Progress Animations */
.progress-bar {
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4);
    background-size: 200% 200%;
    animation: progressGlow 3s ease-in-out infinite;
}

@keyframes progressGlow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Button Animations */
.btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Form Styles */
.form-control input {
    transition: all 0.3s ease;
}

.form-control input:focus {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
}

/* Enhanced Responsive Video */
@media (max-width: 768px) {
    .video-container {
        margin: 0;
        border-radius: 12px;
    }
    
    /* Prevent video overflow */
    .video-container video {
        max-width: 100%;
        height: auto;
        object-fit: contain;
    }
    
    /* Watch timer positioning */
    #watchTimer, #part3WatchTimer {
        top: 8px;
        right: 8px;
        padding: 8px 12px;
        font-size: 14px;
        border-radius: 6px;
    }
}

/* Fade-in Animation */
.animate__fadeInUp {
    animation: fadeInUp 1s ease-out;
}

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

/* Loading Spinner Enhancement */
.loading-spinner {
    border: 4px solid rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    border-top: 4px solid #6366f1;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Timer Display */
#watchTimer, #part3WatchTimer {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Security Badge Hover */
footer img {
    transition: all 0.3s ease;
    filter: grayscale(100%);
}

footer img:hover {
    filter: grayscale(0%);
    transform: scale(1.1);
}

/* Profit Calculator Styling */
#potentialProfit {
    background: linear-gradient(45deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

/* Availability Counter Styling */
#availableCount {
    color: #6366f1;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.8);
}

/* Section Transitions */
section {
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
}

section.hidden {
    opacity: 0;
    transform: translateY(20px);
}

section:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 640px) {
    /* Typography - Mobile First */
    .text-6xl {
        font-size: 2.5rem !important;
        line-height: 1.1;
    }
    
    .text-5xl {
        font-size: 2.25rem !important;
        line-height: 1.1;
    }
    
    .text-4xl {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    .text-3xl {
        font-size: 1.75rem !important;
        line-height: 1.2;
    }
    
    .text-2xl {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }
    
    .text-xl {
        font-size: 1.25rem !important;
        line-height: 1.4;
    }
    
    /* Button Optimizations - Touch Friendly */
    .btn {
        min-height: 48px;
        min-width: 48px;
        padding: 12px 24px;
        font-size: 16px;
        line-height: 1.4;
        border-radius: 8px;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .btn-lg {
        min-height: 52px;
        padding: 14px 28px;
        font-size: 18px;
    }
    
    .btn-sm {
        min-height: 40px;
        padding: 8px 16px;
        font-size: 14px;
    }
    
    /* Video Container Optimizations */
    .video-container {
        margin: 0;
        border-radius: 8px;
    }
    
    .video-container video {
        border-radius: 8px;
    }
    
    /* Availability Slots - Mobile Grid */
    .availability-slot {
        padding: 10px 12px;
        font-size: 13px;
        border-radius: 6px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    
    /* Form Optimizations */
    .form-control {
        margin-bottom: 16px;
    }
    
    .form-control input,
    .form-control select,
    .form-control textarea {
        min-height: 48px;
        padding: 12px 16px;
        font-size: 16px;
        border-radius: 8px;
        -webkit-appearance: none;
        appearance: none;
    }
    
    /* Cards and Content */
    .card {
        border-radius: 12px;
        margin-bottom: 16px;
    }
    
    .card-body {
        padding: 20px;
    }
    
    /* Range Slider */
    .range {
        height: 8px;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .range::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
        -webkit-appearance: none;
        appearance: none;
    }
    
    /* Stats optimizations */
    .stats .stat {
        padding: 16px;
    }
    
    /* Grid improvements */
    .grid {
        gap: 12px;
    }
    
    /* Security badges */
    footer img {
        height: 24px;
        width: auto;
    }
    
    .grid-cols-1.md\\:grid-cols-3 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Dark theme enhancements */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: rgba(31, 41, 55, 0.8);
        backdrop-filter: blur(10px);
    }
}

/* Smooth transitions for all interactive elements */
button, input, .availability-slot, .card {
    will-change: transform;
}

/* Performance optimizations */
.video-container, .card, .btn {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Custom Video Controls */
.video-container div[id*="Controls"] {
    opacity: 1; /* Always visible since they're below the video */
    transition: all 0.3s ease-in-out;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-container:hover div[id*="Controls"] {
    background-color: rgba(0, 0, 0, 0.85); /* Slightly more opaque on hover */
}

/* Enhanced visibility when video is paused */
.video-container.paused div[id*="Controls"] {
    background-color: rgba(0, 0, 0, 0.9);
}

/* Custom play button styles */
.video-container button[id*="PlayBtn"] {
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.video-container button[id*="PlayBtn"]:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.6);
}

.video-container button[id*="PlayBtn"]:active {
    transform: scale(0.95);
}

/* Custom fullscreen button styles */
.video-container button[id*="FullscreenBtn"] {
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 14px 0 rgba(124, 124, 124, 0.39);
}

.video-container button[id*="FullscreenBtn"]:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px 0 rgba(124, 124, 124, 0.6);
    background-color: rgba(255, 255, 255, 0.1);
}

.video-container button[id*="FullscreenBtn"]:active {
    transform: scale(0.95);
}

/* Progress bar container */
.video-container div[id*="Progress"] {
    transition: width 0.1s linear;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* Progress bar background */
.video-container .bg-gray-700 {
    background-color: rgba(55, 65, 81, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Time display styling */
.video-container .text-xs.text-gray-300 {
    font-family: 'Courier New', monospace;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Disable user selection on progress bar */
.video-container div[id*="Progress"] {
    user-select: none;
    pointer-events: none;
}

.video-container .bg-gray-700 {
    user-select: none;
    pointer-events: none;
    cursor: not-allowed;
}

/* Video seeking prevention visual feedback */
.video-container video {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Prevent text selection on video controls */
.video-container div[id*="Controls"] * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Watch time encouragement boxes */
.watch-encouragement {
    animation: gentle-pulse 4s ease-in-out infinite;
}

@keyframes gentle-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 8px 32px rgba(99, 102, 241, 0.1);
    }
    50% { 
        transform: scale(1.01);
        box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15);
    }
}

/* Enhanced gradient backgrounds for encouragement boxes */
.bg-gradient-to-r[class*="from-primary"] {
    backdrop-filter: blur(8px);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.bg-gradient-to-r[class*="from-yellow"] {
    backdrop-filter: blur(8px);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Statistics animation effects */
#totalUsers, #totalBenefits, #avgBenefit {
    transition: all 0.3s ease-in-out;
}

#totalUsers:hover, #totalBenefits:hover, #avgBenefit:hover {
    transform: scale(1.05);
}

/* Statistics glow effect for updates */
.stats-updating {
    text-shadow: 0 0 15px rgba(34, 197, 94, 0.8) !important;
    transform: scale(1.02);
}

/* Enhanced Mobile Video Controls */
@media (max-width: 640px) {
    .video-container div[id*="Controls"] {
        padding: 16px;
        bottom: 8px;
        left: 8px;
        right: 8px;
        border-radius: 8px;
    }
    
    .video-container button[id*="PlayBtn"] {
        width: 44px;
        height: 44px;
        min-height: 44px;
        border-radius: 50%;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .video-container .text-xs {
        font-size: 12px;
        font-weight: 500;
    }
    
    .video-container .bg-gray-700 {
        height: 6px;
    }
    
    .video-container div[id*="Progress"] {
        height: 6px;
    }
}

/* Tablet optimizations */
@media (min-width: 641px) and (max-width: 1024px) {
    .text-6xl {
        font-size: 4rem !important;
        line-height: 1.1;
    }
    
    .text-4xl {
        font-size: 3rem !important;
        line-height: 1.2;
    }
    
    .btn-lg {
        padding: 16px 32px;
        font-size: 18px;
        min-height: 50px;
    }
    
    .availability-slot {
        padding: 14px 20px;
        font-size: 15px;
        min-height: 48px;
    }
    
    .card-body {
        padding: 24px;
    }
}

/* Large screen optimizations */
@media (min-width: 1025px) {
    .availability-slot {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .availability-slot:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    }
    
    .btn:hover {
        transform: translateY(-2px);
    }
}

/* Additional Mobile UX Improvements */
@media (max-width: 640px) {
    /* Improve touch targets */
    a, button, .clickable {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Optimize scrolling */
    * {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Prevent zoom on input focus */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px;
    }
    
    /* Improve readability */
    p, span, div {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Mobile-specific animations */
    .card {
        animation: mobileSlideIn 0.3s ease-out;
    }
    
    @keyframes mobileSlideIn {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Video overlay system for seamless content switching */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

.video-overlay.hidden {
    display: none;
}

/* Smooth transitions for video container movement */
#sharedVideoWrapper {
    transition: all 0.3s ease-in-out;
}

/* Ensure video controls maintain consistency */
#sharedVideoControls {
    transition: background-color 0.3s ease;
}

#sharedVideoControls:hover {
    background-color: rgba(0, 0, 0, 0.85);
}
