/**
 * FRW Cruise Booking - Room Selector Styles
 *
 * @package FRW_Cruise_Booking
 */

:root {
    --wp--preset--color--custom-primary-500:                    #ff0008;
    --wp--preset--color--custom-secondary-500:                  #3633e1;
    --room-active-color:                                        var(--wp--preset--color--custom-primary-500);
    --room-active-color-light:                                  hsl(358.1,100%,90%);
    --room-active-color-extra-light:                            hsl(358.1,100%,99.5%);
    --room-success-color:                                       #28a745;
    --room-warning-color:                                       #ff9800;
    --room-error-color:                                         #dc3545;
    --border-color:                                             #e2e8f0;
    --room-border-radius:                                       12px;
    --room-transition:                                          all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --room-pricing-primary:                                     #1e40af;
    --room-pricing-secondary:                                   #3b82f6;
    --warning-badge-primary-100:                                hsl(37.7,89.7%,92.4%);
    --warning-badge-primary-500:                                hsl(37.7,92.1%,50.2%);
    --room-pricing-success:                                     #10b981;
    --room-pricing-bg:                                          #f8fafc;
    --room-pricing-border:                                      #e2e8f0;
 }
 
 .accommodation-list {
   width: 100%;
   margin: 0 auto;
   list-style: none;
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(300px, 400px));
   gap: 24px;
   padding: 0;
 }
 
 /* Radio Card Styles */


 .radio-card {
     height: 100%;
     
     input {
         display: none;
     }
 }
 
 .radio-btn {
    margin: 0;
    min-height: 480px; /* Increased to accommodate pricing */
    height: 100%;
    border: 3px solid var(--border-color);
    display: flex;
    flex-direction: column;
    border-radius: var(--room-border-radius);
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: var(--room-transition);
    background: #ffffff;
 }
 
 .radio-btn:hover {
   border-color: var(--room-active-color);
   box-shadow: 0 8px 30px var(--room-active-color-light);
 }
 
 .radio-btn > i {
   --size: 28px;
   color: #ffffff;
   background-color: var(--room-active-color);
   position: absolute;
   top: -14px;
   left: 50%;
   transform: translateX(-50%) scale(2);
   border-radius: 50%;
   padding: 3px;
   transition: 0.4s ease;
   pointer-events: none;
   opacity: 0;
   font-size: 16px;
   width: var(--size);
   height: var(--size);
   display: flex;
   align-items: center;
   justify-content: center;
   z-index: 10;
 }
 
 .radio-btn .room-content {
   display: flex;
   flex-direction: column;
   align-items: center;
   padding: 24px;
   gap: 8px;
   flex: 1 0 auto;
 }
 
 .radio-btn h3 {
   color: #2c3e50;
   font-size: 18px;
   font-weight: 600;
   text-transform: capitalize;
   letter-spacing: 0.5px;
   margin: 12px 0 8px 0;
   line-height: 1.3;
 }
 
 .short-description {
   color: #7f8c8d;
   font-size: 14px;
   text-align: center;
   margin: 0;
 }
 
 input[disabled] + .radio-btn {
   cursor: not-allowed;
   opacity: 0.6;
 }
 
 input[disabled] + .radio-btn:hover {
   border-color: var(--border-color);
   box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
 }
 
 /* ============================================
    DYNAMIC PRICING STYLES
    ============================================ */
 
 /* Individual Room Pricing Display */
 .room-pricing-display {
   background: linear-gradient(135deg, var(--room-pricing-bg) 0%, #ffffff 100%);
   border: 1px solid var(--room-pricing-border);
   border-radius: 8px;
   padding: 12px;
   margin: 12px 0;
   animation: pricingFadeIn 0.3s ease;
   transition: opacity 0.15s ease, transform 0.15s ease;
   width: 100%;
 }
 
 .room-pricing-display.pricing-updated {
   transform: scale(1.02);
   border-color: var(--room-pricing-secondary);
   box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
 }
 
 .room-price-main {
   display: flex;
   align-items: end;
   justify-content: center;
   gap: 4px;
   margin-bottom: 8px;
 }
 
 .room-price-main .actual-cost {
   color: var(--wp--preset--color--custom-secondary-500);
   font-size: 20px;
   font-weight: 700;
   line-height: 1;
 }
 
 .room-price-main .per-person {
   color: #64748b;
   font-size: 12px;
   font-weight: 500;
   text-transform: uppercase;
   letter-spacing: 0.5px;
 }
 
 .room-price-breakdown {
   color: #64748b;
   font-size: 11px;
   line-height: 1.3;
   margin-bottom: 4px;
 }
 
 .room-price-explanation {
   border-top: 1px solid var(--room-pricing-border);
   padding-top: 6px;
   margin-top: 6px;
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 5px;
 }
 
 .pricing-breakdown-popover {
   background: transparent;
   border: none;  
   margin: 0;
   color: var(--wp--preset--color--custom-secondary-500);
   cursor: pointer;
 }
 
 .radio-card [popover] h4 {
   margin: 0;
 }

 .radio-card [popover] .room-name {
   font-weight: bold;
 }

 .radio-card [popover]::backdrop {
   background-color: rgb(0 0 0 / 0.5);
 }

 .radio-card [popover]:popover-open {
   position: fixed;
   inset: 0;
   margin: auto;
   height: fit-content;
   transition: .2s;
   opacity: 1;
   translate: 0;
   display: flex;
   flex-direction: column;
   justify-content: start;
   padding: 24px;
   border-radius: 8px;
   border: 1px solid var(--border-color);
   width: 100%;
   max-width: 390px;
   gap: 12px;
   background: white;
   font-size: 0.85rem;
 }

 @starting-style {
   .radio-card [popover]:popover-open {
     opacity: 0;
     translate: 0 4rem;
   }
 }
 
 .price-list {
   margin: 0;
   padding: 0;
   list-style: none;
   border: 1px solid var(--border-color);
   border-radius: 6px;
 }
 
 .price-list li {
   display: flex;
   justify-content: space-between;
   width: 100%;
   border-bottom: 1px solid var(--border-color);
   padding-block: 10px;
   padding-inline: 8px;
 }
 
 .price-list li:last-of-type {
   background: #f1f5f9;
   border-bottom: none;
 }
 
 .close-btn {
   position: absolute;
   right: 24px;
   top: 24px;
   background: transparent;
   border: none;
   z-index: 999;
   display: flex;
   width: 20px;
   height: 20px;
   align-items: center;
   cursor: pointer;
   color: #666;
 }
 
.unused-spots-note {
	color: var(--warning-badge-primary-500);
	font-weight: 600;
	font-size: 14px;
	background: var(--warning-badge-primary-100);
	padding: 3px 10px;
	border-radius: 28px;
	text-transform: capitalize;
	border: 1px solid var(--warning-badge-primary-500);
}
 
 /* Accessibility Features */
 .accessible-badge {
   background: var(--room-success-color);
   color: white;
   display: inline-flex;
   padding: 4px 12px;
   border-radius: 20px;
   align-items: center;
   justify-content: center;
   width: fit-content;
   font-size: 12px;
   font-weight: 500;
   margin-top: 8px;
   position: absolute;
   bottom: -10px;
 }
 
 .room-features {
   display: flex;
   flex-wrap: wrap;
   gap: 4px;
   margin-top: 8px;
   justify-content: center;
 }
 
 .feature-badge {
   background: #f1f5f9;
   color: #475569;
   padding: 2px 6px;
   border-radius: 4px;
   font-size: 10px;
   font-weight: 500;
 }
 
 .badge-error {
   color: #dc3545;
   background-color: #ffebee;
   padding: 4px 8px;
   border-radius: 4px;
   font-size: 14px;
   font-weight: 600;
   text-wrap: nowrap;
 }
 
 .room-info {
   list-style: none;
   display: flex;
   font-size: 12px;
   min-height: 50px;
   background: #f8f9fa;
   border-top: 1px solid #e1e5e9;
   align-items: center;
   justify-content: space-between;
   padding: 12px;
   border-radius: 0 0 var(--room-border-radius) var(--room-border-radius);
   margin: 0;
   gap: 8px;
 }
 
 .room-image-wrap {
   width: 100%;
   background: #eee;
   height: 200px;
   display: flex;
   align-items: center;
   justify-content: center;
   border-radius: 8px;
   color: #999;
   font-size: 14px;
   position: relative;
   flex-direction: column;
 }
 
 .room-image-wrap img {
   width: 100%;
   height: 200px;
   object-fit: cover;
   border-radius: 8px;
 }
 
 .room-image-wrap[data-state="placeholder"] img {
   display: none;
 }
 
[data-available="true"] {
  opacity: 1;
  transform: scale(1);
  display: block;
  transition-property: opacity, display, transform;
  transition-duration: 0.9s;
  transition-behavior: allow-discrete;

  @starting-style {
    opacity: 0;
    transform: scale(0);
    display: block;
  }
}

[data-available="false"] {
  opacity: 0;
  transform: scale(0);
  display: none;
  transition-property: opacity, display, transform;
  transition-duration: 0.9s;
  transition-behavior: allow-discrete;
  
  @starting-style {
    opacity: 1;
    transform: scale(1);
    display: none;
  }
}
 
 .radio-btn:hover .room-image-wrap img {
     transform: scale(1.02);
 }
 
 .room-image-wrap[data-state="placeholder"] .room-image-text::before {
    content: "";
    font-size: 24px;
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
 }
 
 /* Selected State */
 .radio-card input:checked + .radio-btn {
   border-color: var(--room-active-color);
   background: var(--room-active-color-extra-light);
   box-shadow: 0 8px 30px var(--room-active-color-light);
 }
 
 .radio-card input:checked + .radio-btn > i {
   opacity: 1;
   transform: translateX(-50%) scale(1);
 }
 
 /* Animation keyframes */
 @keyframes pricingFadeIn {
   from { opacity: 0; transform: translateY(10px); }
   to { opacity: 1; transform: translateY(0); }
 }
 
 @keyframes pricingUpdate {
   0% { transform: scale(1); }
   50% { transform: scale(1.02); }
   100% { transform: scale(1); }
 }
 
 /* Error and loading states */
 .room-selector-error {
   background: #f8d7da;
   color: #721c24;
   padding: 15px;
   border-radius: 5px;
   border: 1px solid #f5c6cb;
   margin: 20px 0;
   text-align: center;
 }
 
 .room-selector-loading {
   text-align: center;
   padding: 40px;
   color: #666;
 }
 
 .room-selector-loading::after {
   content: '...';
   animation: dots 1.5s infinite;
 }
 
 @keyframes dots {
   0%, 20% { color: rgba(0,0,0,0); text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0); }
   40% { color: black; text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0); }
   60% { text-shadow: .25em 0 0 black, .5em 0 0 rgba(0,0,0,0); }
   80%, 100% { text-shadow: .25em 0 0 black, .5em 0 0 black; }
 }
 
 /* Responsive adjustments */
 @media (max-width: 768px) {
   .accommodation-list {
     grid-template-columns: 1fr;
     gap: 16px;
   }
   
   .radio-btn {
     margin: 5px;
     min-height: 420px;
   }
   
   .radio-btn .room-content {
     padding: 16px;
   }
   
   .room-info {
     gap: 4px;
     text-align: center;
   }
 }