/* Wisdom Brains Abacus Academy - Main Styles */

/* Header Sticky Positioning - Force sticky behavior on all devices */
header {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
}

/* Loading and Performance Optimizations */
.loading-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; }
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 64, 175, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.form-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(30, 64, 175, 0.3);
    border-top: 2px solid #1e40af;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

/* Accessibility Improvements */
.focus-visible:focus,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.3);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary {
        border-width: 2px;
        border-color: currentColor;
    }
    
    .form-error {
        border-width: 3px !important;
    }
    
    .text-gray-600,
    .text-gray-700 {
        color: #000000 !important;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loading-spinner {
        animation: none !important;
        border: 4px solid #1e40af;
    }
}

/* Screen reader only content */
.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;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #1e40af;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
    border-radius: 4px;
}

.skip-link:focus {
    top: 6px;
}

/* Image lazy loading placeholder */
.lazy-image {
    transition: opacity 0.3s ease;
    opacity: 0;
}

.lazy-image.loaded {
    opacity: 1;
}

/* Enhanced Form States with Better Contrast */
.form-error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3) !important;
    background-color: #fef2f2 !important;
    color: #991b1b !important;
}

.form-success {
    border-color: #059669 !important;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.3) !important;
    background-color: #f0fdf4 !important;
    color: #065f46 !important;
}

.error-message {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.success-message {
    color: #059669;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.field-container {
    position: relative;
    margin-bottom: 1rem;
}

.form-field {
    transition: all 0.2s ease;
}

.form-field:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Standardized Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    text-align: center;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    min-height: 44px; /* Minimum touch target */
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Button styles consolidated in utilities.css */
    border-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(234, 88, 12, 0.3);
}

.btn-outline {
    background-color: transparent;
    color: #1e40af;
    border-color: #1e40af;
}

.btn-outline:hover:not(:disabled) {
    background-color: #1e40af;
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-height: 36px;
}

.btn-md {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    min-height: 44px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    min-height: 52px;
}

