/* Custom CSS for Jude Travel Agency - Far East Packages */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Utility classes for animations */
.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 0.6s ease-out forwards;
}

.animate-pulse-custom {
    animation: pulse 2s infinite;
}

/* Hero section slideshow */
.hero-slideshow {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.slide.active {
    opacity: 1;
}

.slide-bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: kenBurns 8s ease-in-out infinite alternate;
}

/* Ken Burns effect for dynamic background movement */
@keyframes kenBurns {
    0% {
        transform: scale(1) translate(0, 0);
    }
    100% {
        transform: scale(1.1) translate(-2%, -1%);
    }
}

/* Slideshow indicators */
.slide-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    background: transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.slide-indicator.active {
    background: #FF8C00;
    border-color: #FF8C00;
    transform: scale(1.2);
}

.slide-indicator:hover {
    background: rgba(255, 140, 0, 0.7);
    transform: scale(1.1);
}

/* Country name animation */
#currentCountry {
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInCountry {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navigation arrows styling */
#prevSlide, #nextSlide {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#prevSlide:hover, #nextSlide:hover {
    background: rgba(255, 140, 0, 0.7);
    border-color: #FF8C00;
}

/* Responsive adjustments for hero */
@media (max-width: 768px) {
    #prevSlide, #nextSlide {
        display: none; /* Hide arrows on mobile for cleaner look */
    }
    
    .slide-indicator {
        width: 10px;
        height: 10px;
    }
    
    #currentCountry {
        font-size: 1.5rem;
    }
}

/* Pause slideshow on hover */
.hero-slideshow:hover .slide-bg {
    animation-play-state: paused;
}

/* Destination cards hover effects */
.destination-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.destination-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.destination-card:hover .group {
    transform: scale(1.02);
}



/* Destination card highlight effect */
.destination-card.highlighted {
    animation: highlightPulse 2s ease-in-out;
    box-shadow: 0 0 30px rgba(255, 140, 0, 0.6);
}

@keyframes highlightPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 140, 0, 0);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 30px rgba(255, 140, 0, 0.8);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(255, 140, 0, 0.4);
    }
}

/* Flight Search Widget Section Styling */
#flight-search {
    background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
    position: relative;
    overflow: hidden;
}

#flight-search::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="50" cy="10" r="1" fill="rgba(255,255,255,0.03)"/><circle cx="80" cy="40" r="1" fill="rgba(255,255,255,0.03)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.5;
    pointer-events: none;
}

.flight-widget-container {
    position: relative;
    z-index: 1;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Widget loading states */
.widget-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 1rem;
}

.loading-spinner {
    width: 35px;
    height: 35px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #FF8C00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    color: #666;
    font-size: 1rem;
    margin-top: 1rem;
}

/* Widget error state */
.widget-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    padding: 1.5rem;
}

.error-content {
    max-width: 500px;
}

.widget-error .error-content i {
    display: block;
    margin: 0 auto 1rem;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Improve button hover effects */
.widget-error a {
    text-decoration: none;
}

.widget-error button {
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.widget-error button:hover {
    transform: translateY(-1px);
}

/* Responsive adjustments for flight widget */
@media (max-width: 768px) {
    #flight-search {
        padding: 2rem 0;
    }
    
    #flight-search .bg-white {
        margin: 0 1rem;
        padding: 1rem;
    }
    
    #flight-search h2 {
        font-size: 1.5rem;
    }
    
    .flight-widget-container {
        min-height: 220px;
    }
    
    .widget-loading {
        min-height: 180px;
        padding: 1rem;
    }
    
    .widget-error {
        min-height: 200px;
        padding: 1rem;
    }
}

/* Ensure widget integrates well with site design */
.flight-widget-container iframe,
.flight-widget-container div {
    border-radius: 12px;
    overflow: hidden;
}

