/**
 * Pricing Selection UI Styles
 * Uses theme main color from settings
 */

/* ============================================
   SELECTION UI CONTAINER
   ============================================ */
.pricing-selection-ui {
    background: linear-gradient(135deg, color-mix(in srgb, var(--main-color, #3554D1) 10%, white) 0%, #ffffff 100%);
    border: 2px solid var(--main-color, #3554D1);
    border-radius: 16px;
    padding: 25px;
    margin: 25px 0;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--main-color, #3554D1) 15%, transparent);
    transition: all 0.3s ease;
}

.pricing-selection-ui:hover {
    box-shadow: 0 12px 32px color-mix(in srgb, var(--main-color, #3554D1) 20%, transparent);
    transform: translateY(-2px);
}

.pricing-selection-ui h5 {
    color: var(--main-color-dark, #1e3a8a);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.pricing-selection-ui h5 i {
    color: var(--main-color, #3554D1);
    margin-right: 10px;
    font-size: 20px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* ============================================
   SELECTION GROUPS
   ============================================ */
.selection-group {
    margin-bottom: 20px;
}

.selection-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

.selection-group label i {
    color: var(--main-color, #3554D1);
    margin-right: 5px;
}

.selection-group .form-control,
.selection-group select,
.selection-group input[type="date"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    background: white;
    transition: all 0.3s ease;
}

.selection-group .form-control:focus,
.selection-group select:focus,
.selection-group input[type="date"]:focus {
    outline: none;
    border-color: var(--main-color, #3554D1);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--main-color, #3554D1) 10%, transparent);
}

.selection-group .form-control:hover,
.selection-group select:hover,
.selection-group input[type="date"]:hover {
    border-color: var(--main-color, #3554D1);
}

/* Enhanced Date Input Styling */
.selection-group input[type="date"] {
    position: relative;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%233554D1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 45px;
}

.selection-group input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    cursor: pointer;
}

/* Small helper text */
.selection-group small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
}

.selection-group small i {
    color: var(--main-color, #3554D1);
    margin-right: 4px;
}

/* ============================================
   RADIO OPTIONS
   ============================================ */
.occupancy-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.radio-option {
    flex: 1;
    min-width: 100px;
    position: relative;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-option span {
    display: block;
    padding: 12px 20px;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    background: white;
    transition: all 0.3s ease;
}

.radio-option:hover span {
    border-color: var(--main-color, #3554D1);
    background: #f0fdf4;
}

.radio-option input[type="radio"]:checked + span {
    border-color: var(--main-color, #3554D1);
    background: linear-gradient(135deg, var(--main-color, #3554D1) 0%, var(--main-color-dark, #1e3a8a) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(58, 180, 74, 0.3);
}

/* ============================================
   QUANTITY SELECTOR
   ============================================ */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    padding: 8px;
    transition: all 0.3s ease;
}

.quantity-selector:hover {
    border-color: var(--main-color, #3554D1);
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, var(--main-color, #3554D1) 0%, var(--main-color-dark, #1e3a8a) 100%);
    color: white;
    font-size: 18px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: linear-gradient(135deg, var(--main-color-dark, #1e3a8a) 0%, color-mix(in srgb, var(--main-color, #3554D1) 60%, black) 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(58, 180, 74, 0.4);
}

.qty-btn:active {
    transform: scale(0.95);
}

.qty-input {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    border: none;
    background: transparent;
    padding: 8px;
}

.qty-input:focus {
    outline: none;
}

/* Remove spinner arrows */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input[type=number] {
    -moz-appearance: textfield;
}

/* ============================================
   ROOM CARDS (Multi-Room Selection)
   ============================================ */
.selected-rooms-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.room-card {
    background: white;
    border: 2px solid var(--main-color, #3554D1);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.room-card:hover {
    box-shadow: 0 4px 16px color-mix(in srgb, var(--main-color, #3554D1) 20%, transparent);
    transform: translateY(-2px);
}

.room-card h6 {
    color: var(--main-color-dark, #1e3a8a);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.room-card h6 i {
    color: var(--main-color, #3554D1);
    margin-right: 8px;
}

.remove-room-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-room-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.remove-room-btn:active {
    transform: scale(0.95);
}

.add-room-btn {
    width: 100%;
    padding: 12px;
    background: var(--main-color, #3554D1);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-room-btn:hover {
    background: var(--main-color-dark, #1e3a8a);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--main-color, #3554D1) 30%, transparent);
}

.add-room-btn:active {
    transform: translateY(0);
}

.room-type-selector {
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    width: 100%;
    font-size: 14px;
    transition: all 0.3s ease;
}

.room-type-selector:focus {
    outline: none;
    border-color: var(--main-color, #3554D1);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--main-color, #3554D1) 10%, transparent);
}

.room-occupancy-input {
    width: 100%;
}

/* ============================================
   SELECTION SUMMARY
   ============================================ */
.selection-summary {
    background: white;
    border: 2px solid var(--main-color, #3554D1);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 25px;
    box-shadow: 0 4px 16px rgba(58, 180, 74, 0.15);
}

.summary-header {
    background: linear-gradient(135deg, var(--main-color, #3554D1) 0%, var(--main-color-dark, #1e3a8a) 100%);
    color: white;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.summary-header i {
    margin-right: 10px;
    font-size: 18px;
}

.summary-body {
    padding: 20px;
    min-height: 80px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item span:first-child {
    color: #6b7280;
    font-weight: 500;
}

.summary-item span:last-child {
    color: #1f2937;
    font-weight: 700;
}

.summary-total {
    background: #f0fdf4;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid var(--main-color, #3554D1);
}

.summary-total span:first-child {
    font-size: 14px;
    font-weight: 600;
    color: var(--main-color-dark, #1e3a8a);
}

.summary-total .total-amount {
    font-size: 14px;
    font-weight: 700;
    color: var(--main-color-dark, #1e3a8a);
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-total .total-amount .currency {
    font-size: 14px;
    font-weight: 600;
}

.summary-total .total-amount .amount {
    font-size: 14px;
    font-weight: 700;
}

/* Ensure all child spans inherit the same size */
.summary-total .total-amount span {
    font-size: 14px !important;
}

/* ============================================
   ADD TO CART BUTTON
   ============================================ */
.select-package-btn {
    background: linear-gradient(135deg, var(--main-color, #3554D1) 0%, var(--main-color-dark, #1e3a8a) 100%) !important;
    border: none !important;
    color: white !important;
    padding: 16px 32px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3) !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
}

.select-package-btn:hover {
    background: linear-gradient(135deg, var(--main-color-dark, #1e3a8a) 0%, color-mix(in srgb, var(--main-color, #3554D1) 60%, black) 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(58, 180, 74, 0.4) !important;
}

.select-package-btn:active {
    transform: translateY(0) !important;
}

.select-package-btn i {
    font-size: 18px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .pricing-selection-ui {
        padding: 20px;
        margin: 20px 0;
    }
    
    .occupancy-options {
        flex-direction: column;
    }
    
    .radio-option {
        min-width: 100%;
    }
    
    .summary-total .total-amount {
        font-size: 14px;
    }
    
    .summary-total .total-amount span {
        font-size: 14px !important;
    }
    
    .select-package-btn {
        padding: 14px 24px !important;
        font-size: 15px !important;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pricing-selection-ui {
    animation: fadeIn 0.4s ease-out;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(16, 185, 129, 0.5);
    }
}

.select-package-btn:hover {
    animation: pulse 2s infinite;
}

/* ============================================
   SMALL HELPER TEXT
   ============================================ */
.selection-group small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

/* ============================================
   LOADING STATE
   ============================================ */
.selection-summary.loading {
    opacity: 0.6;
    pointer-events: none;
}

.selection-summary.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid var(--main-color, #3554D1);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   FIXED DATE SELECTOR (Special Styling)
   ============================================ */
.fixed-date-selector {
    background: linear-gradient(to right, #eff6ff, #ffffff) !important;
    border: 2px solid #3b82f6 !important;
    font-weight: 600 !important;
    color: #1e40af !important;
    position: relative;
    padding-right: 40px !important;
}

.fixed-date-selector:hover {
    background: linear-gradient(to right, #dbeafe, #f8fafc) !important;
    border-color: #2563eb !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15) !important;
}

.fixed-date-selector:focus {
    border-color: #1d4ed8 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15) !important;
    background: linear-gradient(to right, #dbeafe, #ffffff) !important;
}

/* Add a special icon indicator for fixed dates */
.fixed-date-selector::after {
    content: '📅';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 18px;
}

/* Style the dropdown arrow */
.fixed-date-selector {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

/* Option styling */
.fixed-date-selector option {
    padding: 12px;
    font-weight: 500;
    color: #1f2937;
}

.fixed-date-selector option:first-child {
    color: #9ca3af;
    font-style: italic;
}

/* Animation for fixed date selector */
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.fixed-date-selector {
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}
