/* Packages Page Additional Styles */

/* Package Sections */
.package-section {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 0.8s ease-in-out, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.8s ease-in-out;
    perspective: 1000px;
    position: relative;
    will-change: opacity, transform;
}

.package-section.hidden {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
    position: absolute;
    pointer-events: none;
    filter: blur(5px);
}

/* Section transition states */
.package-section.entering {
    opacity: 0;
    filter: blur(10px);
}

.package-section.exiting {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(-30px) scale(0.95);
    pointer-events: none;
}

/* Package Tab Sliding Effect */
.packages-enter {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
}

.packages-enter-active {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 0.6s ease-in-out, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.packages-exit {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.packages-exit-active {
    opacity: 0;
    transform: translateY(-30px) scale(0.97);
    transition: opacity 0.6s ease-in-out, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Tab Content Transition Effects */
.package-section {
    transition: opacity 0.7s ease-in-out, transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.7s ease-in-out;
    will-change: opacity, transform;
}

.package-section.entering {
    opacity: 0;
    transform: translateX(50px);
    filter: blur(5px);
}

.package-section.entering.services-section {
    transform: translateX(-50px);
}

.package-section.entering.wages-section {
    transform: translateX(50px);
}

.package-section.active {
    opacity: 1;
    transform: translateX(0);
    filter: blur(0);
}

/* Enhanced Package Cards */
.package-card {
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e5e7eb;
    transform-origin: center bottom;
    backface-visibility: hidden;
    perspective: 1000px;
    animation: packageAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

@keyframes packageAppear {
    from { 
        opacity: 0; 
        transform: translateY(50px) scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* 3D Flip animation for card change */
@keyframes flipCard {
    0% { transform: perspective(1000px) rotateY(0deg); }
    50% { transform: perspective(1000px) rotateY(180deg); }
    100% { transform: perspective(1000px) rotateY(360deg); }
}

/* Bounce animation */
@keyframes bounceCard {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

/* Pulse animation for highlighting */
@keyframes pulseHighlight {
    0% { box-shadow: 0 0 0 0 rgba(70, 40, 92, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(70, 40, 92, 0); }
    100% { box-shadow: 0 0 0 0 rgba(70, 40, 92, 0); }
}

.package-card:nth-child(1) { animation-delay: 0.1s; }
.package-card:nth-child(2) { animation-delay: 0.2s; }
.package-card:nth-child(3) { animation-delay: 0.3s; }
.package-card:nth-child(4) { animation-delay: 0.4s; }

.package-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s;
    z-index: 1;
}

.package-card:hover::before {
    left: 100%;
}

.package-card:hover::after {
    opacity: 1;
}

.package-card:hover {
    transform: translateY(-15px) scale(1.03) rotate(0.5deg);
    box-shadow: 0 30px 60px rgba(70, 40, 92, 0.2);
    border-color: #46285C;
}

/* Style for active packages */
#services-packages.active .package-card {
    animation: cardEntranceServices 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
    background: linear-gradient(135deg, #ffffff 0%, #f2f5fc 100%);
    border-color: #46285C;
}

#wages-packages.active .package-card {
    animation: cardEntranceWages 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
    background: linear-gradient(135deg, #ffffff 0%, #fcf5f2 100%);
    border-color: #7C3AED;
}

/* Special flip effect when tab changes */
.package-card.flipping {
    animation: flipCard 0.8s ease-in-out forwards !important;
    z-index: 20;
}

.package-card.bouncing {
    animation: bounceCard 1s ease forwards !important;
    z-index: 20;
}

.package-card.pulsing {
    animation: pulseHighlight 1.5s ease-in-out infinite !important;
}

/* Package card staggered entrance */
.package-section.services-active .package-card {
    animation: cardEntranceServices 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.package-section.wages-active .package-card {
    animation: cardEntranceWages 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

@keyframes cardEntranceServices {
    from { opacity: 0; transform: translateX(-50px) scale(0.9) rotate(-3deg); }
    to { opacity: 1; transform: translateX(0) scale(1) rotate(0deg); }
}

@keyframes cardEntranceWages {
    from { opacity: 0; transform: translateX(50px) scale(0.9) rotate(3deg); }
    to { opacity: 1; transform: translateX(0) scale(1) rotate(0deg); }
}

/* Add new animations for each card in staggered fashion */
.package-section.services-active .package-card:nth-child(1) { animation-delay: 0.0s; }
.package-section.services-active .package-card:nth-child(2) { animation-delay: 0.1s; }
.package-section.services-active .package-card:nth-child(3) { animation-delay: 0.2s; }
.package-section.services-active .package-card:nth-child(4) { animation-delay: 0.3s; }

.package-section.wages-active .package-card:nth-child(1) { animation-delay: 0.0s; }
.package-section.wages-active .package-card:nth-child(2) { animation-delay: 0.1s; }
.package-section.wages-active .package-card:nth-child(3) { animation-delay: 0.2s; }
.package-section.wages-active .package-card:nth-child(4) { animation-delay: 0.3s; }

/* Featured Package Highlight */
.package-card[data-featured="true"] {
    border: 2px solid #46285C;
    position: relative;
}

.package-card[data-featured="true"]::after {
    content: 'الأكثر شيوعاً';
    position: absolute;
    top: -10px;
    right: 20px;
    background: linear-gradient(45deg, #46285C, #7C3AED);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

/* Popular Badge Animation */
.package-card[data-popular="true"] {
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% {
        box-shadow: 0 0 0 0 rgba(70, 40, 92, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(70, 40, 92, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(70, 40, 92, 0);
    }
}

/* Price Animation */
.price-number {
    background: linear-gradient(45deg, #46285C, #7C3AED);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* Feature List Enhancements */
.feature-item {
    position: relative;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-item:hover {
    background: rgba(70, 40, 92, 0.05);
    padding-right: 10px;
}

.feature-check {
    color: #10B981;
    font-weight: bold;
}

.feature-warning {
    color: #F59E0B;
    font-weight: bold;
}

/* Button Enhancements */
.cta-button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    background: linear-gradient(45deg, #46285C, #5A3B7C);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(70, 40, 92, 0.2), transparent);
    transition: left 0.6s;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(70, 40, 92, 0.3);
}

/* Tab Navigation */
.package-tabs {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.package-tab {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.package-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #46285C;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.package-tab.active::after {
    width: 100%;
}

#tab-indicator {
    width: 50%;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.5s ease-in-out, box-shadow 0.5s ease-in-out;
    box-shadow: 0 5px 15px rgba(70, 40, 92, 0.3);
    background: linear-gradient(45deg, #46285C 0%, #7C3AED 100%);
    background-size: 200% 200%;
    animation: gradientAnimation 3s ease infinite;
}

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

#wages-tab.active ~ #tab-indicator {
    transform: translateX(-100%);
    background: linear-gradient(45deg, #7C3AED 0%, #46285C 100%);
    width: 52%; /* Slightly wider for effect */
    box-shadow: 0 5px 20px rgba(124, 58, 237, 0.4);
}

/* Add a subtle bounce effect when changing tabs */
#tab-indicator.bounce {
    animation: tabBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, gradientAnimation 3s ease infinite;
}

@keyframes tabBounce {
    0%, 100% { transform: translateX(var(--x-pos)); }
    50% { transform: translateX(var(--x-pos)) scaleX(0.9); }
    75% { transform: translateX(var(--x-pos)) scaleX(1.05); }
}

/* FAQ Enhancements */
.faq-item {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.faq-item:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateX(5px);
}

.faq-content {
    background: linear-gradient(135deg, rgba(70, 40, 92, 0.05), rgba(124, 58, 237, 0.05));
    border-radius: 0 0 8px 8px;
}

/* Hero Section Enhancements */
.hero-gradient {
    background: linear-gradient(135deg, #46285C 0%, #5A3B7C 50%, #7C3AED 100%);
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Responsive Enhancements */
@media (max-width: 1024px) {
    .package-card {
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .package-card:hover {
        transform: translateY(-8px) scale(1.01);
    }
    
    .hero-gradient h1 {
        font-size: 2.5rem;
    }
    
    .package-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .package-tab {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .price-number {
        font-size: 2rem;
    }
    
    .package-card {
        padding: 1.5rem;
    }
    
    .hero-gradient {
        padding: 3rem 0;
    }
}

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

/* Scroll Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Success Indicators */
.success-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 20px;
    color: #059669;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Warning Indicators */
.warning-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 20px;
    color: #D97706;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Premium Package Glow */
.premium-glow {
    position: relative;
}

.premium-glow::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700);
    border-radius: inherit;
    z-index: -1;
    animation: premium-glow 2s ease-in-out infinite alternate;
}

@keyframes premium-glow {
    0% { opacity: 0.5; transform: scale(1); }
    100% { opacity: 0.8; transform: scale(1.02); }
}

/* Enhanced Button Animations */
.cta-button {
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(70, 40, 92, 0.2), transparent);
    transition: left 0.6s;
}

.cta-button:hover::before {
    left: 100%;
}

/* Loading Animation for Prices */
.price-loading {
    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; }
}

/* Floating Animation for Statistics */
.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Gradient Text Animation */
.gradient-text {
        background: linear-gradient(45deg, #46285C, #f7f7f7, #c16cff);
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 3s ease-in-out infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Ripple Effect for Buttons */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}