/* Widget responsiveness */
@media (max-width: 640px) {
    .flight-widget-container {
        min-height: 200px;
    }
    
    .widget-loading, .widget-error {
        min-height: 160px;
    }
}

/* Language toggle styles */
#langToggle {
    background: white !important;
    border: 2px solid #FF8C00;
    min-width: 80px;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: block !important;
    visibility: visible !important;
}

#langToggle:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #FF8C00;
    box-shadow: 0 4px 20px rgba(255, 140, 0, 0.3);
}

/* Language toggle positioning fix */
.lang-toggle-container {
    position: fixed;
    top: 5rem;
    right: 0.5rem;
    z-index: 1001 !important;
    transition: all 0.3s ease;
    display: block;
}

/* Show floating language button on mobile, navigation button on desktop */
@media (min-width: 769px) {
    .lang-toggle-container {
        display: block; /* Keep it visible for now */
        top: 1rem;
        right: 1rem;
    }
}

@media (max-width: 768px) {
    .lang-toggle-container {
        display: block;
        top: 5rem; /* Position below sticky header on mobile */
        right: 0.5rem;
    }
    
    #langToggle {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
        min-width: 70px;
    }
    
    /* Hide navigation language button on mobile */
    #langToggleNav {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .lang-toggle-container {
        top: 4.5rem;
        right: 0.25rem;
    }
    
    #langToggle {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
        min-width: 65px;
    }
}

/* Navigation language toggle styling */
#langToggleNav {
    display: inline-flex;
    align-items: center;
    margin-left: 1rem;
    border: none;
    cursor: pointer;
    z-index: 105;
    position: relative;
}

#langToggleNav:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.3);
}

/* Show navigation button on desktop, hide floating one */
@media (min-width: 769px) {
    #langToggleNav {
        display: inline-flex !important;
        visibility: visible !important;
    }
    
    .lang-toggle-container {
        display: block !important; /* Keep floating button visible for now */
    }
}

/* Hide navigation button on mobile, show floating one */
@media (max-width: 768px) {
    #langToggleNav {
        display: none !important;
    }
    
    .lang-toggle-container {
        display: block !important;
        visibility: visible !important;
    }
}

/* Add margin to body content to avoid language button overlap */
body {
    padding-top: 0;
}

/* Adjust header to accommodate language button */
header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000 !important;
}

/* Make sure language button is above header but below modals */
.lang-toggle-container {
    z-index: 110;
}

/* Header solid background for visibility */
header {
    background: white !important;
    width: 100% !important;
    display: block !important;
    visibility: visible !important;
}

/* Ensure navigation links are visible */
header nav .hidden.md\\:flex {
    display: flex !important;
    visibility: visible !important;
}

header nav a {
    display: inline-block !important;
    visibility: visible !important;
    color: #374151 !important;
}

header nav a:hover {
    color: #FF8C00 !important;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #e67e00;
}

/* Floating elements */
.floating {
    animation: float 3s ease-in-out infinite;
}

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

