/* UnmaskCall - Hebrew RTL Styles */
body { 
    font-family: 'Heebo', sans-serif; 
    direction: rtl;
}

/* RTL Specific Overrides */
.space-x-reverse > :not([hidden]) ~ :not([hidden]) {
    --tw-space-x-reverse: 1;
    margin-right: calc(var(--tw-space-x) * var(--tw-space-x-reverse));
    margin-left: calc(var(--tw-space-x) * calc(1 - var(--tw-space-x-reverse)));
}

/* Text alignment fixes for RTL */
.text-right-mobile {
    text-align: right !important;
}

.flex-row-reverse-mobile {
    flex-direction: row-reverse !important;
}

/* Fix Tailwind utilities for RTL */
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-4 { margin-left: 1rem; }

/* Ensure proper RTL spacing */
.space-x-8 > :not([hidden]) ~ :not([hidden]) {
    --tw-space-x-reverse: 1;
}

.space-x-6 > :not([hidden]) ~ :not([hidden]) {
    --tw-space-x-reverse: 1;
}

.space-x-4 > :not([hidden]) ~ :not([hidden]) {
    --tw-space-x-reverse: 1;
}

.space-x-3 > :not([hidden]) ~ :not([hidden]) {
    --tw-space-x-reverse: 1;
}

/* Gradients and Backgrounds */
.gradient-hero { 
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
}

.phone-mockup {
    background: linear-gradient(145deg, #1f2937, #111827);
    border-radius: 25px;
    padding: 8px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

.screen-glow {
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.4);
}

.glassmorphism {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Animations */
@keyframes floating {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -15px, 0); }
}

