/* Custom CSS for Jude Travel Landing Page */

/* Root Variables */
:root {
    --jude-primary: #1e40af;
    --jude-secondary: #f59e0b;
    --jude-accent: #06b6d4;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-large: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Global Styles */
* {
    scroll-behavior: smooth;
}

/* Arabic RTL Support */
[dir="rtl"] {
    font-family: 'Cairo', sans-serif !important;
}

[dir="ltr"] {
    font-family: 'Inter', sans-serif !important;
}

/* Hero Section Background */
.hero-bg {
    /* Fallback gradient background */
    background: linear-gradient(135deg, #1e40af 0%, #06b6d4 100%);
    min-height: 600px;
    position: relative;
}

/* Ensure hero background image covers properly */
.hero-bg img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* Fallback background for smaller screens */
@media (max-width: 768px) {
    .hero-bg {
        min-height: 500px;
    }
}

@media (max-width: 480px) {
    .hero-bg {
        min-height: 400px;
    }
}

/* Ensure hero content is properly layered */
.hero-bg .relative {
    position: relative;
    z-index: 10;
}

/* Hero section enhancements */
.hero-bg {
    overflow: hidden;
}

/* Enhanced text readability on clean image with subtle shadows */
.hero-bg h1 {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.6);
    font-weight: 800;
}

.hero-bg h2 {
    text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.7), 0 0 15px rgba(0, 0, 0, 0.5);
    font-weight: 600;
}

.hero-bg p,
.hero-bg span {
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6), 0 0 8px rgba(0, 0, 0, 0.4);
}

/* Clean glass effect for the info card */
.hero-bg .bg-white\/10 {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

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

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

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

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

/* Animation Classes */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.animate-pulse-slow {
    animation: pulse 3s ease-in-out infinite;
}

/* Hotel Card Styles */
.hotel-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
    position: relative;
}

.hotel-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-large);
}

.hotel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--jude-primary), var(--jude-accent));
}

/* Price Card Styles */
.price-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.price-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(30, 64, 175, 0.05) 0%, transparent 70%);
    transition: all 0.3s ease;
    opacity: 0;
}

.price-card:hover::before {
    opacity: 1;
}

.price-card:hover {
    border-color: var(--jude-primary);
    transform: scale(1.02);
    box-shadow: var(--shadow-medium);
}

/* Best Value Badge */
.best-value-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    box-shadow: var(--shadow-soft);
}

/* Currency Converter Styles */
.currency-display {
    font-weight: 700;
    color: var(--jude-primary);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.original-price {
    text-decoration: line-through;
    color: #6b7280;
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Language Toggle Styles */
.lang-toggle-active {
    background-color: var(--jude-primary);
    color: white;
}

/* Language and Currency Selector Positioning */
.fixed.top-4.right-4 {
    right: 1rem;
    top: 1rem;
}

/* Responsive adjustments for language/currency buttons */
@media (max-width: 640px) {
    .fixed.top-4.right-4 {
        right: 0.75rem;
        top: 0.75rem;
        max-width: calc(100vw - 1.5rem);
    }
    
    .fixed.top-4.right-4 > div {
        min-width: auto;
        white-space: nowrap;
    }
    
    #currencySelector {
        max-width: 60px;
        font-size: 12px;
    }
    
    #langText {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .fixed.top-4.right-4 {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.5rem;
    }
}

/* Ensure buttons don't overlap with navigation */
@media (min-width: 768px) {
    .fixed.top-4.right-4 {
        top: 1.5rem;
        right: 1.5rem;
    }
}

/* Additional spacing and layout fixes */
.fixed.top-4.right-4 > div {
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Prevent text overflow in currency selector */
#currencySelector option {
    padding: 0.25rem;
}

/* Improved button hover states */
.fixed.top-4.right-4 button:hover,
.fixed.top-4.right-4 select:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Ensure proper stacking order */
.fixed.top-4.right-4 {
    z-index: 50;
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 3rem !important;
    }
    
    .hero-section h2 {
        font-size: 1.5rem !important;
    }
    
    .hotel-card {
        margin-bottom: 2rem;
    }
    
    .price-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--jude-primary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

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

