/* =========================================
   1. INPUT FIELDS (Fixed Alignment & Keyboard Prevent) - English LTR
   ========================================= */

/* Main Trigger Container */
.input-field.clickable-trigger {
  position: relative;
  cursor: pointer;
  z-index: 1;
  transition: all 0.2s ease;
  direction: ltr;
  text-align: left;
}

/* === KEYBOARD PREVENT LOGIC === */
.clickable-trigger input {
  pointer-events: none !important;
  caret-color: transparent;
  user-select: none;
  background-color: transparent;
}

/* Visual Style & Padding Fix */
.clickable-trigger input {
  padding-right: 45px !important;
  padding-left: 15px !important;
  text-align: left; 
}

/* Arrow Icon Logic (English Style – Right Side) */
.custom-arrow {
  position: absolute;
  right: 20px;
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  pointer-events: none;
  font-size: 1rem;
  z-index: 5;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease;
}

/* === ACTIVE STATE ANIMATION === */
.clickable-trigger.active-state .custom-arrow {
  transform: translateY(-50%) rotate(180deg);
  color: #ee9f0d;
}

.clickable-trigger.active-state input {
  border-color: #ee9f0d;
}

/* =========================================
   2. ULTRA CLEAN MINIMAL MODAL (English LTR)
   ========================================= */

/* Overlay */
.clean-modal-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  direction: ltr;
}

.clean-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Modal Box */
.clean-modal-box {
  background: #ffffff;
  width: 90%;
  max-width: 380px;
  border-radius: 24px;
  padding: 30px 25px 25px 25px; 
  position: relative;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
  display: flex;
  flex-direction: column;
}

.clean-modal-overlay.active .clean-modal-box {
  transform: translateY(0);
  opacity: 1;
}

/* Close Button */
.clean-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  left: auto;
  width: 32px;
  height: 32px;
  background: #f5f5f5;
  color: #666;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-size: 16px;
  z-index: 10;
}

.clean-close-btn:hover {
  background: #fee2e2;
  color: #ef4444;
  transform: rotate(90deg);
}

/* Header */
.clean-modal-header {
  text-align: center;
  margin-bottom: 20px;
  margin-top: 10px; 
  padding-bottom: 15px;
  border-bottom: 1px solid #f3f4f6; 
}

.clean-modal-header h3 {
  font-family: "Alexandria", serif;
  color: #ee9f0d;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 6px 0;
}

.modal-subtitle {
  font-family: "Rubik", serif;
  color: #6b7280;
  font-size: 0.9rem;
  margin: 0;
}

/* Option List */
.clean-modal-body {
  overflow-y: auto;
  max-height: 55vh;
  padding: 5px 2px;
  scrollbar-width: none;
}
.clean-modal-body::-webkit-scrollbar {
  display: none;
}

.clean-options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Option Items */
.clean-option-item {
  position: relative;
  background: #f9fafb;
  padding: 16px 20px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between; 
  border: 2px solid transparent;
  direction: ltr;
}

.clean-option-item:hover {
  background: #ffffff;
  border-color: rgba(238, 159, 13, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.clean-option-item.selected {
  background: #ffffff;
  border-color: #ee9f0d;
  box-shadow: 0 4px 15px -3px rgba(238, 159, 13, 0.2);
}

.option-label {
  font-family: "Rubik", serif;
  font-weight: 500;
  font-size: 1.05rem;
  color: #374151;
  text-align: left;
}

.clean-option-item.selected .option-label {
  color: #ee9f0d;
  font-weight: 600;
}

/* Radio Button */
.custom-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  position: relative;
}

.custom-radio::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 10px;
  height: 10px;
  background: #ee9f0d;
  border-radius: 50%;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.clean-option-item.selected .custom-radio {
  border-color: #ee9f0d;
}

.clean-option-item.selected .custom-radio::after {
  transform: translate(-50%, -50%) scale(1);
}

/* =========================================
   SCROLL LOCK & MOBILE RESPONSIVE
   ========================================= */
body.no-scroll {
  overflow: hidden !important; 
  height: 100vh; 
  touch-action: none; 
  padding-right: 0px; 
}

@media (max-width: 600px) {
    .clean-modal-overlay {
        align-items: flex-end; 
        padding: 0;
        backdrop-filter: blur(8px);
    }

    .clean-modal-box {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 24px 24px 0 0 !important;
        padding: 30px 20px 40px 20px !important; 
        transform: translateY(100%); 
        opacity: 1; 
        transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    .clean-modal-overlay.active .clean-modal-box {
        transform: translateY(0);
    }

    .clean-close-btn {
        top: 20px;
        right: 20px;
        left: auto;
    }

    .clean-modal-header h3 {
        font-size: 1.25rem !important;
        margin-bottom: 4px !important;
    }
    
    .clean-option-item {
        padding: 14px 16px !important;
        border-radius: 12px !important;
    }
}

/* Buttons (Back & Close) */
.modal-nav-buttons {
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  display: flex;
  flex-direction: row; 
  justify-content: space-between;
  pointer-events: none; 
}

.clean-close-btn, .clean-back-btn {
  width: 36px;
  height: 36px;
  background: #f3f4f6;
  color: #4b5563;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 16px;
  pointer-events: auto;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

#selectionModal .clean-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  left: auto;
}

.clean-close-btn:hover {
  background: #fee2e2;
  color: #ef4444;
  transform: rotate(90deg);
}

.clean-back-btn:hover {
  background: #e0f2fe;
  color: #0284c7;
  transform: translateX(-3px);
}

/* Search & Action Row */
.search-action-row {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  align-items: center;
  direction: ltr;
}

.search-input-box {
  position: relative;
  flex: 1; 
}

.search-input-box input {
  width: 100%;
  height: 48px;
  padding: 0 40px 0 40px; 
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-family: "Rubik", sans-serif;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  outline: none;
  text-align: left;
}

.search-input-box input:focus {
  background: #fff;
  border-color: #ee9f0d;
  box-shadow: 0 4px 15px rgba(238, 159, 13, 0.1);
}

.search-input-box .search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
}

.search-input-box .clear-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  color: #d1d5db;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  font-size: 1.1rem;
}

