/* Chestbox Deals - WordPress Plugin Styles */

:root {
    /* User Defined Palette */
    --accent: #E47B02;
    --accent-alt: #ED8F0C;
    --text-strongest: #1F2933;
    --text-strong: #3E4C59;
    --bg-white: #FFFFFF;
    --bg-light: #F8F9FA;
    
    /* Design Variables */
    --shadow-soft: 0 10px 40px -10px rgba(31, 41, 51, 0.15);
    --shadow-chest: 0 20px 25px -5px rgba(228, 123, 2, 0.4);
    --transition-speed: 0.5s;
}

.chestbox-deals-wrapper {
    width: 100%;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Modern abstract beach gradient: Sky to Sand */
    background: linear-gradient(180deg, #eef7fc 0%, #F8F9FA 60%, #fff3e0 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-strongest);
    padding: 40px 20px;
    border-radius: 12px;
    margin: 20px 0;
}

.chestbox-title {
    color: var(--text-strongest);
    margin: 20px 0 40px;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    text-align: center;
}

.chestbox-title span {
    color: var(--accent);
}

.beach-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 60px;
    padding: 40px 20px 80px;
    width: 100%;
    max-width: 1200px;
    position: relative;
    min-height: 200px;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    color: var(--text-strong);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* 3D Context */
.scene-item {
    position: relative;
    width: 160px;
    height: 140px;
    perspective: 1000px;
}

/* The Modern Flight Ticket Modal (Full Screen) */
.ticket-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000 !important;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    margin: 0;
    padding: 0;
    transform: none !important;
}

.ticket-modal.show {
    display: flex;
    opacity: 1;
}

.ticket-card {
    background: var(--bg-white);
    border-radius: 20px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    pointer-events: auto;
}

.ticket-modal.show .ticket-card {
    transform: scale(1);
}

/* Ticket Header (Orange) */
.ticket-header {
    background: linear-gradient(135deg, var(--accent), var(--accent-alt));
    padding: 20px;
    color: white;
    position: relative;
}

.ticket-header h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.ticket-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

.ticket-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ticket-header .iata {
    font-size: 3rem;
    font-weight: 900;
    opacity: 0.2;
    position: absolute;
    top: -5px;
    right: 10px;
    pointer-events: none;
}

/* Ticket Body */
.ticket-body {
    padding: 30px 20px;
}

.price-tag {
    display: inline-block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-strongest);
    margin-bottom: 10px;
}

.flight-info {
    font-size: 1rem;
    color: var(--text-strong);
    margin-bottom: 20px;
    line-height: 1.6;
}

.btn-book {
    background: var(--text-strongest);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    width: 100%;
    font-size: 1rem;
}

.btn-book:hover {
    transform: translateY(-2px);
    background: var(--accent);
    box-shadow: 0 5px 15px rgba(228, 123, 2, 0.3);
}

/* The Chest (Modern Stylized) */
.chest-wrapper {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

.chest-wrapper:hover {
    transform: translateY(-5px) scale(1.02);
}

.chest-wrapper:hover .chest-base {
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.35),
        0 8px 20px rgba(228, 123, 2, 0.5),
        inset 0 2px 5px rgba(255, 255, 255, 0.25),
        inset 0 -2px 5px rgba(0, 0, 0, 0.25);
}

.chest-wrapper:hover .chest-lid {
    box-shadow: 
        0 -8px 25px rgba(0, 0, 0, 0.25),
        0 -3px 12px rgba(228, 123, 2, 0.4),
        inset 0 3px 8px rgba(255, 255, 255, 0.35),
        inset 0 -2px 5px rgba(0, 0, 0, 0.2);
}

/* Chest Base */
.chest-base {
    position: absolute;
    bottom: 0;
    width: 160px;
    height: 80px;
    background: linear-gradient(180deg, 
        rgba(228, 123, 2, 0.95) 0%, 
        var(--accent) 30%,
        rgba(200, 100, 0, 0.9) 100%);
    border-radius: 0 0 12px 12px;
    z-index: 10;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 5px 15px rgba(228, 123, 2, 0.4),
        inset 0 2px 5px rgba(255, 255, 255, 0.2),
        inset 0 -2px 5px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-top: none;
    overflow: hidden;
}

/* Inner depth effect when chest is opened */
.chest-inner-depth {
    position: absolute;
    top: 0;
    left: 5px;
    right: 5px;
    height: 100%;
    background: linear-gradient(180deg,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.2) 100%);
    border-radius: 0 0 8px 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.scene-item.opened .chest-inner-depth {
    opacity: 1;
}

/* 3D Top Edge Highlight */
.chest-base::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.5) 0%, 
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.1) 100%);
    border-radius: 12px 12px 0 0;
    z-index: 1;
}

/* Modern Chest Details (3D Straps) */
.chest-strap {
    position: absolute;
    height: 100%;
    width: 22px;
    background: linear-gradient(90deg,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(255, 255, 255, 0.25) 20%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.25) 80%,
        rgba(0, 0, 0, 0.3) 100%);
    bottom: 0;
    border-left: 1px solid rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 
        inset 0 0 10px rgba(0, 0, 0, 0.2),
        0 2px 5px rgba(0, 0, 0, 0.1);
}

.chest-strap-left {
    left: 28px;
}

.chest-strap-right {
    right: 28px;
}

/* Lock mechanism - 3D */
.lock-plate {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%) perspective(100px) rotateX(10deg);
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg,
        #2a3a47 0%,
        var(--text-strongest) 50%,
        #1a252f 100%);
    border-radius: 8px;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.1),
        inset 0 -1px 2px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.3);
}

