/* 
 * TRENJ - نظام تأجير الشاليهات
 * مستوحى من تصميم جاذران مع تطويرات إضافية
 * 
 * ملاحظة: الألوان يتم تحميلها ديناميكياً من colors.php
 * Dynamic colors are loaded from colors.php
 */

/* ========== إعادة تعيين الأساسيات ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    direction: rtl;
}
/* Smooth scroll desktop only — causes jank on mobile Chrome */
@media (min-width: 769px) {
    html { scroll-behavior: smooth; }
}

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    background-color: #ffffff;
    color: var(--text-primary, #2c3e50);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========== الهيدر ========== */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-img {
    height: 50px;
    width: auto;
}

.logo-text {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.logo-text .accent {
    color: var(--accent-color);
}

/* ========== القائمة الرئيسية ========== */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.main-nav a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition-fast);
    position: relative;
}

.main-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: var(--transition-fast);
    transform: translateX(50%);
}

.main-nav a:hover::after {
    width: 80%;
}

/* ========== قسم البطل (Hero Section) مع Slider ========== */
.hero-section {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

/* خلفية ثابتة احتياطية */
.hero-static-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    z-index: 1;
}

/* Hero Slider Container */
.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* محتوى Hero (صندوق البحث) */
.hero-content {
    position: relative;
    z-index: 10;
    max-width: 900px;
    width: 100%;
    padding: 0 2rem;
    animation: fadeInUp 1s ease;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.4);
    line-height: 1.2;
    color: #ffffff;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
    font-weight: 400;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    color: #ffffff;
    opacity: 0.95;
}

/* ========== نموذج البحث ========== */
.search-form {
    background: #ffffff;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    margin: 0 auto;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition-fast);
    background-color: #ffffff;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 35, 150, 0.1);
}

.btn-search {
    background: linear-gradient(135deg, var(--accent-color), #ff8787);
    color: #ffffff;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-md);
    width: 100%;
}

.btn-search:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* ========== الأقسام ========== */
.section {
    padding: 5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 50%;
    transform: translateX(50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 1.5rem;
}

/* ========== بطاقات الشاليهات (مطابقة لجاذران) ========== */
.chalets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.2rem;
    margin-top: 2rem;
}

.chalet-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #f0f0f0;
}

.chalet-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.chalet-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.chalet-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.chalet-card:hover .chalet-image img {
    transform: scale(1.08);
}

.chalet-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent-color);
    color: #ffffff;
    padding: 0.4rem 0.9rem;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.75rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.chalet-favorite {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.chalet-favorite:hover {
    background: #ffffff;
    transform: scale(1.15);
}

.chalet-content {
    padding: 1.2rem;
}

.chalet-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.chalet-location {
    color: #666;
    margin-bottom: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.chalet-features {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #888;
    font-size: 0.8rem;
}

.feature-item i {
    font-size: 0.9rem;
    color: var(--primary-color);
}

.chalet-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.price-amount {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
}

.price-period {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.2rem;
}

.btn-book {
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 0.6rem 1.3rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-book:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ========== المميزات ========== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    border: 2px solid transparent;
}

.feature-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 2.5rem;
}

.feature-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}

.feature-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========== الفوتر ========== */
.footer {
    background: var(--secondary-color);
    color: #ffffff;
    padding: 3rem 2rem 1rem;
    margin-top: 5rem;
    margin-bottom: 64px; /* مساحة للنافيجيشن السفلي الثابت */
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-section a:hover {
    color: #ffffff;
    margin-right: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

/* ========== الحركات ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease;
}

/* ========== التجاوبية ========== */
/* شاشات كبيرة جداً - 5 بطاقات */
@media (min-width: 1400px) {
    .chalets-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 1.5rem;
    }
}

/* شاشات كبيرة - 4 بطاقات */
@media (min-width: 1024px) and (max-width: 1399px) {
    .chalets-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.3rem;
    }
}

/* تابلت - 3 بطاقات */
@media (min-width: 768px) and (max-width: 1023px) {
    .chalets-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.2rem;
    }
}

/* موبايل كبير - 2 بطاقة */
@media (min-width: 480px) and (max-width: 767px) {
    .chalets-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .chalet-card {
        font-size: 0.9rem;
    }
    
    .chalet-image {
        height: 160px;
    }
    
    .chalet-title {
        font-size: 1rem;
    }
    
    .price-amount {
        font-size: 1.2rem;
    }
}

/* موبايل صغير - بطاقة واحدة */
@media (max-width: 479px) {
    .chalets-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chalet-card {
        max-width: 400px;
        margin: 0 auto;
    }
}

/* تنسيقات عامة للموبايل */
@media (max-width: 768px) {
    .header-content {
        flex-direction: row !important;
        gap: 0 !important;
        padding: 0.5rem 1rem !important;
    }

    /* Hide main nav on mobile - replaced by bottom nav */
    .header .main-nav {
        display: none !important;
    }

    .header .logo-text {
        font-size: 1.1rem !important;
    }

    .header .logo-img {
        height: 28px !important;
    }

    /* Hide footer on mobile - replaced by bottom nav */
    footer.footer {
        display: none !important;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .search-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 3rem 1rem;
    }
}

/* ========== أزرار عامة ========== */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-fast);
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--accent-color);
    color: #ffffff;
}

.btn-secondary:hover {
    background: #ff8787;
    transform: translateY(-2px);
}

/* ========== تنبيهات ========== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}
