/* ===========================================
   UX Enhancements - Premiere School
   Better user experience for mobile & desktop
   Version: 2.1.0
   =========================================== */

/* ==================== SMOOTH ANIMATIONS ==================== */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Smooth transitions for all interactive elements */
a, button, input, select, textarea, .card, .btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== LOADING SKELETON ==================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==================== ENHANCED BUTTONS ==================== */
.btn, button[type="submit"], .apply-btn {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
}

.btn::after, button[type="submit"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after, button[type="submit"]:active::after {
    width: 300px;
    height: 300px;
}

/* Button hover effects */
.btn-primary:hover, .bg-primary-600:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(22, 163, 74, 0.3);
}

.btn-accent:hover, .bg-accent-500:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3);
}

/* ==================== ENHANCED CARDS ==================== */
.card, .bg-white.rounded-xl, .bg-white.rounded-2xl {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover, .card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Card entrance animation */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-card {
    animation: cardFadeIn 0.5s ease-out forwards;
}

/* ==================== ENHANCED FORM INPUTS ==================== */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

/* Floating labels effect */
.form-group {
    position: relative;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label {
    transform: translateY(-1.5rem) scale(0.85);
    color: #22c55e;
}

/* ==================== DESKTOP ENHANCEMENTS ==================== */
@media (min-width: 1024px) {
    /* Larger click areas */
    nav a, .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 0.5rem;
    }

    nav a:hover, .nav-link:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    /* Enhanced hero section */
    .hero-section {
        min-height: 80vh;
    }

    /* Better spacing */
    section {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }

    /* Testimonial cards - better hover */
    .testimonial-card:hover {
        transform: scale(1.02);
    }

    /* Stats counter animation */
    .stat-number {
        font-variant-numeric: tabular-nums;
    }

    /* Better table hover */
    table tbody tr:hover {
        background-color: #f8fafc;
    }
}

/* ==================== MOBILE UX ENHANCEMENTS ==================== */
@media (max-width: 1024px) {
    /* Prevent text selection on buttons */
    button, .btn, a.btn {
        -webkit-user-select: none;
        user-select: none;
    }

    /* Better touch feedback */
    button:active, .btn:active, a:active {
        transform: scale(0.98);
    }

    /* Pull to refresh indicator area */
    body {
        overscroll-behavior-y: contain;
    }
}

@media (max-width: 768px) {
    /* Mobile-first spacing */
    .container, .max-w-7xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Better section spacing on mobile */
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    /* Mobile hero adjustments */
    .hero-section h1 {
        font-size: 1.875rem;
        line-height: 1.2;
    }

    .hero-section p {
        font-size: 1rem;
    }

    /* Horizontal scroll for feature cards */
    .feature-scroll {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 1rem;
    }

    .feature-scroll::-webkit-scrollbar {
        display: none;
    }

    .feature-scroll > * {
        scroll-snap-align: start;
        flex-shrink: 0;
        width: 85%;
        margin-right: 1rem;
    }

    /* Better mobile cards */
    .mobile-card {
        border-radius: 1rem;
        padding: 1.25rem;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    }

    /* Mobile bottom nav safe area */
    .bottom-safe-area {
        padding-bottom: env(safe-area-inset-bottom, 20px);
    }

    /* Floating action button */
    .fab {
        position: fixed;
        bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        right: 20px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 20px rgba(22, 163, 74, 0.4);
        z-index: 99;
    }

    .fab:hover {
        transform: scale(1.1);
    }

    /* Mobile menu improvements */
    .mobile-menu {
        background: white;
        border-radius: 1rem 1rem 0 0;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    }

    .mobile-menu-item {
        display: flex;
        align-items: center;
        padding: 1rem 1.25rem;
        border-bottom: 1px solid #f1f5f9;
        font-size: 1rem;
        font-weight: 500;
    }

    .mobile-menu-item i {
        width: 24px;
        margin-right: 12px;
        color: #22c55e;
    }

    /* Improved mobile form layout */
    .mobile-form-section {
        background: white;
        border-radius: 1.5rem;
        padding: 1.5rem;
        margin: 1rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }

    /* Step indicator for forms */
    .step-indicator {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .step-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #e2e8f0;
        transition: all 0.3s;
    }

    .step-dot.active {
        background: #22c55e;
        transform: scale(1.2);
    }

    .step-dot.completed {
        background: #16a34a;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .hero-section h1 {
        font-size: 1.5rem;
    }

    /* Compact cards */
    .compact-card {
        padding: 1rem;
    }

    /* Full-width buttons on small screens */
    .btn-mobile-full {
        width: 100%;
        justify-content: center;
    }

    /* Smaller font sizes */
    .text-responsive {
        font-size: 0.875rem;
    }
}

/* ==================== ACCESSIBILITY ENHANCEMENTS ==================== */
/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 3px solid #22c55e;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn, button {
        border: 2px solid currentColor;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .no-print, nav, footer, .fab, .mobile-menu {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: black;
        background: white;
    }
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1f2937;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: #16a34a;
}

.toast.error {
    background: #dc2626;
}

.toast.warning {
    background: #d97706;
}

/* ==================== SCROLL PROGRESS INDICATOR ==================== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    z-index: 9999;
    transition: width 0.1s;
}

/* ==================== IMPROVED TESTIMONIAL CAROUSEL ==================== */
.testimonial-wrapper {
    position: relative;
    overflow: hidden;
}

.testimonial-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-slide {
    flex: 0 0 100%;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .testimonial-slide {
        flex: 0 0 50%;
    }
}

@media (min-width: 1024px) {
    .testimonial-slide {
        flex: 0 0 33.333%;
    }
}

/* Dots navigation */
.testimonial-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.testimonial-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d1d5db;
    cursor: pointer;
    transition: all 0.3s;
}

.testimonial-dot.active {
    background: #22c55e;
    transform: scale(1.3);
}

/* ==================== WHATSAPP FLOAT BUTTON ==================== */
.whatsapp-float {
    position: fixed;
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    right: 20px;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 98;
    animation: pulse-whatsapp 2s infinite;
}

@keyframes pulse-whatsapp {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(37, 211, 102, 0.6);
    }
}

.whatsapp-float:hover {
    transform: scale(1.1);
    background: #20BA5C;
}

/* ==================== CALL BUTTON (Mobile only) ==================== */
@media (max-width: 768px) {
    .call-float {
        position: fixed;
        bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        left: 20px;
        width: 56px;
        height: 56px;
        background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1.5rem;
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
        z-index: 98;
    }

    .call-float:active {
        transform: scale(0.95);
    }
}

/* ==================== BACK TO TOP BUTTON ==================== */
.back-to-top {
    position: fixed;
    bottom: calc(160px + env(safe-area-inset-bottom, 0px));
    right: 20px;
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #22c55e;
    font-size: 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 97;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #22c55e;
    color: white;
    transform: translateY(-3px);
}

/* ==================== IMAGE LAZY LOADING ==================== */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Placeholder while loading */
.img-placeholder {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