/* Mini Add Button */
.mini-add-btn {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #FFB74D 0%, #FF9800 100%); 
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.25);
}
.mini-add-btn:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}
.mini-add-btn i { font-size: 1.2rem; }

/* List Headers & Items */
.list-header {
  display: flex;
  justify-content: space-between;
  padding: 0 16px 10px 16px;
  border-bottom: 2px solid #f3f4f6;
  margin-bottom: 8px;
  direction: ltr;
}

.list-header span {
  font-family: "Rubik", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: #9ca3af;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.option-name {
  font-family: "Rubik", sans-serif;
  font-weight: 500;
  color: #374151;
  font-size: 0.95rem;
  text-align: left;
}

.option-price {
  font-family: "Rubik", sans-serif;
  font-weight: 600;
  color: #d97706; 
  font-size: 1rem;
}

/* Add Item Form Area */
.add-item-body {
  display: flex;
  flex-direction: column;
  padding-top: 10px;
}
#addItemModal .input-field { width: 100%; }

/* =========================================
   ✅ FIX FOR ADD ITEM BUTTON (LAYOUT ONLY)
   ========================================= */
/* এখানে কোনো কালার/শাইন নেই। সব স্টাইল index.css এর .submit থেকে আসবে। */
#saveNewItemBtn {
    margin: 25px 0 10px 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    /* অন্য কোনো প্রপার্টি এখানে দেবেন না, যাতে মেইন স্টাইল কাজ করে */
}

/* =========================================
   FEEDBACK MESSAGES & LOADER
   ========================================= */
#addItemFeedback {
  margin-top: 15px;
  padding: 15px;
  border-radius: 12px;
  text-align: center;
  font-size: 1rem;
  display: none;
  animation: slideInFeedback 0.3s ease forwards;
  background: #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  font-family: "Rubik", serif;
}

@keyframes slideInFeedback {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

#addItemFeedback.success {
  background-color: rgba(40, 167, 69, 0.1);
  color: #28a745; 
  border: 1px solid #28a745;
}

#addItemFeedback.error {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545; 
  border: 1px solid #dc3545;
}

.no-results-state {
  text-align: center;
  padding: 40px 20px;
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.empty-icon-wrapper {
  width: 70px;
  height: 70px;
  background: #fff8e1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px auto;
}
.empty-icon-wrapper i { font-size: 2rem; color: #ff9800; }

.loading-state-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    text-align: center;
    animation: fadeIn 0.3s ease-out;
}

.bold-spinner {
    width: 40px; 
    height: 40px;
    border: 4px solid rgba(174, 154, 39, 0.15); 
    border-top: 4px solid #f0c13f; 
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 15px; 
}

.loading-title {
    font-family: 'Rubik', sans-serif;
    font-size: 0.95rem; 
    font-weight: 500;   
    color: #333;
    margin-bottom: 5px;
}

.loading-subtitle {
    font-family: 'Alexandria', sans-serif;
    font-size: 0.75rem; 
    color: #888;
    letter-spacing: 0.3px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}