/* Smooth Scrolling */
html {
    scroll-padding-top: 100px;
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--jude-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1e3a8a;
}

/* Focus States for Accessibility */
button:focus,
a:focus,
select:focus {
    outline: 2px solid var(--jude-accent);
    outline-offset: 2px;
}

/* Button Hover Effects */
.btn-primary {
    background: linear-gradient(135deg, var(--jude-primary) 0%, var(--jude-accent) 100%);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Hotel Image Styles */
.hotel-image-placeholder {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 3rem;
}

.hotel-image {
    transition: transform 0.3s ease;
}

.hotel-image:hover {
    transform: scale(1.05);
}

/* Image loading and error states */
.hotel-card img {
    background-color: #f8fafc;
}

.hotel-card img[src=""] {
    display: none;
}

/* Optimize image display */
.hotel-card .h-48 img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* Typography Enhancements */
.text-gradient {
    background: linear-gradient(135deg, var(--jude-primary) 0%, var(--jude-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card Grid Layouts */
.hotel-grid {
    display: grid;
    gap: 2rem;
}

@media (min-width: 768px) {
    .hotel-grid {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    }
}

.price-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 120px;
    right: 1rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-large);
    border-left: 4px solid var(--jude-primary);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12px;
        line-height: 1.4;
    }
    
    .hotel-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Booking Modal Styles */
#bookingModal {
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

#bookingModal.hidden {
    animation: fadeOut 0.3s ease-out;
}

#bookingModal > div {
    animation: slideInDown 0.3s ease-out;
    max-width: 90vw;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

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

/* Form Input Styles */
#bookingForm input,
#bookingForm select,
#bookingForm textarea {
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
}

#bookingForm input:focus,
#bookingForm select:focus,
#bookingForm textarea:focus {
    border-color: var(--jude-primary);
    ring-color: var(--jude-primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

#bookingForm input:invalid,
#bookingForm select:invalid {
    border-color: #ef4444;
}

#bookingForm input:valid,
#bookingForm select:valid {
    border-color: #10b981;
}

/* Form Button Styles */
#bookingForm button[type="submit"] {
    background: linear-gradient(135deg, var(--jude-secondary) 0%, #d97706 100%);
    transition: all 0.3s ease;
}

#bookingForm button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.3);
}

#bookingForm button[type="submit"]:active {
    transform: translateY(0);
}

/* Loading state for submit button */
#bookingForm button[type="submit"].loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

#bookingForm button[type="submit"].loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

/* Modal Responsive Design */
@media (max-width: 768px) {
    #bookingModal > div {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 2rem);
    }
    
    #bookingModal .grid-cols-1.md\\:grid-cols-2,
    #bookingModal .grid-cols-1.md\\:grid-cols-3 {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    #bookingForm {
        padding: 1.5rem;
    }
    
    #bookingModal h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    #bookingModal > div {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
        border-radius: 1rem;
    }
    
    #bookingForm {
        padding: 1rem;
    }
    
    #bookingModal .p-6 {
        padding: 1rem;
    }
}

/* Form Validation Feedback */
.form-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    animation: slideInDown 0.2s ease-out;
}

.form-success {
    color: #10b981;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    animation: slideInDown 0.2s ease-out;
}

/* Enhanced Select Styling */
#bookingForm 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 8 4 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;
}

/* Date Input Enhancements */
#bookingForm input[type="date"] {
    position: relative;
}

#bookingForm input[type="date"]::-webkit-calendar-picker-indicator {
    color: var(--jude-primary);
    cursor: pointer;
}

/* Hotel Selection Enhancement */
#hotelSelect option {
    padding: 0.5rem;
    font-weight: 500;
}

#hotelSelect option:hover {
    background-color: rgba(30, 64, 175, 0.1);
}