/* ============================================
   ریست و تنظیمات پایه
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 10px;
}

/* ============================================
   کانتینر اصلی - با ارتفاع ثابت قابل اعتماد
   ============================================ */
.app-container {
    max-width: 420px;
    width: 100%;
    background: #f5f7fa;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    position: relative;
    height: 780px;
    display: flex;
    flex-direction: column;
}

/* ============================================
   صفحات
   ============================================ */
.page-content {
    display: none;
    height: 100%;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.page-content.active {
    display: flex;
}

.page-content .main-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 0 120px 0;
    scroll-behavior: smooth;
}

.page-content .main-content::-webkit-scrollbar {
    width: 0;
}

/* ============================================
   هدر - با لوگوی سفیر
   ============================================ */
.header {
    background: #ffffff;
    padding: 16px 20px 16px 20px;
    border-bottom-left-radius: 25px;
    border-bottom-right-radius: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.logo-text h1 {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.logo-text p {
    font-size: 10px;
    color: #888;
    font-weight: 500;
    margin-top: -2px;
}

.profile-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    transition: transform 0.2s;
}

.profile-btn:hover {
    transform: scale(1.05);
}

/* ============================================
   جستجو
   ============================================ */
.search-box {
    margin-top: 16px;
    background: #f0f2f5;
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
}

.search-box:focus-within {
    background: #fff;
    box-shadow: 0 0 0 2px #4CAF50;
}

.search-box i {
    color: #999;
    font-size: 18px;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 15px;
    color: #1a1a2e;
    outline: none;
}

.search-box input::placeholder {
    color: #aaa;
}

.search-box .filter-icon {
    background: #4CAF50;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.search-box .filter-icon:hover {
    background: #388E3C;
    transform: rotate(90deg);
}
/* ============================================
   نتایج جستجو
   ============================================ */
#searchResults {
    animation: fadeInUp 0.3s ease;
    position: relative;
    z-index: 10;
}

#searchResults > div {
    max-height: 400px;
    overflow-y: auto;
}

#searchResults > div::-webkit-scrollbar {
    width: 4px;
}

#searchResults > div::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 10px;
}

#searchResults > div::-webkit-scrollbar-track {
    background: #f0f0f0;
}

/* انیمیشن برای نتایج */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   دسته‌بندی
   ============================================ */
.categories-section {
    padding: 20px 20px 10px 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
}

.section-header a {
    color: #4CAF50;
    font-size: 13px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.categories-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.category-item {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    padding: 14px 22px;
    border-radius: 16px;
    min-width: 80px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
}

.category-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.category-item.active {
    border-color: #4CAF50;
    background: #e8f5e9;
}

.category-item .icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.category-item .name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

/* ============================================
   تورهای ویژه
   ============================================ */
.featured-section {
    padding: 0 20px 10px 20px;
}

.featured-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
}

.featured-scroll::-webkit-scrollbar {
    display: none;
}

.featured-card {
    flex-shrink: 0;
    width: 280px;
    height: 200px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s;
    cursor: pointer;
}

.featured-card:hover {
    transform: scale(1.02);
}

.featured-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-card .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: #fff;
}

.featured-card .overlay h3 {
    font-size: 18px;
    font-weight: 700;
}

.featured-card .overlay .location {
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.featured-card .overlay .price {
    font-size: 16px;
    font-weight: 700;
    color: #FFD700;
    margin-top: 4px;
}

.featured-card .badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
}

.featured-card .badge i {
    color: #FFD700;
}

.featured-card .overlay .featured-book-btn {
    margin-top: 8px;
    padding: 6px 16px;
    background: rgba(76, 175, 80, 0.9);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(4px);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.featured-card .overlay .featured-book-btn:hover {
    background: #4CAF50;
    transform: scale(1.05);
}

/* ============================================
   لیست تورها
   ============================================ */
.tours-list {
    padding: 10px 20px 40px 20px;
}

.tour-item {
    background: #fff;
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 14px;
    display: flex;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.tour-item:last-child {
    margin-bottom: 30px;
}

.tour-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.tour-item .tour-image {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.tour-item .tour-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
}

.tour-item .tour-info h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
}

.tour-item .tour-info .location {
    font-size: 13px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.tour-item .tour-info .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    flex-wrap: wrap;
    gap: 4px;
}

.tour-item .tour-info .meta .rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #FFB300;
    font-weight: 600;
}