.floating {
    animation: floating 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

.pulse-dot {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes slideUp {
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

.bounce-in {
    animation: bounceIn 0.6s ease-out;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

.typing-dots {
    animation: typing 1.5s infinite;
}

/* Success Modal Styles */
.success-modal-slide-up {
    animation: successModalSlideUp 0.3s ease-out;
}

@keyframes successModalSlideUp {
    from { 
        opacity: 0; 
        transform: translateY(100%); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.success-modal-fade-in {
    animation: successModalFadeIn 0.3s ease-out;
}

@keyframes successModalFadeIn {
    from { 
        opacity: 0; 
        transform: scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: scale(1); 
    }
}

.success-bounce {
    animation: successBounce 0.6s ease-out;
}

@keyframes successBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.success-checkmark {
    animation: checkmarkDraw 0.5s ease-out 0.3s both;
}

@keyframes checkmarkDraw {
    0% { stroke-dasharray: 0, 100; }
    100% { stroke-dasharray: 100, 0; }
}

/* Modal Animations */
.modal-slide-up {
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from { 
        opacity: 0; 
        transform: translateY(100%); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.modal-fade-in {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { 
        opacity: 0; 
        transform: scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: scale(1); 
    }
}

/* Hover Effects */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 60px rgba(0,0,0,0.15);
}

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

.form-input:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    transform: translateY(-2px);
}

/* Plan Selection */
.plan-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.plan-card.selected {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(147, 51, 234, 0.2);
}

/* Carrier Selection */
.carrier-btn {
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.carrier-btn.selected {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    transform: translateY(-3px);
}

/* Loading States */
.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Hebrew Typography Adjustments */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

p, span, div {
    line-height: 1.6;
}

/* Form Input RTL Styling */
input[type="text"],
input[type="email"],
input[type="tel"] {
    text-align: right;
    direction: rtl;
}

input[type="email"],
input[type="tel"] {
    direction: ltr;
    text-align: right;
}

/* Responsive Utilities */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
        line-height: 1.4;
    }
    
    /* Fix mobile spacing for Hebrew */
    .flex-row-reverse-mobile {
        flex-direction: row-reverse !important;
    }
    
    .text-right-mobile {
        text-align: right !important;
    }
}

@media (min-width: 1024px) {
    .desktop-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .desktop-feature-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* Step Indicators */
.step-indicator {
    transition: all 0.3s ease;
}

.step-indicator.active {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    transform: scale(1.1);
}

.step-indicator.completed {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

/* Form Validation */
.form-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    text-align: right;
}

/* Success States */
.success-message {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 1rem;
    border-radius: 1rem;
    margin: 1rem 0;
    animation: slideUp 0.5s ease-out;
}

/* Phone Demo Specific */
.phone-screen {
    background: #000;
    border-radius: 1.5rem;
    padding: 1.5rem;
    position: relative;
}

.call-incoming {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Testimonial Cards */
.testimonial-card {
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.testimonial-card:hover {
    transform: scale(1.05);
}

/* Utility Classes */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.border-3 {
    border-width: 3px;
}

/* Custom Scrollbar for RTL */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #8b5cf6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #7c3aed;
}

/* Focus States for Accessibility */
button:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

input:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

/* Loading Animation */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loadingRTL 1.5s infinite;
}

@keyframes loadingRTL {
    0% { right: -100%; }
    100% { right: 100%; }
}

/* Mobile-specific optimizations for Hebrew */
@media (max-width: 768px) {
    /* Ensure touch targets are at least 44px */
    button {
        min-height: 44px;
    }
    
    /* Optimize form inputs for mobile Hebrew */
    input[type="tel"],
    input[type="email"],
    input[type="text"] {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem 1rem;
    }
    
    /* Modal optimizations */
    .modal-content {
        max-height: 80vh;
        overflow-y: auto;
    }
    
    /* Hebrew text adjustments */
    .text-right-mobile {
        text-align: right !important;
    }
}

/* RTL Flexbox fixes */
.flex-row-reverse {
    flex-direction: row-reverse;
}

.justify-end {
    justify-content: flex-end;
}

/* Hebrew number formatting */
.ltr-number {
    direction: ltr;
    display: inline-block;
}

/* Price display RTL */
.price-display {
    direction: ltr;
    text-align: left;
}

/* High DPI / Retina optimizations */
@media (-webkit-min-device-pixel-ratio: 2) {
    .phone-mockup {
        box-shadow: 0 25px 50px rgba(0,0,0,0.4);
    }
}

/* 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;
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }
}

/* 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;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}


/* Enhanced Mobile Pricing Expansion Styles */
.feature-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(-10px);
}

.feature-list.expanded {
    max-height: 400px;
    opacity: 1;
    transform: translateY(0);
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease 0.1s,
                transform 0.3s ease 0.1s;
}

.expand-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.expand-icon.rotated {
    transform: rotate(180deg);
}

.plan-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.plan-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.plan-card.expanded {
    transform: scale(1.02);
    box-shadow: 0 12px 30px rgba(147, 51, 234, 0.2);
}

/* Mobile touch feedback */
@media (max-width: 1024px) {
    .plan-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* Enhanced plan selection styles that work with your existing design */

/* Base plan card styles - preserve original design */
.plan-card {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Selection states that don't conflict with original styling */
.plan-card.selected {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
}

/* Free plan selection enhancement */
.plan-card[data-plan="free"].selected {
    /* Don't override the gradient background, just enhance the border */
    border-color: #22c55e !important;
    border-width: 3px !important;
}

/* Basic plan selection */
.plan-card[data-plan="basic"].selected {
    border-color: #8b5cf6 !important;
    border-width: 3px !important;
    background-color: #f3f4f6 !important;
}

/* Premium plan selection */
.plan-card[data-plan="premium"].selected {
    border-color: #8b5cf6 !important;
    border-width: 3px !important;
    /* Keep existing purple background if it exists */
}

/* Selection indicator positioning */
.selection-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

/* Mobile-specific fixes */
@media (max-width: 1023px) {
    .plan-card.selected {
        transform: none; /* Prevent layout issues on mobile */
        box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
    }
    
    /* Ensure mobile cards maintain their compact size */
    .plan-card {
        min-height: auto;
    }
}

/* Desktop-specific enhancements */
@media (min-width: 1024px) {
    .plan-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    }
    
    .plan-card.selected:hover {
        transform: scale(1.02) translateY(-2px);
    }
}

/* Ensure gradients don't get overridden */
.plan-card[data-plan="free"] {
    background: linear-gradient(135deg, #22c55e 0%, #059669 100%) !important;
    color: white !important;
}

/* Fix for expand icons in mobile pricing */
.expand-icon {
    transition: transform 0.3s ease;
}

.expand-icon.rotated {
    transform: rotate(180deg);
}

/* Non-destructive selection styling */
.plan-card.selected {
    position: relative;
}

.plan-card.selected::after {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: #8b5cf6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.plan-card[data-plan="free"].selected::after {
    background: #22c55e;
}