/**
 * Hotel Offers Frontend Styles
 * Responsive popup and topbar styling
 */

/* ==========================================================================
   POPUP STYLES
   ========================================================================== */

.hotel-offer-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hotel-offer-popup.popup-visible {
    opacity: 1;
    visibility: visible;
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
    cursor: pointer;
}

.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.hotel-offer-popup.popup-visible .popup-content {
    transform: translate(-50%, -50%) scale(1);
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    z-index: 10;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.popup-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.popup-body {
    padding: 25px;
    text-align: center;
}

.popup-title {
    margin: 0 0 15px 0;
    font-family: "Arial", Helvetica, sans-serif !important; /* Default font for titles */
}

.popup-text {
    margin: 0 0 25px 0;
    font-family: "Arial", Helvetica, sans-serif !important; /* Default font for text */
}

.popup-cta {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.popup-cta:hover {
    background: initial; /* Reset background to allow theme to apply its hover color */
    border-color: initial; /* Reset border-color to allow theme to apply its hover color */
    /* Keep transform and box-shadow for interactive effect */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

/* Popup variants */
.hotel-offer-popup.popup-large .popup-content {
    max-width: 600px;
}

/* Template 1: Image Right */
.hotel-offer-popup.template_1-template .popup-content {
    display: flex;
    flex-direction: row;
    max-width: 700px; /* Adjust as needed */
}

.hotel-offer-popup.template_1-template .popup-image {
    flex: 1;
    height: auto; /* Allow image to adjust height */
}

.hotel-offer-popup.template_1-template .popup-body {
    flex: 1;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 768px) {
    .hotel-offer-popup.template_1-template .popup-content {
        flex-direction: column; /* Stack image and content vertically */
    }

    .hotel-offer-popup.template_1-template .popup-image {
        height: 200px; /* Restore original image height for stacked layout */
        flex: none; /* Remove flex sizing */
    }

    .hotel-offer-popup.template_1-template .popup-body {
        text-align: center; /* Center text when stacked */
        flex: none; /* Remove flex sizing */
        padding-top: 20px; /* Add some padding if image is on top */
    }
}

/* Template 2: Minimal */
.hotel-offer-popup.template_2-template .popup-content {
    max-width: 400px; /* Smaller for minimal look */
    padding: 30px; /* More internal padding */
    text-align: center;
}

.hotel-offer-popup.template_2-template .popup-image {
    display: none; /* No image in minimal template */
}

.hotel-offer-popup.template_2-template .popup-close {
    top: 10px;
    right: 10px;
}

.hotel-offer-popup.template_2-template .popup-title {
    font-size: 28px;
    margin-bottom: 20px;
}

.hotel-offer-popup.template_2-template .popup-text {
    font-size: 18px;
    margin-bottom: 30px;
}

.hotel-offer-popup.template_2-template .popup-cta {
    padding: 15px 35px;
    font-size: 18px;
}

.hotel-offer-popup.popup-small .popup-content {
    max-width: 400px;
}

.hotel-offer-popup.popup-minimal .popup-body {
    padding: 20px;
}

.hotel-offer-popup.popup-minimal .popup-title {
    font-size: 20px;
    margin-bottom: 10px;
}

/* ==========================================================================
   TOPBAR STYLES
   ========================================================================== */

.hotel-offer-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: #ffffff;
    padding: 12px 20px;
    font-size: 14px;
    position: relative;
    z-index: 1000;
}

.hotel-offer-topbar.topbar-announcement {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.hotel-offer-topbar.topbar-success {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

.hotel-offer-topbar.topbar-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.topbar-content {
    flex: 1;
    margin-right: 15px;
    font-weight: 500;
}

.topbar-cta {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    white-space: nowrap;
}

.topbar-cta:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.topbar-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    margin-left: 10px;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.topbar-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* ==========================================================================
   OFFER LIST STYLES
   ========================================================================== */

.hotel-offers-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 20px 0;
}

.offer-item {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.offer-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.offer-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

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

.offer-item:hover .offer-image img {
    transform: scale(1.05);
}

.offer-content {
    padding: 25px;
}

.offer-content h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.offer-content h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.offer-content h3 a:hover {
    color: #007cba;
}

.offer-excerpt {
    margin: 0 0 20px 0;
    color: #666;
    line-height: 1.6;
    font-size: 14px;
}

.offer-cta {
    display: inline-block;
    background: #007cba;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.offer-cta:hover {
    background: #005a87;
    transform: translateY(-2px);
}

/* Offer meta information */
.offer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
    color: #999;
}

.offer-price {
    font-size: 18px;
    font-weight: 700;
    color: #007cba;
}

.offer-validity {
    font-style: italic;
}

.offer-expired {
    opacity: 0.6;
}

.offer-expired .offer-cta {
    background: #ccc;
    cursor: not-allowed;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .popup-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .popup-body {
        padding: 20px;
    }
    
    .popup-title {
        font-size: 20px;
    }
    
    .popup-text {
        font-size: 14px;
    }
    
    .hotel-offer-topbar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 15px;
    }
    
    .topbar-content {
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .hotel-offers-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .offer-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .popup-image {
        height: 150px;
    }
    
    .popup-body {
        padding: 15px;
    }
    
    .popup-title {
        font-size: 18px;
    }
    
    .hotel-offer-topbar {
        font-size: 13px;
        padding: 12px;
    }
    
    .topbar-cta {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* ==========================================================================
   ANIMATION KEYFRAMES
   ========================================================================== */

@keyframes slideInFromTop {
    from {
        transform: translate(-50%, -60%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes slideInFromBottom {
    from {
        transform: translate(-50%, -40%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes fadeInScale {
    from {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Animation variants */
.hotel-offer-popup.anim-slide-top.popup-visible .popup-content {
    animation: slideInFromTop 0.4s ease-out;
}

.hotel-offer-popup.anim-slide-bottom.popup-visible .popup-content {
    animation: slideInFromBottom 0.4s ease-out;
}

.hotel-offer-popup.anim-fade-scale.popup-visible .popup-content {
    animation: fadeInScale 0.3s ease-out;
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

.popup-close:focus,
.topbar-cta:focus,
.offer-cta:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.hotel-offer-popup[aria-hidden="true"] {
    display: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .popup-content {
        border: 2px solid #000;
    }
    
    .popup-cta,
    .topbar-cta,
    .offer-cta {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .hotel-offer-popup,
    .popup-content,
    .popup-close,
    .offer-item,
    .offer-image img,
    .popup-cta,
    .topbar-cta,
    .offer-cta {
        transition: none;
        animation: none;
    }
    
    .hotel-offer-popup.popup-visible .popup-content {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .hotel-offer-popup,
    .hotel-offer-topbar {
        display: none !important;
    }
}

/* ==========================================================================
   TEMPLATE 3 - FULL SCREEN HERO
   ========================================================================== */

.hotel-offer-popup.template_3-template {
    background: rgba(0, 0, 0, 0.95);
}

.hotel-offer-popup.template_3-template .popup-overlay {
    display: none;
}

.hotel-offer-popup.template_3-template .popup-content {
    max-width: 900px;
    width: 95%;
    max-height: 95vh;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
    position: relative;
}

.popup-hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 12px;
}

.popup-hero-background img {
    filter: brightness(0.7);
}

.popup-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.7));
}

.popup-hero-body {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 60px 40px;
}

.popup-hero-content {
    text-align: center;
    color: white;
    max-width: 600px;
}

.popup-hero-title {
    font-size: 42px;
    font-weight: 700;
    color: white;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.popup-hero-text {
    font-size: 18px;
    color: rgba(255,255,255,0.95);
    margin-bottom: 30px;
    line-height: 1.6;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.popup-hero-cta {
    background: #fff;
    color: #1d2327;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.popup-hero-cta:hover {
    background: #f0f0f0;
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.4);
}

.hotel-offer-popup.template_3-template .popup-close {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.5);
    width: 40px;
    height: 40px;
    font-size: 24px;
}

.hotel-offer-popup.template_3-template .popup-close:hover {
    background: rgba(255,255,255,0.3);
}

/* ==========================================================================
   TEMPLATE 4 - SLIDE-IN BANNER
   ========================================================================== */

.hotel-offer-popup.template_4-template {
    align-items: flex-end;
}

.hotel-offer-popup.template_4-template .popup-overlay {
    background: rgba(0,0,0,0.3);
}

.hotel-offer-popup.template_4-template .popup-content {
    position: relative;
    top: auto;
    left: 0;
    right: 0;
    transform: translateY(100%);
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hotel-offer-popup.template_4-template.popup-visible .popup-content {
    transform: translateY(0);
}

.popup-banner-container {
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 25px 30px;
}

.popup-banner-image {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
}

.popup-banner-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popup-banner-content {
    flex: 1;
}

.popup-banner-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #1d2327;
}

.popup-banner-text {
    font-size: 14px;
    margin: 0;
    color: #50575e;
    line-height: 1.5;
}

.popup-banner-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.popup-banner-cta {
    padding: 10px 24px;
    font-size: 14px;
    white-space: nowrap;
}

.popup-banner-close {
    background: #f0f0f1;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: #50575e;
    transition: all 0.2s;
}

.popup-banner-close:hover {
    background: #dcdcde;
    transform: scale(1.1);
}

/* ==========================================================================
   TEMPLATE 5 - CORNER CARD
   ========================================================================== */

.hotel-offer-popup.template_5-template {
    align-items: flex-end;
    justify-content: flex-end;
    padding: 20px;
}

.hotel-offer-popup.template_5-template .popup-overlay {
    background: transparent;
    pointer-events: none;
}

.hotel-offer-popup.template_5-template .popup-content {
    position: relative;
    top: auto;
    left: auto;
    transform: translateX(120%);
    width: 350px;
    max-width: calc(100vw - 40px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hotel-offer-popup.template_5-template.popup-visible .popup-content {
    transform: translateX(0);
}

.popup-corner-card {
    position: relative;
}

.popup-corner-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.5);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 18px;
    z-index: 10;
    transition: all 0.2s;
}

.popup-corner-close:hover {
    background: rgba(0,0,0,0.7);
    transform: scale(1.1);
}

.popup-corner-image {
    height: 150px;
    overflow: hidden;
}

.popup-corner-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popup-corner-body {
    padding: 20px;
}

.popup-corner-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #1d2327;
}

.popup-corner-text {
    font-size: 14px;
    margin: 0 0 18px 0;
    color: #50575e;
    line-height: 1.5;
}

.popup-corner-cta {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px;
    font-size: 15px;
}

/* Countdown Template */
.hotel-offer-popup.countdown-template .popup-content {
    max-width: 500px;
    text-align: center;
}

.hotel-offers-countdown {
    font-family: 'Arial', sans-serif;
    font-size: 2.5em;
    font-weight: bold;
    color: #333;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.hotel-offers-countdown > div {
    background-color: #f0f0f0;
    padding: 10px 15px;
    border-radius: 8px;
    min-width: 70px;
    text-align: center;
}

.hotel-offers-countdown .label {
    display: block;
    font-size: 0.4em;
    font-weight: normal;
    color: #666;
    margin-top: 5px;
}

/* Responsive adjustments for countdown */
@media (max-width: 768px) {
    .hotel-offers-countdown {
        font-size: 1.8em;
        gap: 10px;
    }

    .hotel-offers-countdown > div {
        min-width: 55px;
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .hotel-offers-countdown {
        font-size: 1.2em;
        gap: 5px;
        flex-wrap: wrap;
    }

    .hotel-offers-countdown > div {
        min-width: 45px;
        padding: 5px;
    }

    .hotel-offer-popup.countdown-template .popup-content {
        padding: 15px;
    }
}

/* ==========================================================================
   SINGLE OFFER PAGE STYLES
   ========================================================================== */

.hotel-offer-single .offer-header-image {
    margin: 0 0 2em 0;
    width: 100%;
}

.hotel-offer-single .offer-header-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.hotel-offer-single .entry-header {
    margin-bottom: 1.5em;
}

.hotel-offer-single .entry-title {
    font-size: 2.5em;
    line-height: 1.2;
    margin: 0 0 0.5em 0;
}

.hotel-offer-single .entry-content {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 2em;
}

.hotel-offer-single .offer-cta-section {
    margin: 2em 0;
    padding: 1.5em;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.hotel-offer-single .offer-cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: #007cba;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 1.2em;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid #007cba;
}

.hotel-offer-single .offer-cta-button:hover {
    background: #005a87;
    border-color: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.hotel-offer-single .entry-footer {
    margin-top: 2em;
    padding-top: 1.5em;
    border-top: 1px solid #e0e0e0;
}

.hotel-offer-single .offer-categories {
    font-size: 0.95em;
    color: #666;
}

.hotel-offer-single .categories-label {
    font-weight: 600;
    margin-right: 0.5em;
}

.hotel-offer-single .offer-categories a {
    color: #007cba;
    text-decoration: none;
    transition: color 0.2s ease;
}

.hotel-offer-single .offer-categories a:hover {
    color: #005a87;
    text-decoration: underline;
}

/* Responsive single offer page */
@media (max-width: 768px) {
    .hotel-offer-single .entry-title {
        font-size: 2em;
    }

    .hotel-offer-single .entry-content {
        font-size: 1em;
    }

    .hotel-offer-single .offer-cta-button {
        padding: 12px 30px;
        font-size: 1.1em;
    }
}

@media (max-width: 480px) {
    .hotel-offer-single .entry-title {
        font-size: 1.6em;
    }

    .hotel-offer-single .offer-cta-section {
        padding: 1em;
    }

    .hotel-offer-single .offer-cta-button {
        padding: 10px 25px;
        font-size: 1em;
        display: block;
        width: 100%;
    }
}