/* Gradient text effect */
.gradient-text {
    background: linear-gradient(135deg, #FF8C00, #1E40AF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Button hover effects */
.btn-primary {
    background: linear-gradient(135deg, #FF8C00, #e67e00);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::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 ease;
}

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

/* Card shadow effects */
.card-shadow {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.card-shadow:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Star rating animation */
.star-rating {
    display: inline-flex;
}

.star-rating i {
    transition: transform 0.2s ease;
}

.star-rating:hover i {
    transform: scale(1.2);
}

/* Price highlight effect */
.price-highlight {
    position: relative;
}

.price-highlight::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #FF8C00, #e67e00);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.price-highlight:hover::after {
    transform: scaleX(1);
}

/* Form styles */
input:focus, textarea:focus, select:focus {
    border-color: #FF8C00;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

/* Loading animation for images */
img {
    transition: opacity 0.3s ease;
}

img[src=""] {
    opacity: 0;
}

/* Mobile menu animation */
#mobileMenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

#mobileMenu.show {
    max-height: 300px;
}

/* Parallax effect for hero section */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Contact form validation styles */
.form-error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.form-success {
    border-color: #10b981;
    background-color: #f0fdf4;
}

/* Section reveal animation */
.section-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.section-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Language switch animation */
.lang-fade {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lang-fade.visible {
    opacity: 1;
}

/* Destination hover animation */
.destination-hover {
    position: relative;
    overflow: hidden;
}

.destination-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.8), rgba(30, 64, 175, 0.8));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.destination-hover:hover::before {
    opacity: 1;
}

.destination-hover .overlay-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.destination-hover:hover .overlay-content {
    opacity: 1;
}

/* RTL support for Arabic */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .flex {
    flex-direction: row-reverse;
}

[dir="rtl"] .space-x-4 > * + * {
    margin-left: 0;
    margin-right: 1rem;
}

/* Contact section RTL fixes */
.contact-item {
    direction: ltr; /* Keep contact items LTR for proper icon and number alignment */
    align-items: flex-start; /* Align items to top for better vertical layout */
}

[dir="rtl"] .contact-item {
    direction: rtl; /* Override for RTL layout */
    flex-direction: row-reverse;
}

[dir="rtl"] .contact-icon {
    margin-right: 0;
    margin-left: 1rem;
}

/* Improve phone number vertical spacing */
.phone-number {
    line-height: 1.5;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.phone-number:last-child {
    margin-bottom: 0;
}

/* Enhance readability */
.phone-number:hover {
    color: #ffffff !important;
    text-decoration: underline;
}

.phone-number {
    direction: ltr !important; /* Force phone numbers to always be LTR */
    text-align: left !important;
    font-family: 'Inter', monospace; /* Use monospace for better number alignment */
    unicode-bidi: embed;
}

[dir="rtl"] .phone-number {
    text-align: left !important; /* Keep phone numbers left-aligned even in RTL */
    margin-right: 0;
    margin-left: auto;
}

/* Ensure proper spacing in contact section */
[dir="rtl"] .contact-item .fas,
[dir="rtl"] .contact-item .fab {
    margin-right: 0;
    margin-left: 1rem;
}

/* Fix contact item alignment in RTL */
[dir="rtl"] .contact-item > div {
    text-align: right;
}

[dir="rtl"] .contact-item .phone-number {
    text-align: left !important;
    display: inline-block;
    margin-right: 0;
    margin-left: auto;
}

/* Additional fixes for contact section in Arabic */
[dir="rtl"] .contact-item {
    text-align: right;
}

[dir="rtl"] .contact-item > div > p {
    text-align: right;
    margin-bottom: 0.5rem;
}

/* Ensure phone numbers maintain proper formatting */
.phone-number {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

/* Contact section improvements */
.contact-item {
    margin-bottom: 1.5rem;
}

.contact-item:last-child {
    margin-bottom: 0;
}

/* Icon positioning */
.contact-icon {
    flex-shrink: 0;
    width: 24px;
    text-align: center;
    margin-top: 0.25rem; /* Slight adjustment for better visual alignment */
}

/* Contact item container improvements */
.contact-item > div {
    flex: 1;
}

/* Ensure proper spacing between contact methods */
.contact-item {
    margin-bottom: 2rem;
}

.contact-item:last-child {
    margin-bottom: 0;
}

/* Phone number specific styling */
.contact-item .phone-number {
    display: block;
    padding: 0.125rem 0;
}

/* RTL adjustments for vertical phone layout */
[dir="rtl"] .contact-item > div {
    text-align: right;
}

[dir="rtl"] .phone-number {
    text-align: left !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .destination-card {
        margin-bottom: 2rem;
    }
    
    #home h1 {
        font-size: 2.5rem;
    }
    
    #home p {
        font-size: 1.125rem;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }
    
    * {
        background: white !important;
        color: black !important;
    }
}