/**
 * TRENJ - Chalet Card Image Slider Styles
 * تنسيقات سلايدر الصور في بطاقات الشاليهات
 */

/* Card Container */
.chalet-card {
    position: relative;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    /* GPU acceleration — prevent scroll flickering */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
    contain: layout style paint;
}

.chalet-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Image Container */
.chalet-image-container {
    position: relative;
    width: 100%;
    height: 290px; /* fixed height for uniformity */
    overflow: hidden;
    background: #f0f0f0;
}

/* Single Image (No Slider) */
.chalet-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.chalet-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.chalet-card:hover .chalet-image img {
    transform: scale(1.05);
}

/* Image Slider */
.chalet-image-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.slider-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.slider-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    pointer-events: none;
}

.slider-item.active {
    opacity: 1;
    pointer-events: auto;
}

.slider-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Navigation Arrows */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.chalet-card:hover .slider-nav {
    opacity: 1;
}

.slider-prev {
    right: 10px;
}

.slider-next {
    left: 10px;
}

.slider-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.slider-nav i {
    font-size: 14px;
    color: #333;
}

/* Dots Indicators */
.slider-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 5;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chalet-card:hover .slider-dots {
    opacity: 1;
}

.dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.dot.active {
    background: white;
    width: 20px;
    border-radius: 3px;
}

/* Badge */
.chalet-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #7CB342 0%, #558B2F 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Favorite Button */
.chalet-favorite {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chalet-favorite:hover {
    transform: scale(1.15);
    background: white;
}

.chalet-favorite.active {
    background: #ff4757;
}

.chalet-favorite.active::after {
    content: '❤️';
}

/* Click Overlay */
.card-click-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    cursor: pointer;
}

/* Content Section */
.chalet-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chalet-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.chalet-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.chalet-location i {
    color: var(--primary-color);
    font-size: 0.85rem;
}

/* Features */
.chalet-features {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.feature-item i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* Rating */
.chalet-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.rating-stars {
    color: #f39c12;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.rating-count {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Price Section */
.chalet-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.75rem;
}

.price-info {
    display: flex;
    flex-direction: column;
}

.price-amount {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.price-period {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.btn-book {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(124, 179, 66, 0.2);
}

.btn-book:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 179, 66, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .chalet-content {
        padding: 1rem;
    }
    
    .chalet-title {
        font-size: 1rem;
    }
    
    .price-amount {
        font-size: 1.2rem;
    }
    
    .slider-nav {
        width: 32px;
        height: 32px;
        opacity: 1;
    }
    
    .slider-nav i {
        font-size: 12px;
    }
    
    .slider-dots {
        opacity: 1;
    }
    
    .chalet-features {
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .chalet-price {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .btn-book {
        width: 100%;
        text-align: center;
    }
}