.lock-plate::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 8px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.15) 0%,
        transparent 100%);
    border-radius: 6px 6px 0 0;
}

.lock-plate::after {
    content: '';
    width: 10px;
    height: 10px;
    background: radial-gradient(circle,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(200, 200, 200, 0.8) 50%,
        rgba(150, 150, 150, 0.6) 100%);
    border-radius: 50%;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Chest Lid - 3D */
.chest-lid {
    position: absolute;
    bottom: 80px;
    width: 160px;
    height: 50px;
    background: linear-gradient(180deg,
        rgba(255, 180, 50, 0.9) 0%,
        var(--accent-alt) 40%,
        rgba(220, 130, 10, 0.95) 100%);
    border-radius: 12px 12px 0 0;
    transform-origin: bottom;
    transition: transform 0.5s ease-in-out;
    z-index: 20;
    box-shadow: 
        0 -5px 20px rgba(0, 0, 0, 0.2),
        0 -2px 10px rgba(228, 123, 2, 0.3),
        inset 0 3px 8px rgba(255, 255, 255, 0.3),
        inset 0 -2px 5px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: 2px solid rgba(0, 0, 0, 0.15);
    overflow: visible;
}

/* Top highlight on lid */
.chest-lid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%);
    border-radius: 12px 12px 0 0;
}

/* Lid Straps - 3D */
.lid-strap {
    position: absolute;
    height: 100%;
    width: 22px;
    background: linear-gradient(90deg,
        rgba(0, 0, 0, 0.25) 0%,
        rgba(255, 255, 255, 0.3) 20%,
        rgba(255, 255, 255, 0.35) 50%,
        rgba(255, 255, 255, 0.3) 80%,
        rgba(0, 0, 0, 0.25) 100%);
    bottom: 0;
    border-left: 1px solid rgba(0, 0, 0, 0.15);
    border-right: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 
        inset 0 0 8px rgba(0, 0, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

.lid-strap-left {
    left: 28px;
}

.lid-strap-right {
    right: 28px;
}

/* Open State */
.scene-item.opened .chest-lid {
    transform: rotateX(110deg);
}

/* Coin Rain Animation */
.coin-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10001;
    overflow: hidden;
}

.rain-coin {
    position: absolute;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle at 30% 30%, 
        #FFD700 0%, 
        #FFA500 40%, 
        #FF8C00 100%);
    border-radius: 50%;
    box-shadow: 
        inset -4px -4px 0 rgba(0, 0, 0, 0.3),
        inset 3px 3px 0 rgba(255, 255, 255, 0.4),
        0 3px 6px rgba(0, 0, 0, 0.3);
    animation: coinFall linear forwards;
}

.rain-coin::before {
    content: '$';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(0, 0, 0, 0.6);
    font-size: 16px;
    font-weight: 900;
    font-family: Arial, sans-serif;
}

@keyframes coinFall {
    0% {
        top: -50px;
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        top: 100vh;
        transform: translateX(var(--drift)) rotate(720deg);
        opacity: 0;
    }
}

/* Newsletter Modal */
.newsletter-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.newsletter-modal.show {
    display: flex;
    opacity: 1;
}

.newsletter-content {
    background: var(--bg-white);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.newsletter-modal.show .newsletter-content {
    transform: scale(1);
}

.newsletter-form-wrapper h2,
.newsletter-content h2 {
    margin: 0 0 15px 0;
    font-size: 2rem;
    color: var(--text-strongest);
}

.newsletter-form-wrapper p,
.newsletter-content p {
    color: var(--text-strong);
    margin-bottom: 25px;
    line-height: 1.6;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.newsletter-input {
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.newsletter-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(228, 123, 2, 0.05);
}

.newsletter-privacy {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-strong);
    margin-bottom: 20px;
    text-align: left;
}

.newsletter-privacy input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.newsletter-privacy label {
    cursor: pointer;
    line-height: 1.5;
}

.btn-newsletter {
    background: var(--accent);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    width: 100%;
}

.btn-newsletter:hover:not(:disabled) {
    transform: translateY(-2px);
    background: var(--accent-alt);
    box-shadow: 0 5px 15px rgba(228, 123, 2, 0.3);
}

.btn-newsletter:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-close-newsletter {
    background: transparent;
    border: none;
    color: var(--text-strong);
    cursor: pointer;
    font-size: 1rem;
    padding: 10px;
    margin-top: 10px;
    transition: color 0.2s;
}

.btn-close-newsletter:hover {
    color: var(--text-strongest);
}

/* Newsletter Success State */
.newsletter-success {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.newsletter-success.show {
    display: flex;
}

.newsletter-form-wrapper {
    display: block;
}

.newsletter-form-wrapper.hidden {
    display: none;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 40px;
    animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.newsletter-success h2 {
    margin: 0;
}

.newsletter-success p {
    margin: 0 0 20px 0;
}

/* Sand shadow underneath - Enhanced 3D */
.shadow-base {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 25px;
    background: radial-gradient(ellipse,
        rgba(31, 41, 51, 0.25) 0%,
        rgba(31, 41, 51, 0.15) 40%,
        rgba(31, 41, 51, 0.05) 70%,
        transparent 100%);
    border-radius: 50%;
    z-index: 0;
    filter: blur(8px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .chestbox-title {
        font-size: 2rem;
    }
    
    .beach-container {
        gap: 40px;
        padding: 30px 10px 60px;
    }
    
    .scene-item {
        width: 140px;
        height: 120px;
    }
    
    .chest-base {
        width: 140px;
        height: 70px;
    }
    
    .chest-lid {
        width: 140px;
        height: 45px;
        bottom: 70px;
    }
}

