/**
 * Ez2 Booking Sync - Frontend Styles
 *
 * @package Ez2_Booking_Sync
 * @since 1.0.0
 */

/* Source Badges */
.ez2-source-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    z-index: 10;
    letter-spacing: 0.5px;
}

.ez2-badge-agoda {
    background: linear-gradient(135deg, #5c2d91 0%, #7b41b0 100%);
    color: #fff;
}

.ez2-badge-self {
    background: linear-gradient(135deg, #d63638 0%, #e85d5f 100%);
    color: #fff;
}

/* Property Info */
.ez2-property-info {
    margin: 15px 0;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.ez2-property-info > div {
    margin-bottom: 10px;
}

.ez2-property-info > div:last-child {
    margin-bottom: 0;
}

/* Stars */
.ez2-stars {
    font-size: 16px;
    color: #f5a623;
    letter-spacing: 2px;
}

/* Review Score */
.ez2-review-score {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
}

.ez2-review-score .score {
    background: #2271b1;
    color: #fff;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 18px;
    font-weight: 700;
}

.ez2-review-score .label {
    font-size: 12px;
    color: #666;
}

/* Amenities */
.ez2-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.ez2-amenity {
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    color: #555;
}

/* Price Note */
.ez2-price-note {
    margin-top: 10px;
    padding: 10px;
    background: #fcf9e8;
    border-left: 3px solid #dba617;
    border-radius: 0 4px 4px 0;
}

.ez2-price-note small {
    display: block;
    color: #666;
    font-size: 12px;
    line-height: 1.6;
}

/* Check-in/out Times */
.ez2-checkin-out {
    display: flex;
    gap: 20px;
    color: #555;
    font-size: 14px;
}

.ez2-checkin-out span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Address */
.ez2-address {
    color: #666;
    font-size: 14px;
}

.ez2-address span {
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

/* Booking Form Container */
.ez2-booking-form {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.ez2-booking-form h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

/* External Product - Book Now Button */
.ez2-external-book-btn {
    display: inline-block;
    padding: 15px 30px;
    background: linear-gradient(135deg, #5c2d91 0%, #7b41b0 100%);
    color: #fff !important;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 5px;
    transition: all 0.3s ease;
    text-align: center;
}

.ez2-external-book-btn:hover {
    background: linear-gradient(135deg, #7b41b0 0%, #5c2d91 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(92, 45, 145, 0.3);
}

.ez2-external-book-btn .agoda-logo {
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

/* Price Display on Product Cards */
.ez2-product-price {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ez2-product-price .original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
}

.ez2-product-price .current-price {
    color: #d63638;
    font-size: 20px;
    font-weight: 700;
}

.ez2-product-price .price-suffix {
    font-size: 12px;
    color: #666;
    font-weight: normal;
}

.ez2-product-price .discount-badge {
    display: inline-block;
    background: #d63638;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

/* Gallery for Product Images */
.ez2-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.ez2-gallery img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.ez2-gallery img:hover {
    transform: scale(1.05);
}

/* Location Map Placeholder */
.ez2-map-container {
    width: 100%;
    height: 300px;
    background: #f0f0f0;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

/* Responsive */
@media (max-width: 768px) {
    .ez2-property-info {
        padding: 10px 0;
    }

    .ez2-checkin-out {
        flex-direction: column;
        gap: 10px;
    }

    .ez2-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .ez2-external-book-btn {
        display: block;
        width: 100%;
    }
}

/* WooCommerce Product Loop Adjustments */
.woocommerce ul.products li.product {
    position: relative;
}

.woocommerce ul.products li.product .ez2-source-badge {
    position: absolute;
    top: 10px;
    left: 10px;
}

/* Product Card Hover Effects */
.woocommerce ul.products li.product:hover .ez2-source-badge {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ez2-property-info,
.ez2-booking-form {
    animation: fadeIn 0.3s ease;
}

/* =========================
   Search Form Shortcode
   ========================= */
.ez2-hotel-search {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 30px;
}

.ez2-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.ez2-search-horizontal .ez2-search-form {
    flex-wrap: nowrap;
}

.ez2-search-vertical .ez2-search-form {
    flex-direction: column;
}

.ez2-search-compact .ez2-search-form {
    gap: 10px;
}

.ez2-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 150px;
}

.ez2-field label {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.ez2-field input,
.ez2-field select {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.ez2-field input:focus,
.ez2-field select:focus {
    outline: none;
    border-color: #5c2d91;
    box-shadow: 0 0 0 3px rgba(92, 45, 145, 0.1);
}

.ez2-field-submit {
    flex: 0 0 auto;
}

.ez2-btn {
    display: inline-block;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
}

.ez2-btn-primary {
    background: linear-gradient(135deg, #5c2d91 0%, #7b41b0 100%);
    color: #fff;
}

.ez2-btn-primary:hover {
    background: linear-gradient(135deg, #7b41b0 0%, #5c2d91 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(92, 45, 145, 0.3);
}

.ez2-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* =========================
   Search Results
   ========================= */
.ez2-search-results {
    margin-top: 25px;
}

.ez2-results-count {
    margin-bottom: 20px;
    font-size: 16px;
    color: #666;
}

.ez2-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.ez2-result-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.ez2-result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.ez2-result-image {
    height: 180px;
    background: #f0f0f0;
    overflow: hidden;
}

.ez2-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ez2-result-content {
    padding: 15px;
}

.ez2-result-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.4;
    color: #333;
}

.ez2-result-stars {
    font-size: 14px;
    margin-bottom: 8px;
}

.ez2-result-score {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.ez2-result-price {
    margin-bottom: 15px;
}

.ez2-price-original {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
    margin-right: 8px;
}

.ez2-price-current {
    font-size: 20px;
    font-weight: 700;
    color: #d63638;
}

.ez2-discount {
    display: inline-block;
    background: #d63638;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.ez2-btn-book {
    display: block;
    width: 100%;
    background: #5c2d91;
    color: #fff !important;
    text-decoration: none !important;
}

.ez2-btn-book:hover {
    background: #7b41b0;
}

/* =========================
   Hotels Grid Shortcode
   ========================= */
.ez2-hotels-grid {
    display: grid;
    gap: 25px;
}

.ez2-columns-2 { grid-template-columns: repeat(2, 1fr); }
.ez2-columns-3 { grid-template-columns: repeat(3, 1fr); }
.ez2-columns-4 { grid-template-columns: repeat(4, 1fr); }

.ez2-hotel-card {
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.ez2-hotel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.ez2-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    z-index: 5;
}

.ez2-badge-agoda {
    background: #5c2d91;
    color: #fff;
}

.ez2-badge-self_owned {
    background: #d63638;
    color: #fff;
}

.ez2-card-image {
    height: 200px;
    background: #f0f0f0;
    overflow: hidden;
}

.ez2-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.ez2-card-content {
    padding: 15px;
}

.ez2-card-title {
    font-size: 16px;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.ez2-card-title a {
    color: #333;
    text-decoration: none;
}

.ez2-card-title a:hover {
    color: #5c2d91;
}

.ez2-score {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    margin-bottom: 10px;
}

.ez2-score .score-value {
    background: #2271b1;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.ez2-score .score-max {
    font-size: 12px;
    color: #999;
}

.ez2-card-price {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin-bottom: 15px;
}

.ez2-price-suffix {
    font-size: 12px;
    color: #666;
}

/* =========================
   Loading States
   ========================= */
.ez2-loading-spinner {
    text-align: center;
    padding: 40px;
    color: #666;
}

.ez2-loading-spinner::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #5c2d91;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ez2-error {
    padding: 20px;
    background: #fef0f0;
    border: 1px solid #f5c6c6;
    border-radius: 8px;
    color: #d63638;
    text-align: center;
}

.ez2-no-results {
    padding: 40px;
    text-align: center;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 992px) {
    .ez2-columns-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .ez2-search-horizontal .ez2-search-form {
        flex-wrap: wrap;
    }

    .ez2-columns-3,
    .ez2-columns-4 { grid-template-columns: repeat(2, 1fr); }

    .ez2-field {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .ez2-columns-2,
    .ez2-columns-3,
    .ez2-columns-4 { grid-template-columns: 1fr; }

    .ez2-results-grid {
        grid-template-columns: 1fr;
    }
}