.tour-item .tour-info .meta .rating span {
    color: #666;
    font-weight: 400;
}

.tour-item .tour-info .meta .price {
    font-size: 16px;
    font-weight: 700;
    color: #4CAF50;
}

.tour-item .tour-info .meta .price small {
    font-weight: 400;
    font-size: 11px;
    color: #999;
}

.tour-item .tour-info .badge-international {
    background: #e3f2fd;
    color: #1976d2;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    align-self: flex-start;
    margin-top: 4px;
}

.tour-book-btn {
    margin-top: 6px;
    padding: 6px 16px;
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    width: auto;
}

.tour-book-btn:hover {
    background: #388E3C;
    transform: scale(1.05);
}

.tour-book-btn i {
    font-size: 13px;
}

/* ============================================
   بنر
   ============================================ */
.banner {
    margin: 5px 20px 20px 20px;
    background: linear-gradient(135deg, #1a1a2e, #2d2d44);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
}

.banner .text h3 {
    font-size: 18px;
    font-weight: 700;
}

.banner .text p {
    font-size: 13px;
    opacity: 0.8;
    margin-top: 4px;
}

.banner .btn {
    background: #4CAF50;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}

.banner .btn:hover {
    background: #388E3C;
    transform: scale(1.05);
}

/* ============================================
   نوار پایین
   ============================================ */
.bottom-tab {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 420px;
    width: 100%;
    background: #ffffff;
    padding: 10px 20px 16px 20px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #e8ecf1;
    border-radius: 25px 25px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 100;
    height: 70px;
}

.detail-page.active ~ #bottomTabComponent {
    display: none !important;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    transition: all 0.3s;
    padding: 4px 12px;
    border-radius: 12px;
    position: relative;
}

.tab-item i {
    font-size: 22px;
    color: #999;
    transition: all 0.3s;
}

.tab-item span {
    font-size: 10px;
    color: #999;
    font-weight: 500;
    transition: all 0.3s;
}

.tab-item.active i {
    color: #4CAF50;
}

.tab-item.active span {
    color: #4CAF50;
    font-weight: 700;
}

.tab-item:hover i {
    color: #4CAF50;
}

.tab-item .badge-count {
    position: absolute;
    top: -4px;
    right: 0;
    background: #F44336;
    color: #fff;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
}

/* ============================================
   دکمه اسکرول
   ============================================ */
.scroll-top {
    position: fixed;
    bottom: 85px;
    right: 10px;
    width: 44px;
    height: 44px;
    background: #4CAF50;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.4);
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.3s;
    z-index: 50;
    border: none;
}

.scroll-top:hover {
    opacity: 1;
    transform: scale(1.1);
}

.detail-page.active ~ #scrollTopComponent {
    display: none !important;
}

/* ============================================
   صفحه جزئیات
   ============================================ */
.detail-page {
    display: none;
    flex-direction: column;
    height: 100%;
    background: #fff;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    border-radius: 30px;
    overflow: hidden;
}

.detail-page.active {
    display: flex;
}

.detail-page.active ~ .page-content,
.detail-page.active ~ #bottomTabComponent,
.detail-page.active ~ #scrollTopComponent {
    display: none !important;
}

.detail-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    flex-shrink: 0;
}

.detail-back {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 5;
    border: none;
}

.detail-back:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.05);
}

/* ============================================
   محتوای صفحه جزئیات - با اسکرول تضمینی
   ============================================ */
.detail-content {
    flex: 1;
    padding: 24px 20px 20px 20px;
    overflow-y: auto;
    background: #fff;
    margin-top: -30px;
    border-radius: 30px 30px 0 0;
    position: relative;
    height: 100%;
    min-height: 400px;
}

/* اسکرول بار برای زیبایی */
.detail-content::-webkit-scrollbar {
    width: 4px;
}

.detail-content::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 10px;
}

.detail-content::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.detail-title {
    font-size: 24px;
    font-weight: 800;
    color: #1a1a2e;
}

