/* ============================================
   CONTEXT ATTACHMENT UI - Chat Context Metadata
   Collapsible sections that reuse existing UI components
   from Garage Section and Gig Profile Section
   ============================================ */

/* ============================================
   CONTEXT SECTIONS CONTAINER
   ============================================ */

.context-sections {
  padding: 8px 12px 0;
  border-top: 1px solid #f0f0f0;
  margin-top: 8px;
}

/* Preferences Group */
.context-preferences-group {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 8px;
}

.context-preferences-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(75, 196, 81, 0.08) 0%, rgba(59, 130, 246, 0.08) 100%);
  border-bottom: 1px solid rgba(75, 196, 81, 0.15);
  transition: all 0.2s ease;
}

.context-preferences-header:hover {
  background: linear-gradient(135deg, rgba(75, 196, 81, 0.12) 0%, rgba(59, 130, 246, 0.12) 100%);
}

.context-preferences-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4BC451 0%, #3b82f6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.context-preferences-icon svg {
  color: white;
}

.context-preferences-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

.context-preferences-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.context-preferences-chevron {
  width: 20px;
  height: 20px;
  color: #9ca3af;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.context-preferences-group.collapsed .context-preferences-chevron {
  transform: rotate(-90deg);
}

.context-preferences-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 2000px;
  transition: max-height 0.3s ease;
  overflow: hidden;
}

.context-preferences-group.collapsed .context-preferences-content {
  max-height: 0 !important;
}

/* Inner sections styling when inside preferences group */
.context-preferences-content .context-section {
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 0;
}

.context-preferences-content .context-section:last-child {
  border-bottom: none;
}

.context-section {
  background: #f9fafb;
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

/* AI Section - green border for branding */
.context-section.context-ai-section {
  border: 2px solid #4BC451 !important;
  border-color: #4BC451 !important;
}

.context-section.context-ai-section:hover {
  border: 2px solid #4BC451 !important;
  border-color: #4BC451 !important;
  box-shadow: 0 2px 8px rgba(75, 196, 81, 0.1);
}

.context-section.context-ai-section.expanded {
  background: white;
  border: 2px solid #4BC451 !important;
  border-color: #4BC451 !important;
}

.context-section:hover {
  border-color: #4BC451;
  box-shadow: 0 2px 8px rgba(75, 196, 81, 0.1);
}

.context-section.expanded {
  background: white;
  border-color: #4BC451;
}

/* ============================================
   SECTION HEADER (Collapsed State)
   ============================================ */

.context-section-header {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  gap: 12px;
  user-select: none;
}

.context-section-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(75, 196, 81, 0.1) 0%, rgba(75, 196, 81, 0.2) 100%);
}

.context-section-icon.garage-icon {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(124, 58, 237, 0.2) 100%);
}

.context-section-icon.address-icon {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.2) 100%);
}

.context-section-icon.platform-icon {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.2) 100%);
}

.context-section-icon.schedule-icon {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.2) 100%);
}

.context-section-info {
  flex: 1;
  min-width: 0;
}

.context-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.3;
}

.context-section-preview {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.context-section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ============================================
   INCLUDE TOGGLE - iOS Style
   ============================================ */

.context-toggle {
  position: relative;
  width: 44px;
  height: 24px;
}

.context-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.context-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  transition: all 0.3s ease;
  border-radius: 24px;
}

.context-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: all 0.3s ease;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.context-toggle input:checked + .context-toggle-slider {
  background-color: #4BC451;
}

.context-toggle input:checked + .context-toggle-slider:before {
  transform: translateX(20px);
}

.context-toggle input:focus + .context-toggle-slider {
  box-shadow: 0 0 0 3px rgba(75, 196, 81, 0.2);
}

/* Chevron Icon */
.context-section-chevron {
  width: 20px;
  height: 20px;
  color: #9ca3af;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.context-section.expanded .context-section-chevron {
  transform: rotate(180deg);
  color: #4BC451;
}

/* ============================================
   SECTION CONTENT (Expanded State)
   ============================================ */

.context-section-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 14px;
}

.context-section.expanded .context-section-content {
  max-height: 450px;
  padding: 0 14px 14px;
  overflow-y: auto;
  overscroll-behavior: contain; /* Prevent scroll chaining */
}

