/**
 * JP 호텔 숏코드 스타일
 * /var/www/html/wp-content/themes/astra/includes/hotel-system/hotel-styles.css
 */

/* 메인 컨테이너 */
.jp-hotels-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 에러 메시지 */
.jp-hotels-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

/* 헤더 */
.jp-hotels-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
}

.jp-hotels-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.2;
}

.jp-hotels-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

/* 호텔 그리드 */
.jp-hotels-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

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

/* 호텔 카드 */
.jp-hotel-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.jp-hotel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* 랭킹 배지 */
.jp-hotel-rank {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(255,107,107,0.3);
}

/* 호텔 이미지 */
.jp-hotel-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.jp-hotel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.jp-hotel-gallery-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
}

/* 호텔 정보 */
.jp-hotel-info {
    padding: 20px;
}

.jp-hotel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.jp-hotel-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    flex: 1;
    min-width: 200px;
    line-height: 1.3;
}

.jp-hotel-rating {
    display: flex;
    align-items: baseline;
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: bold;
    white-space: nowrap;
}

.jp-hotel-rating .rating-score {
    font-size: 1.1rem;
}

.jp-hotel-rating .rating-total {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* 메타 정보 */
.jp-hotel-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #666;
}

.meta-icon {
    font-size: 1rem;
}

/* 호텔 설명 */
.jp-hotel-overview {
    color: #666;
    line-height: 1.6;
    margin: 15px 0;
    font-size: 0.95rem;
}

/* 예약 정보 */
.jp-hotel-booking {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.jp-hotel-price {
    font-weight: bold;
    color: #e74c3c;
    font-size: 1.05rem;
}

.jp-hotel-book-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(231,76,60,0.3);
}

.jp-hotel-book-btn:hover {
    background: linear-gradient(45deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(231,76,60,0.4);
    color: white;
    text-decoration: none;
}

/* 푸터 */
.jp-hotels-footer {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid #eee;
    margin-top: 20px;
}

.update-info {
    font-size: 0.8rem;
    color: #999;
    margin: 0;
}

/* 모바일 최적화 */
@media (max-width: 767px) {
    .jp-hotels-title {
        font-size: 1.6rem;
    }
    
    .jp-hotels-subtitle {
        font-size: 1rem;
    }
    
    .jp-hotel-meta {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .jp-hotel-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .jp-hotel-rating {
        align-self: flex-end;
        margin-top: 5px;
    }
    
    .jp-hotel-booking {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .jp-hotel-book-btn {
        justify-content: center;
    }
}

/* 로딩 상태 */
.jp-hotels-loading {
    text-align: center;
    padding: 50px 0;
    color: #666;
}

.jp-hotels-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top: 2px solid #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* 접근성 개선 */
.jp-hotel-card:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.jp-hotel-book-btn:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* 프린트 스타일 */
@media print {
    .jp-hotel-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .jp-hotel-book-btn {
        display: none;
    }
    
    .jp-hotels-header {
        background: none !important;
        color: black !important;
    }
}

/* 호텔 이미지 슬라이더 */
.jp-hotel-image-slider {
    position: relative;
    width: 312px;           /* 이미지 원본 폭에 맞춤 */
    height: 234px;          /* 312px의 4:3 비율 또는 적당한 비율 */
    max-width: 100%;        /* 모바일에서 넘치지 않도록 */
    overflow: hidden;
    border-radius: 10px 10px 0 0;
    background: #f5f5f5;
    margin: 0 auto;         /* 카드 내 중앙 정렬 */
}

/* 모바일에서는 전체폭 사용 */
@media (max-width: 768px) {
    .jp-hotel-image-slider {
        width: 100%;
        height: auto;
        aspect-ratio: 312/234;  /* 원본 비율 유지 */
    }
}

.jp-slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.jp-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.jp-slide.active {
    opacity: 1;
}

.jp-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 슬라이더 컨트롤 버튼 */
.jp-slider-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    pointer-events: none;
}

.jp-slider-btn {
    pointer-events: all;
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    font-size: 18px;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.jp-slider-btn:hover {
    background: rgba(0,0,0,0.8);
    opacity: 1;
    transform: scale(1.1);
}

/* 슬라이더 점(도트) */
.jp-slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.jp-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.jp-dot.active {
    background: white;
    transform: scale(1.2);
}

.jp-dot:hover {
    background: rgba(255,255,255,0.8);
}

/* 사진 카운터 */
.jp-photo-counter {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* 자동 재생 애니메이션 (선택사항) */
@keyframes slideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-100%); }
}

/* 모바일 터치 개선 */
@media (max-width: 768px) {
    .jp-slider-btn {
        padding: 8px 12px;
        font-size: 16px;
    }
    
    .jp-slider-dots {
        bottom: 10px;
        gap: 6px;
    }
    
    .jp-dot {
        width: 8px;
        height: 8px;
    }
    
    .jp-photo-counter {
        top: 10px;
        right: 10px;
        padding: 4px 8px;
        font-size: 0.75rem;
    }
}

/* 호버시 컨트롤 표시 */
.jp-hotel-image-slider:hover .jp-slider-btn {
    opacity: 1;
}

.jp-hotel-image-slider:hover .jp-slider-dots {
    opacity: 1;
}