/* Common Shared Styles */
/* This file contains styles that are used across multiple pages to reduce redundancy */

/* ==================== GLOBAL STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    line-height: 1.6;
    background-color: #f9f9f9;
    color: #333;
    margin-top: 80px; /* Account for fixed header height */
    padding-top: 0;
}

a {
    text-decoration: none;
    color: var(--dark-color);
}

ul {
    list-style: none;
}

img {
    width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

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

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

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-3px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(3px);
    }
}

@keyframes focusPulse {
    0% {
        box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25), 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    }
}

/* ==================== COMMON FORM STYLES ==================== */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.form-group.focused label {
    color: var(--secondary-color);
}

.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: 16px;
    color: #333;
    background-color: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
}

/* Modern select styling */
.form-group select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23666' d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 12px;
    padding-left: 35px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* RTL support for select arrow */
[dir="rtl"] .form-group select {
    background-position: right 12px center;
    padding-right: 35px;
    padding-left: 15px;
}

/* Remove arrow from phone selects in RTL */
[dir="rtl"] .phone-group .phone-input select {
    background-image: none !important;
    padding-right: 8px !important;
    padding-left: 8px !important;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.form-group select:hover,
.form-group input:hover,
.form-group textarea:hover {
    border-color: var(--secondary-color);
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

/* Enhanced select hover state */
.form-group select:hover {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23d4af37' d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
}

.form-group select:focus {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23d4af37' d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
}

/* Remove arrows from phone selects on hover/focus */
.phone-group .phone-input select:hover,
.phone-group .phone-input select:focus {
    background-image: none !important;
}

.form-group input:valid:not(:focus):not(:placeholder-shown),
.form-group select:valid:not(:focus),
.form-group textarea:valid:not(:focus):not(:placeholder-shown) {
    border-color: #28a745;
    background-color: #f8fff9;
}

.form-group input:invalid:not(:focus):not(:placeholder-shown),
.form-group select:invalid:not(:focus),
.form-group textarea:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.form-group::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}

.form-group.focused::after {
    width: 100%;
}

/* Form Error and Success States */
.form-group.error input,
.form-group.error select,
.form-group.error textarea,
.form-group.error .phone-input {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15), 0 4px 8px rgba(0, 0, 0, 0.08) !important;
}

.form-group.success input,
.form-group.success select,
.form-group.success textarea,
.form-group.success .phone-input {
    border-color: #28a745 !important;
    background-color: #f8fff9 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15), 0 4px 8px rgba(0, 0, 0, 0.08) !important;
}

/* Modern dropdown options styling */
.form-group select option {
    padding: 8px 12px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    border: none;
}

.form-group select option:hover,
.form-group select option:focus {
    background-color: rgba(212, 175, 55, 0.1);
    color: var(--primary-color);
}

.form-group select option:checked {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    font-weight: 600;
}

/* Enhanced select states for country dropdown - arrows removed */