/* Typography Hierarchy */
.heading-xl {
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.2;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.heading-lg {
    font-size: clamp(1.75rem, 4vw, 3rem);
    line-height: 1.25;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.heading-md {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    line-height: 1.3;
    font-weight: 600;
    margin-bottom: 1rem;
}

.heading-sm {
    font-size: clamp(1.25rem, 2.5vw, 1.875rem);
    line-height: 1.35;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.text-body {
    font-size: clamp(0.875rem, 2vw, 1.125rem);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.text-caption {
    font-size: clamp(0.75rem, 1.5vw, 0.875rem);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

/* Consistent Spacing System */
.spacing-xs { margin-bottom: 0.5rem; }
.spacing-sm { margin-bottom: 0.75rem; }
.spacing-md { margin-bottom: 1rem; }
.spacing-lg { margin-bottom: 1.5rem; }
.spacing-xl { margin-bottom: 2rem; }
.spacing-2xl { margin-bottom: 3rem; }

.padding-xs { padding: 0.5rem; }
.padding-sm { padding: 0.75rem; }
.padding-md { padding: 1rem; }
.padding-lg { padding: 1.5rem; }
.padding-xl { padding: 2rem; }
.padding-2xl { padding: 3rem; }

/* Section spacing */
.section {
    padding: clamp(3rem, 8vw, 6rem) 0;
}

.section-sm {
    padding: clamp(2rem, 6vw, 4rem) 0;
}

.section-lg {
    padding: clamp(4rem, 10vw, 8rem) 0;
}

/* Print styles */
@media print {
    .sticky-contact-buttons,
    .slider-dot,
    button {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* 3D Card Effects */
.card-3d {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 
                0 0 0 1px rgba(255, 255, 255, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.card-3d:hover {
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4), 
                0 0 0 1px rgba(255, 255, 255, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.7);
}

/* Select Dropdown Styling */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Certification Text Animations */
.cert-text {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    font-weight: 900;
    text-align: center;
    white-space: nowrap;
    z-index: 10;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0.3px;
    font-family: 'Arial', sans-serif;
    text-transform: uppercase;
}

.blink-slow {
    animation: blinkSlow 3s ease-in-out infinite;
}

.blink-random-1 {
    animation: blinkRandom1 4.2s ease-in-out infinite;
}

.blink-random-2 {
    animation: blinkRandom2 3.8s ease-in-out infinite;
}

@keyframes blinkSlow {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

@keyframes blinkRandom1 {
    0%, 60%, 100% { opacity: 0; }
    20%, 40% { opacity: 1; }
}

@keyframes blinkRandom2 {
    0%, 30%, 70%, 100% { opacity: 0; }
    15%, 85% { opacity: 1; }
}

/* Featurable Widget Theme Customization */
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
}

/* Force container to fit properly */
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 > * {
    width: 100% !important;
    max-width: 100% !important;
}

/* Masonry grid width fix */
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .masonry-container,
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .reviews-grid,
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .featurable-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Review Cards Styling */
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .review-card,
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .featurable-review {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    transition: all 0.3s ease !important;
    margin-bottom: 1rem !important;
    padding: 1.5rem !important;
}

#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .review-card:hover,
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .featurable-review:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    border-color: #ea580c !important;
}

/* Star Ratings */
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .stars,
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .rating {
    color: #eab308 !important;
}

/* Review Text */
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .review-text,
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .review-content {
    color: #374151 !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    margin-bottom: 1rem !important;
}

/* Reviewer Name */
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .reviewer-name,
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .author-name {
    color: #1e40af !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
}

/* Date */
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .review-date,
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .date {
    color: #6b7280 !important;
    font-size: 0.75rem !important;
}

/* Google Logo and Branding */
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .google-logo,
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .powered-by {
    opacity: 0.7 !important;
}

/* Container Layout */
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .masonry-container,
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .reviews-grid {
    gap: 1rem !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    #featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .review-card,
    #featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .featurable-review {
        padding: 1rem !important;
        margin-bottom: 0.75rem !important;
    }
}

/* Hide any unnecessary elements */
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .ads,
#featurable-7ab8db19-be8c-40ee-a6c5-5be7067a7a45 .advertisement {
    display: none !important;
}

/* Dynamic Contact Buttons */
.cta-contact-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.cta-contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px -2px rgba(0, 0, 0, 0.15);
}

/* Sticky Floating Contact Buttons */
.sticky-contact-buttons {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sticky-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.sticky-contact-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.sticky-contact-btn::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;
}

.sticky-contact-btn:hover::before {
    left: 100%;
}

/* Tooltip for sticky buttons */
.sticky-contact-btn .tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sticky-contact-btn .tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: rgba(0, 0, 0, 0.8);
}

.sticky-contact-btn:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

/* Individual button styles */
.whatsapp-btn {
    background: linear-gradient(135deg, #25d366 0%, #20ba5a 100%);
    color: white;
}

.whatsapp-btn:hover {
    background: linear-gradient(135deg, #20ba5a 0%, #1da851 100%);
}

.phone-btn {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: white;
}

.phone-btn:hover {
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
}

.email-btn {
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
    color: white;
}

.email-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* Responsive adjustments for sticky buttons */
@media (max-width: 768px) {
    .sticky-contact-buttons {
        right: 10px;
        gap: 10px;
        top: 60%;
    }
    
    .sticky-contact-btn {
        width: 52px;
        height: 52px;
        font-size: 1.3rem;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    }
    
    .sticky-contact-btn .tooltip {
        right: 62px;
        font-size: 0.8rem;
        padding: 6px 10px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .sticky-contact-buttons {
        right: 8px;
        gap: 8px;
        top: 65%;
    }
    
    .sticky-contact-btn {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
    
    .sticky-contact-btn .tooltip {
        right: 58px;
        font-size: 0.75rem;
        padding: 5px 8px;
    }
}

@media (max-width: 360px) {
    .sticky-contact-buttons {
        right: 6px;
        gap: 6px;
    }
    
    .sticky-contact-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
}

/* Mobile Typography and Touch Improvements */
@media (max-width: 768px) {
    /* Improve text scaling on mobile */
    h1 {
        font-size: 1.875rem !important; /* 30px */
        line-height: 1.2 !important;
    }
    
    h2 {
        font-size: 1.5rem !important; /* 24px */
        line-height: 1.3 !important;
    }
    
    h3 {
        font-size: 1.25rem !important; /* 20px */
        line-height: 1.4 !important;
    }
    
    /* Improve button and link touch targets */
    button, .btn, a.button, .touch-target {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 12px 16px !important;
        touch-action: manipulation;
    }
    
    /* Better form field sizing */
    input[type="text"], 
    input[type="email"], 
    input[type="tel"], 
    input[type="password"],
    select, 
    textarea {
        min-height: 44px !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 12px 16px !important;
    }
    
    /* Card and section improvements */
    .card-3d, .feature-card, .testimonial-card {
        margin-bottom: 1.5rem !important;
        padding: 1.25rem !important;
    }
    
    /* Navigation improvements */
    .nav-link, .menu-item {
        padding: 16px 20px !important;
        font-size: 1rem !important;
    }
    
    /* Better spacing for mobile */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Improved gallery grid for mobile */
    .masonry-grid, .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
        gap: 0.75rem !important;
        padding: 0.75rem !important;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    h1 {
        font-size: 1.625rem !important; /* 26px */
    }
    
    h2 {
        font-size: 1.375rem !important; /* 22px */
    }
    
    /* Tighter spacing */
    .py-12 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .py-16 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    
    /* Better gallery for very small screens */
    .masonry-grid, .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
        gap: 0.5rem !important;
    }
}

/* Banner Slider Styles */
.banner-slide {
    transition: opacity 0.7s ease-in-out, z-index 0s 0.7s;
    will-change: opacity;
}

.banner-slide.opacity-100 {
    z-index: 10;
    transition: opacity 0.7s ease-in-out, z-index 0s 0s;
}

#banner-slider {
    position: relative;
    overflow: hidden;
}

#banner-slider img {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    object-fit: cover;
    object-position: center;
}

#banner-prev, #banner-next {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#banner-prev:hover, #banner-next:hover {
    transform: translateY(-50%) scale(1.1);
}

#banner-prev:active, #banner-next:active {
    transform: translateY(-50%) scale(0.95);
}

/* iOS Safari specific improvements */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari */
    input[type="text"], 
    input[type="email"], 
    input[type="tel"], 
    select, 
    textarea {
        font-size: 16px !important; /* Prevents zoom */
    }
    
    .sticky-contact-buttons {
        bottom: env(safe-area-inset-bottom, 20px);
    }
}

/* Flag Emoji Rendering Fix */
.flag-emoji {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "Android Emoji", "EmojiSymbols", "EmojiOne Mozilla", "Twemoji Mozilla", "Segoe UI", sans-serif;
    font-style: normal;
    font-variant: normal;
    font-weight: normal;
    line-height: 1;
    display: inline-block;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Force emoji rendering */
    unicode-bidi: isolate;
    direction: ltr;
    /* Prevent text fallback */
    font-feature-settings: "liga" off, "calt" off;
    /* Ensure proper emoji display */
    font-variant-emoji: emoji;
}

/* Additional emoji rendering support for older browsers */
@supports not (font-variant-emoji: emoji) {
    .flag-emoji {
        font-size: 1.2em;
        letter-spacing: 0;
        word-spacing: 0;
    }
}