.detail-location {
    font-size: 15px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.detail-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.detail-rating .stars {
    color: #FFB300;
    font-size: 18px;
}

.detail-rating .rate-text {
    font-size: 14px;
    color: #666;
}

.detail-price-box {
    background: #e8f5e9;
    padding: 14px 18px;
    border-radius: 14px;
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-price-box .label {
    font-size: 14px;
    color: #666;
}

.detail-price-box .price {
    font-size: 22px;
    font-weight: 800;
    color: #4CAF50;
}

.detail-price-box .price small {
    font-size: 14px;
    font-weight: 400;
    color: #888;
}

.detail-description {
    margin-top: 20px;
}

.detail-description h4 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.detail-description p {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
}

.detail-features {
    margin-top: 20px;
}

.detail-features h4 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 12px;
}

.detail-features .features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.detail-features .feature-item {
    background: #f5f7fa;
    padding: 12px 14px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #333;
}

.detail-features .feature-item i {
    color: #4CAF50;
    font-size: 18px;
    width: 24px;
}

.detail-itinerary {
    margin-top: 20px;
    margin-bottom: 30px;
}

.detail-itinerary h4 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 12px;
}

.detail-itinerary .day-item {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-itinerary .day-item .day-num {
    background: #4CAF50;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.detail-itinerary .day-item .day-info h5 {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}

.detail-itinerary .day-item .day-info p {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

/* ============================================
   دکمه‌های پایین صفحه جزئیات
   ============================================ */
.detail-book-btn {
    padding: 16px 20px 24px 20px;
    background: #ffffff;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
    margin-top: 30px;
    border-radius: 0 0 30px 30px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 10;
}

.detail-book-btn .btn-book {
    flex: 1;
    background: #4CAF50;
    color: #fff;
    border: none;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.detail-book-btn .btn-book:hover {
    background: #388E3C;
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.detail-book-btn .btn-book i {
    font-size: 18px;
}

.detail-book-btn .btn-fav {
    width: 54px;
    min-width: 54px;
    background: #f5f7fa;
    border: none;
    border-radius: 14px;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-book-btn .btn-fav:hover {
    background: #ffebee;
    color: #F44336;
}

.detail-book-btn .btn-fav.active {
    color: #F44336;
    background: #ffebee;
}

/* ============================================
   فضای خالی در انتهای محتوا برای اسکرول
   ============================================ */
.detail-spacer {
    height: 200px;
    background: transparent;
}

/* ============================================
   انیمیشن‌های مودال
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   انیمیشن‌های لیست تورها
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tour-item {
    animation: fadeInUp 0.5s ease forwards;
}
.tour-item:nth-child(1) { animation-delay: 0.05s; }
.tour-item:nth-child(2) { animation-delay: 0.1s; }
.tour-item:nth-child(3) { animation-delay: 0.15s; }
.tour-item:nth-child(4) { animation-delay: 0.2s; }
.tour-item:nth-child(5) { animation-delay: 0.25s; }
.tour-item:nth-child(6) { animation-delay: 0.3s; }

/* ============================================
   ریسپانسیو
   ============================================ */
@media (max-width: 420px) {
    .app-container {
        height: 100vh;
        border-radius: 0;
        max-height: 100vh;
        min-height: 100vh;
    }
    
    .bottom-tab {
        border-radius: 0;
        padding: 8px 12px 12px 12px;
        height: 60px;
    }
    
    .detail-page {
        border-radius: 0;
    }
    
    .detail-content {
        padding: 20px 16px 20px 16px;
        border-radius: 20px 20px 0 0;
        margin-top: -20px;
        min-height: 300px;
    }
    
    .detail-image {
        height: 220px;
    }
    
    .detail-book-btn {
        padding: 12px 16px 20px 16px;
        border-radius: 0;
    }
    
    .detail-book-btn .btn-book {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .detail-book-btn .btn-fav {
        width: 48px;
        min-width: 48px;
        font-size: 18px;
    }
    
    .featured-card {
        width: 240px;
        height: 170px;
    }
    
    .tour-item .tour-image {
        width: 80px;
        height: 80px;
    }
    
    .tour-item .tour-info h3 {
        font-size: 14px;
    }
    
    .scroll-top {
        width: 38px;
        height: 38px;
        bottom: 72px;
        right: 8px;
    }
}

@media (min-width: 421px) and (max-width: 768px) {
    .app-container {
        height: 90vh;
        max-height: 780px;
        border-radius: 30px;
    }
}

@media (min-width: 769px) {
    .app-container {
        height: 780px;
        max-height: 780px;
        border-radius: 30px;
    }
}