.field-hint {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

.field-error {
    display: block;
    font-size: 12px;
    color: #dc3545;
    margin-top: 5px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.field-error.show {
    opacity: 1;
}

/* ==================== PHONE INPUT STYLES ==================== */
.phone-group .phone-input {
    display: flex;
    gap: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e1e5e9;
    background-color: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    direction: ltr;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.phone-group .phone-input:focus-within {
    border-color: var(--secondary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.phone-group .phone-input:hover {
    border-color: var(--secondary-color);
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.phone-group .phone-input select {
    width: auto;
    min-width: 130px; /* Reduced for better proportion */
    max-width: 150px; /* Reduced max width */
    border: none;
    border-radius: 0;
    background-color: transparent;
    background-image: none !important; /* Remove arrow completely */
    padding: 12px 8px !important; /* Increased padding since no arrow */
    font-size: 11px; /* Reduced font size */
    font-weight: 500; /* Reduced weight */
    line-height: 1.2;
    order: 1;
    border-right: 1px solid #e9ecef;
    text-align: right;
    direction: rtl;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-shadow: none;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.phone-group .phone-input input {
    flex: 1;
    border: none;
    border-radius: 0;
    background-color: transparent;
    padding: 12px 15px;
    order: 2;
    direction: ltr;
    text-align: left;
}

.phone-group .phone-input select:focus,
.phone-group .phone-input input:focus {
    outline: none;
    border: none;
    box-shadow: none;
    background-color: transparent;
}

/* ==================== COMMON BUTTON STYLES ==================== */
.btn {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 12px 28px; /* Improved proportion */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap; /* Prevent text wrapping */
    min-height: 48px; /* Maintain good touch target */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    background: var(--secondary-color);
    color: var(--dark-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ==================== FORM STATUS MESSAGES ==================== */
.form-status {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: 500;
    display: none;
    text-align: center;
}

.form-status.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.form-status.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.form-status.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

/* ==================== CONTACT CARD STYLES ==================== */
.contact-card {
    background: linear-gradient(135deg, #f8f9fa, #fff);
    border: 2px solid rgba(212, 175, 55, 0.1);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        rgba(212, 175, 55, 0.05) 0%, 
        transparent 25%, 
        transparent 75%, 
        rgba(212, 175, 55, 0.05) 100%);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.contact-card:hover {
    transform: translateY(-8px);
    border-color: var(--secondary-color);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.contact-icon {
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.contact-card:hover .contact-icon {
    background: linear-gradient(45deg, var(--secondary-color), #f9efb0);
    color: var(--primary-color);
    transform: scale(1.1);
}

.contact-text {
    position: relative;
    z-index: 2;
    flex: 1;
}

.contact-text h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.3;
}

.contact-text p {
    margin: 0;
    color: #666;
    font-size: 1rem;
    line-height: 1.4;
    word-break: break-word;
}

.click-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--secondary-color);
    font-weight: 600;
    margin-top: 5px;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s ease;
}

.contact-card:hover .click-hint {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== SECTION HEADER STYLES ==================== */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.section-header p {
    font-size: 1.2rem;
    color: #6c757d;
    font-weight: 400;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* ==================== UTILITY CLASSES ==================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.text-center {
    text-align: center;
}

.mt-40 {
    margin-top: 40px;
}

.service-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.service-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Override for services page specific styling */
.services-overview .service-link {
    padding: 8px 20px;
    background: rgba(212, 175, 55, 0.1);
    color: var(--secondary-color);
    border-radius: 30px;
    font-size: 14px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    text-decoration: none;
}

.services-overview .service-link:hover {
    background: var(--secondary-color);
    color: var(--dark-color);
    border-color: var(--secondary-color);
    text-decoration: none;
}

/* ==================== RESPONSIVE UTILITIES ==================== */
@media (max-width: 768px) {
    .form-group select,
    .form-group input,
    .form-group textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .section-header h2 {
        font-size: 2.2rem;
    }
    
    .section-header p {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .btn {
        padding: 10px 22px; /* Reduced for tablet proportion */
        font-size: 15px;
        min-width: auto; /* Allow buttons to size to content */
        min-height: 46px; /* Slightly reduced for tablet */
    }
}

@media (max-width: 576px) {
    .btn {
        padding: 10px 18px; /* Further reduced for mobile proportion */
        font-size: 14px;
        min-width: auto; /* Allow buttons to size to content */
        min-height: 44px; /* Reduced for mobile */
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .section-header p {
        font-size: 1rem;
        padding: 0 20px;
    }
    
    .phone-group .phone-input {
        flex-direction: column;
    }
    
    .phone-group .phone-input select {
        min-width: 100%;
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        order: 1;
    }
    
    .phone-group .phone-input input {
        border-right: none;
        order: 2;
    }
    
    .contact-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .contact-icon {
        width: 50px;
        height: 50px;
        min-width: 50px;
        min-height: 50px;
        font-size: 1.3rem;
    }
    
    .form-group select,
    .form-group input,
    .form-group textarea {
        padding: 10px 12px; /* Proportional padding for mobile */
        font-size: 15px; /* Prevent zoom while being readable */
    }
    
    .phone-group .phone-input select {
        font-size: 10px !important; /* Even smaller for very small screens */
        padding: 10px 6px !important; /* Increased padding since no arrow */
        min-width: 100px; /* Reduced minimum width */
        background-image: none !important; /* Remove arrow completely */
        font-weight: 500 !important;
        line-height: 1.2 !important;
        text-overflow: ellipsis !important;
        overflow: hidden !important;
        white-space: nowrap !important;
    }
    
    .phone-group .phone-input input {
        padding: 10px 12px; /* Proportional padding for mobile */
    }
}

/* Card overlay styles for clickable cards */
.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    text-decoration: none !important;
    cursor: pointer;
    display: block;
}

/* Ensure cards with overlays have proper positioning */
.offer-card, .destination-card, .featured-offer-card {
    position: relative;
}

/* Ensure all buttons in cards have higher z-index than overlay */
.offer-card .btn,
.offer-card .offer-btn,
.destination-card .btn,
.destination-card .destination-btn,
.featured-offer-card .btn,
.featured-offer-card .offer-btn {
    position: relative;
    z-index: 2;
}

/* Enhanced hover effects for cards */
.offer-card:hover,
.destination-card:hover,
.featured-offer-card:hover {
    cursor: pointer;
}

/* Ensure hover effects work when hovering over buttons too */
.offer-card:hover .card-overlay,
.destination-card:hover .card-overlay,
.featured-offer-card:hover .card-overlay {
    z-index: 1;
}

/* Button hover effects when hovering anywhere on the card */
.offer-card:hover .offer-btn,
.offer-card:hover .btn {
    background: var(--secondary-color) !important;
    color: var(--dark-color) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3) !important;
}

.destination-card:hover .destination-btn,
.destination-card:hover .btn {
    background: var(--secondary-color) !important;
    color: var(--dark-color) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3) !important;
}

.featured-offer-card:hover .offer-btn,
.featured-offer-card:hover .btn {
    background: var(--secondary-color) !important;
    color: var(--primary-color) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(11, 37, 69, 0.3) !important;
}

/* Special handling for destination detail buttons with arrow animation */
.destination-card:hover .btn::after {
    transform: translateX(-4px) !important;
} 