/**
 * Surprise Travel Booking - Frontend Styles
 */

/* Main widget container */
.stb-booking-widget {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Header styles */
.stb-booking-header {
    text-align: center;
    margin-bottom: 30px;
}

.stb-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #333;
    line-height: 1.2;
}

.stb-title .stb-price-highlight {
    color: #ff6b6b;
}

.stb-subtitle {
    font-size: 1rem;
    color: #666;
    margin: 0;
    font-weight: 400;
}

/* Form container */
.stb-booking-form {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px 35px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
}

.stb-form-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 20px;
    align-items: flex-end;
    width: 100%;
    min-height: 80px;
}

/* Form fields - Force all fields to stay in one row */
.stb-form-field {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-width: 0 !important;
    max-width: none !important;
}

.stb-field-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* Experience field - 25% */
.stb-experience-field {
    flex: 0 0 25% !important;
    min-width: 200px !important;
    max-width: 25% !important;
}

.stb-experience-display {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #ff6b6b, #ff8e85);
    border: none;
    border-radius: 12px;
    padding: 14px 18px;
    height: 52px;
    cursor: default;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
    position: relative;
}

.stb-experience-icon {
    font-size: 1.3rem;
    margin-right: 12px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.stb-experience-text {
    font-weight: 600;
    color: #ffffff;
    font-size: 1rem;
}

/* Remove chevron from Experience field */
.stb-experience-display::after {
    content: '';
}

/* Origin field - 25% */
.stb-origin-field {
    flex: 0 0 25% !important;
    min-width: 180px !important;
    max-width: 25% !important;
}

/* Days field - 15% */
.stb-days-field {
    flex: 0 0 15% !important;
    min-width: 120px !important;
    max-width: 15% !important;
}

/* Custom select styling - make it look like travelers dropdown */
.stb-select {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 0.95rem;
    height: 52px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    color: #374151;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    position: relative;
    appearance: none;
}

.stb-select::before {
    content: '📍';
    font-size: 1.2rem;
    margin-right: 12px;
}

.stb-select-text {
    flex: 1;
    text-align: left;
}

.stb-select::after {
    content: '▼';
    font-size: 0.8rem;
    color: #666;
    margin-left: auto;
}

.stb-select:hover {
    border-color: #c7d2fe;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.stb-select:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1), 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* Different icons for different fields */
.stb-origin-field .stb-select::before {
    content: '📍';
}

.stb-days-field .stb-select::before {
    content: '📅';
}

/* Custom dropdown styling */
.stb-custom-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
}

.stb-dropdown-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.stb-dropdown-option:last-child {
    border-bottom: none;
}

.stb-dropdown-option:hover {
    background-color: #f8f9fa;
}

/* Travelers field - 15% */
.stb-travelers-field {
    position: relative;
    flex: 0 0 15% !important;
    min-width: 120px !important;
    max-width: 15% !important;
    width: 100%;
}

.stb-travelers-selector {
    position: relative;
}

.stb-travelers-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 0.95rem;
    height: 52px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    color: #374151;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    position: relative;
    box-sizing: border-box;
}

.stb-travelers-toggle:hover {
    border-color: #e1e5e9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.stb-travelers-toggle.active {
    border-color: #e1e5e9;
    background: #ffffff;
}

.stb-travelers-icon {
    font-size: 1.2rem;
    margin-right: 8px;
}

.stb-travelers-count {
    font-weight: 600;
    color: #333;
    flex: 1;
    text-align: left;
}

.stb-dropdown-arrow {
    color: #666;
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.stb-travelers-toggle.active .stb-dropdown-arrow {
    transform: rotate(180deg);
}

/* Travelers dropdown */
.stb-travelers-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 4px;
    padding: 20px;
    display: none;
    min-width: 280px;
    width: max-content;
    max-height: 400px;
    overflow-y: auto;
}

.stb-travelers-dropdown.active {
    display: block !important;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure the travelers field is positioned relative */
.stb-travelers-field {
    position: relative;
}

.stb-traveler-group {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.stb-traveler-group:last-child {
    border-bottom: none;
}

.stb-traveler-info {
    flex: 1;
    margin-right: 20px;
}

.stb-traveler-info strong {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.stb-traveler-desc {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.4;
    margin-top: 4px;
}

.stb-traveler-desc strong {
    color: #ff6b85;
    font-weight: 600;
}

.stb-traveler-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.stb-qty-btn {
    width: 32px;
    height: 32px;
    border: 2px solid #ff6b85;
    border-radius: 50%;
    background: #ffffff;
    color: #ff6b85;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(255, 107, 133, 0.15);
}

.stb-qty-btn:hover {
    background: #ff6b85;
    color: #ffffff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 107, 133, 0.25);
}

.stb-qty-btn:disabled {
    border-color: #d1d5db;
    color: #d1d5db;
    cursor: not-allowed;
    box-shadow: none;
}

.stb-qty-btn:disabled:hover {
    background: #ffffff;
    color: #d1d5db;
    transform: none;
    box-shadow: none;
}

.stb-qty-display {
    width: 40px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    background: transparent;
    display: inline-block;
}

.stb-traveler-controls input {
    width: 50px;
    text-align: center;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    background: transparent;
}

/* Submit button - 20% */
.stb-submit-field {
    flex: 0 0 20% !important;
    min-width: 140px !important;
    max-width: 20% !important;
}

.stb-start-button {
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 52px;
    min-width: 140px;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stb-start-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.stb-start-button:hover::before {
    left: 100%;
}

.stb-start-button:hover {
    background: linear-gradient(135deg, #ff5252, #ff4444);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

.stb-start-button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.stb-start-button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

/* Loading state */
.stb-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.stb-loading span {
    display: inline-block;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .stb-booking-widget {
        padding: 15px;
    }

    .stb-title {
        font-size: 1.8rem;
    }

    .stb-booking-form {
        padding: 25px 20px;
        border-radius: 16px;
    }

    .stb-form-row {
        flex-direction: column;
        gap: 18px;
    }

    .stb-travelers-dropdown {
        min-width: 100%;
        left: -20px;
        right: -20px;
        padding: 20px;
    }

    .stb-traveler-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .stb-traveler-info {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .stb-start-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stb-booking-widget {
        padding: 10px;
    }

    .stb-title {
        font-size: 1.4rem;
    }

    .stb-booking-form {
        padding: 20px 15px;
        margin: 0;
        border-radius: 14px;
    }

    .stb-form-row {
        gap: 15px;
    }

    .stb-travelers-dropdown {
        left: -15px;
        right: -15px;
        padding: 18px;
    }

    .stb-field-label {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }
}

/* Preview mode (Elementor editor) */
.stb-preview-mode {
    pointer-events: none;
}

.stb-preview-mode .stb-travelers-dropdown {
    display: none !important;
}

/* Focus states for accessibility */
.stb-select:focus,
.stb-travelers-toggle:focus,
.stb-qty-btn:focus,
.stb-start-button:focus {
    outline: 2px solid #ff6b6b;
    outline-offset: 2px;
}

/* Error states */
.stb-form-field.error .stb-select,
.stb-form-field.error .stb-travelers-toggle {
    border-color: #dc3545;
}

.stb-error-message {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Success animation */
.stb-form-submitted {
    opacity: 0.7;
    pointer-events: none;
}

.stb-form-submitted .stb-start-button {
    background: #28a745;
}

.stb-form-submitted .stb-start-button::after {
    content: '✓';
    margin-left: 5px;
}