.context-section-inner {
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.context-empty-state {
  text-align: center;
  padding: 24px 16px;
  color: #9ca3af;
}

.context-empty-state .empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.context-empty-state p {
  font-size: 13px;
  margin: 0;
}

/* ============================================
   REUSED COMPONENT OVERRIDES
   Adjustments for components inside context sections
   ============================================ */

/* Garage carousel inside context */
.context-section-inner .garage-carousel-wrapper {
  margin: 0;
  border-radius: 12px;
  position: relative;
  background: #000;
  overflow: hidden;
}

.context-section-inner .carousel-image-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.context-section-inner .carousel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.context-section-inner .carousel-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
}

.context-section-inner .carousel-progress-bars {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  z-index: 10;
}

.context-section-inner .progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.context-section-inner .progress-bar.active {
  background: rgba(75, 196, 81, 0.9);
}

.context-section-inner .progress-bar.completed {
  background: rgba(255, 255, 255, 0.8);
}

.context-section-inner .carousel-angle-label {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

/* Address list inside context */
.context-section-inner .address-list-vertical {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.context-section-inner .address-item-vertical {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: white !important;
  border-radius: 10px;
  border: 1px solid #e5e7eb !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Override garage-section.css .address-mandatory rule */
.context-section-inner .address-item-vertical.address-mandatory {
  border: 1px solid #e5e7eb !important;
  background: white !important;
}

.context-section-inner .address-item-vertical:hover {
  background: #f3f4f6 !important;
  border-color: #9ca3af !important;
}

/* Only selected address gets green - including mandatory */
.context-section-inner .address-item-vertical.context-address-selected,
.context-section-inner .address-item-vertical.address-mandatory.context-address-selected {
  border: 2px solid #4BC451 !important;
  background: #f0fdf4 !important;
}

.context-section-inner .address-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.context-section-inner .address-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.context-section-inner .address-details-vertical {
  flex: 1;
  min-width: 0;
}

.context-section-inner .address-label {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.context-section-inner .badge-required {
  display: inline-block;
  padding: 2px 6px;
  background: #fef3c7;
  color: #92400e;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 4px;
}

.context-section-inner .address-line {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.context-section-inner .address-actions-vertical {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 8px;
}

/* Radio/Check indicator for address selection */
.context-address-radio {
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.context-address-selected .context-address-radio {
  display: none;
}

.context-address-check {
  width: 24px;
  height: 24px;
  background: #f0fdf4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Platform cards inside context */
.context-section-inner .selected-platforms-list {
  gap: 8px;
}

.context-section-inner .selected-platform-card {
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: white;
  transition: all 0.2s ease;
}

.context-section-inner .selected-platform-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.context-section-inner .selected-platform-card.context-unselected {
  opacity: 0.5;
}

.context-section-inner .selected-platform-card .platform-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.context-section-inner .selected-platform-card .platform-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.context-section-inner .selected-platform-card .platform-icon {
  font-size: 16px;
}

.context-section-inner .selected-platform-card .platform-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
}

.context-section-inner .selected-platform-card .platform-percentage {
  font-size: 11px;
  font-weight: 600;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Week picker inside context - Compact version - OVERRIDE gig-profile-section.css */
.context-section-inner .week-picker-horizontal {
  display: flex !important;
  justify-content: center !important;
  gap: 2px !important;
  margin-bottom: 10px !important;
  padding: 0 !important;
}

.context-section-inner .day-column {
  min-width: 0 !important;
  max-width: 38px !important;
  width: auto !important;
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 2px !important;
  padding: 4px 2px !important;
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  border-radius: 6px !important;
  transition: all 0.3s ease !important;
}

.context-section-inner .day-column.active {
  background: #f8f8f8 !important;
  border: 1px solid #000000 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

.context-section-inner .day-label {
  font-size: 8px !important;
  font-weight: 600 !important;
  color: #9ca3af !important;
  text-transform: uppercase !important;
  line-height: 1 !important;
}

/* Active day label - darker */
.context-section-inner .day-column.active .day-label {
  color: #1f2937 !important;
}

.context-section-inner .shift-toggles {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 3px !important;
}

.context-section-inner .shift-btn {
  padding: 0 !important;
  font-size: 10px !important;
  line-height: 1 !important;
  border: 1px solid #d1d5db !important;
  background: white !important;
  border-radius: 3px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  opacity: 0.4 !important;
}

.context-section-inner .shift-btn:hover {
  opacity: 0.7 !important;
  border-color: #9ca3af !important;
}

.context-section-inner .shift-btn.active {
  opacity: 1 !important;
  transform: scale(1.05) !important;
}

/* Day shift = Blue background */
.context-section-inner .shift-btn[data-shift="day"].active {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
}

/* Night shift = Black background */
.context-section-inner .shift-btn[data-shift="night"].active {
  background: #1f2937 !important;
  border-color: #1f2937 !important;
}

.context-section-inner .hours-clock-wrapper {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
}

.context-section-inner .hours-clock-face {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  pointer-events: none !important;
  z-index: 0 !important;
}

/* Clock tick marks - GRAY for inactive days */
.context-section-inner .hours-clock-face::before {
  content: '' !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 100% !important;
  height: 100% !important;
  transform: translate(-50%, -50%) !important;
  border-radius: 50% !important;
  background: conic-gradient(
    from 0deg,
    #d1d5db 0deg, #d1d5db 6deg, transparent 6deg,
    transparent 84deg, #d1d5db 84deg, #d1d5db 96deg, transparent 96deg,
    transparent 174deg, #d1d5db 174deg, #d1d5db 186deg, transparent 186deg,
    transparent 264deg, #d1d5db 264deg, #d1d5db 276deg, transparent 276deg,
    transparent 354deg
  ) !important;
}

/* Clock tick marks - DARK for active days */
.context-section-inner .day-column.active .hours-clock-face::before {
  background: conic-gradient(
    from 0deg,
    #374151 0deg, #374151 6deg, transparent 6deg,
    transparent 84deg, #374151 84deg, #374151 96deg, transparent 96deg,
    transparent 174deg, #374151 174deg, #374151 186deg, transparent 186deg,
    transparent 264deg, #374151 264deg, #374151 276deg, transparent 276deg,
    transparent 354deg
  ) !important;
}

.context-section-inner .hours-clock-fill {
  position: absolute !important;
  top: 1px !important;
  left: 1px !important;
  right: 1px !important;
  bottom: 1px !important;
  border-radius: 50% !important;
  pointer-events: none !important;
  z-index: 1 !important;
  opacity: 0.4 !important;
  transition: background 0.3s ease !important;
}

.context-section-inner .hours-input {
  position: relative !important;
  z-index: 2 !important;
  padding: 0 !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  text-align: center !important;
  line-height: 1 !important;
  border: 1px solid #d1d5db !important;
  background: transparent !important;
  border-radius: 50% !important;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  -moz-appearance: textfield !important;
  color: #9ca3af !important;
  cursor: pointer !important;
}

/* Active day - darker input */
.context-section-inner .day-column.active .hours-input {
  border-color: #374151 !important;
  color: #1f2937 !important;
}

.context-section-inner .hours-input:focus {
  outline: none !important;
  border-color: #3b82f6 !important;
  background: rgba(59, 130, 246, 0.1) !important;
}

.context-section-inner .hours-input::-webkit-outer-spin-button,
.context-section-inner .hours-input::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

/* Schedule summary */
.context-section-inner .schedule-summary {
  margin-top: 8px !important;
  padding: 8px 12px !important;
  background: #f9fafb !important;
  border-radius: 8px !important;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .context-sections {
    padding: 6px 10px 0;
  }
  
  .context-section-header {
    padding: 10px 12px;
    gap: 10px;
  }
  
  .context-section-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  
  .context-section-title {
    font-size: 13px;
  }
  
  .context-toggle {
    width: 40px;
    height: 22px;
  }
  
  .context-toggle-slider:before {
    height: 16px;
    width: 16px;
  }
  
  .context-toggle input:checked + .context-toggle-slider:before {
    transform: translateX(18px);
  }
  
  .context-section-inner .day-column {
    padding: 4px 1px;
  }
  
  .context-section-inner .day-label {
    font-size: 9px;
  }
  
  .context-section-inner .shift-btn {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }
  
  .context-section-inner .hours-clock-wrapper {
    width: 26px;
    height: 26px;
  }
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

@media (prefers-color-scheme: dark) {
  .context-sections {
    border-top-color: #333;
  }
  
  .context-section {
    background: #1f1f1f;
    border-color: #333;
  }
  
  .context-section.expanded {
    background: #262626;
    border-color: #4BC451;
  }
  
  .context-section-title {
    color: #f5f5f5;
  }
  
  .context-section-preview {
    color: #9ca3af;
  }
  
  .context-section-inner {
    border-top-color: #333;
  }
  
  .context-section-inner .address-item-vertical,
  .context-section-inner .day-column {
    background: #1a1a1a;
  }
  
  .context-section-inner .address-item-vertical:hover,
  .context-section-inner .day-column.active {
    background: #262626;
  }
  
  .context-section-inner .selected-platform-card {
    background: #1a1a1a;
  }
}

/* ============================================
   VENDING DEVICE CAROUSEL
   ============================================ */

.context-device-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
}

.context-device-cards {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 8px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.context-device-cards::-webkit-scrollbar {
  display: none;
}

.context-device-card {
  flex: 0 0 calc(100% - 16px);
  scroll-snap-align: center;
  background: #5c5c5c;
  border-radius: 12px;
  padding: 12px;
  border: 3px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.context-device-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-color: rgba(75, 196, 81, 0.3);
}

/* Selected state - prominent green outline with glow */
.context-device-card.selected {
  border-color: #4BC451 !important;
  background: #4a4a4a;
  box-shadow: 0 0 0 3px rgba(75, 196, 81, 0.3), 
              0 0 20px rgba(75, 196, 81, 0.4),
              0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.context-device-badge {
  position: absolute;
  top: -8px;
  right: 8px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.context-device-image {
  width: 100%;
  height: 280px;  /* Much taller for device visibility */
  border-radius: 8px;
  overflow: hidden;
  background: #4a4a4a;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.context-device-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Zoom button in top-right corner of device image */
.context-device-zoom-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #4BC451;
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
  z-index: 5;
}

.context-device-zoom-btn svg {
  display: block;
}

.context-device-zoom-btn:hover {
  transform: scale(1.1);
  background: #3da844;
  box-shadow: 0 4px 16px rgba(75, 196, 81, 0.5);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Fullscreen zoom modal */
.context-device-zoom-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.context-device-zoom-modal.visible {
  opacity: 1;
}

.zoom-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
}

.zoom-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.context-device-zoom-modal.visible .zoom-modal-content {
  transform: scale(1);
}

.zoom-modal-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.zoom-modal-close {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: white;
  border: none;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
  z-index: 10;
}

.zoom-modal-close svg {
  display: block;
}

.zoom-modal-close:hover {
  background: #f0f0f0;
  transform: scale(1.1);
  color: #e53e3e;
}

.zoom-modal-title {
  color: white;
  font-size: 18px;
  font-weight: 600;
  margin-top: 16px;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.context-device-info {
  padding: 0 4px;
}

.context-device-name {
  font-size: 16px;
  font-weight: 700;
  color: #4BC451;
  margin: 0 0 4px 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.context-device-desc {
  font-size: 11px;
  color: #d1d5db;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.context-device-status {
  display: flex;
  justify-content: flex-start;
}

.context-device-status .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
}

.context-device-status .status-badge.completed {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.context-device-select {
  position: absolute;
  top: 12px;
  left: 12px;
}

.context-radio {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.context-radio input[type="radio"] {
  display: none;
}

.context-radio .radio-checkmark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.context-radio input[type="radio"]:checked + .radio-checkmark {
  border-color: #4BC451;
  background: #4BC451;
}

.context-radio input[type="radio"]:checked + .radio-checkmark::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: bold;
}

/* Checkbox for multi-select devices */
.context-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.context-checkbox input[type="checkbox"] {
  display: none;
}

.context-checkbox .checkbox-checkmark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.context-checkbox input[type="checkbox"]:checked + .checkbox-checkmark {
  border-color: #4BC451;
  background: #4BC451;
}

.context-checkbox input[type="checkbox"]:checked + .checkbox-checkmark::after {
  content: '✓';
  color: white;
  font-size: 14px;
  font-weight: bold;
}

/* Owned device badge */
.context-device-owned-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 5;
}

/* Device card owned state */
.context-device-card.owned {
  border: 2px solid rgba(75, 196, 81, 0.3);
}

/* Device price display */
.context-device-price {
  margin-top: 6px;
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
}

.context-device-price .price-label {
  color: #aaa;
  font-size: 12px;
}

.context-device-price .price-value {
  color: #4BC451;
  font-weight: 600;
  font-size: 14px;
}

/* Buy Device Button - same as device-section */
.context-device-actions {
  margin-top: 10px;
  width: 100%;
}

.context-device-buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #4BC451;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  width: 100%;
}

.context-device-buy-btn:hover {
  background: #3da844;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(75, 196, 81, 0.3);
}

/* Device carousel navigation */
.context-device-nav {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #4BC451;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.context-device-nav:hover {
  background: #3DAF42;
  transform: scale(1.1);
}

/* Device carousel indicators */
.context-device-indicators {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px 0;
}

.context-device-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.context-device-indicator:hover {
  background: #9ca3af;
}

.context-device-indicator.active {
  background: #4BC451;
  width: 24px;
  border-radius: 4px;
}

/* Get device button */
.context-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  margin-top: 10px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s ease;
}

.context-add-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Ridy Device icon - white bg with green glow (ROUNDED SQUARE) */
.context-section-icon.ridy-device-icon {
  background: white;
  padding: 3px;
  border-radius: 10px; /* Rounded square */
  border: 1px solid rgba(75, 196, 81, 0.3);
  box-shadow: 0 0 12px rgba(75, 196, 81, 0.5);
  animation: ridyDeviceGlow 3s ease-in-out infinite;
}

@keyframes ridyDeviceGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(75, 196, 81, 0.3); }
  50% { box-shadow: 0 0 16px rgba(75, 196, 81, 0.5); }
}

.context-section-icon.ridy-device-icon img {
  width: 28px;
  height: 28px;
  border-radius: 8px; /* Rounded square */
  object-fit: cover;
}

/* Ridy Brand Icon (R in Josefin Sans with gradient) - used for RidyFlow AI */
.context-section-icon.ridy-brand-icon {
  background: linear-gradient(135deg, #4BC451, #00b87a, #00a8cc);
  background-size: 200% 200%;
  color: white;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: 22px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  border-radius: 50%; /* Perfect circle */
  box-shadow: 0 0 12px rgba(75, 196, 81, 0.5);
  animation: gradient-animation 5s ease infinite, ridyIconGlow 3s ease-in-out infinite;
}

@keyframes ridyIconGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(75, 196, 81, 0.4); }
  50% { box-shadow: 0 0 16px rgba(75, 196, 81, 0.6); }
}

@keyframes gradient-animation {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* AI Section styling */
.context-ai-section {
  margin-top: 8px;
}

.context-ai-settings {
  padding: 12px;
  background: linear-gradient(135deg, rgba(75, 196, 81, 0.05) 0%, rgba(0, 168, 204, 0.05) 100%);
  border-radius: 8px;
}

.context-ai-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.context-ai-option:last-of-type {
  border-bottom: none;
}

.context-ai-option-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.context-ai-option-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}

.context-ai-option-desc {
  font-size: 11px;
  color: #6b7280;
}

/* Green/teal toggle variant for RidyFlow branding */
.context-toggle-indigo .context-toggle-slider {
  background: #d1d5db;
}

.context-toggle-indigo input:checked + .context-toggle-slider {
  background: #10b981;
}

/* AI Models Section */
.context-ai-models-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(75, 196, 81, 0.15);
  transition: opacity 0.3s ease;
}

.context-ai-models-section.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.context-ai-models-section.disabled::before {
  content: 'Turn off Auto Mode to select custom models';
  display: block;
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
  padding: 8px;
  background: #f9fafb;
  border-radius: 6px;
  margin-bottom: 10px;
}

.context-ai-models-title {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  display: block;
  margin-bottom: 8px;
}

.context-ai-models-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.context-ai-model-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.context-ai-model-item:hover {
  border-color: #10b981;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.1);
}

.context-ai-model-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.context-ai-model-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.context-ai-model-icon svg {
  width: 18px;
  height: 18px;
}

.context-ai-model-name {
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
}

.context-ai-model-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
}

/* Small toggle variant */
.context-toggle-sm {
  width: 36px;
  height: 20px;
}

.context-toggle-sm .context-toggle-slider:before {
  width: 16px;
  height: 16px;
  left: 2px;
  bottom: 2px;
}

.context-toggle-sm input:checked + .context-toggle-slider:before {
  transform: translateX(16px);
}

/* Mobile responsive for device carousel */
@media (max-width: 480px) {
  .context-device-card {
    flex: 0 0 calc(100% - 8px);
    padding: 10px;
  }
  
  .context-device-image {
    height: 180px;  /* Taller on mobile too for better visibility */
  }
  
  .context-device-name {
    font-size: 14px;
  }
  
  .context-device-desc {
    font-size: 10px;
  }
  
  .context-device-nav {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
}
