/* ============================================
   ENHANCED MOBILE RESPONSIVE - style-cek.css
   Cleaned and Optimized Version
   ============================================ */

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background: #f5f5f5;
  color: #222;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  padding-top: 100px;
  padding-bottom: 60px;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 5%;
  padding-right: 5%;
  min-height: calc(100vh - 200px);
}

/* ============================================
   HEADER SECTION
   ============================================ */
.header-section {
  text-align: center;
  margin-bottom: 50px;
}

.header-section h1 {
  font-size: 2.5em;
  color: #053f5c;
  margin-bottom: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.header-section p {
  font-size: 1.1em;
  color: #64748b;
  line-height: 1.6;
}

/* ============================================
   CONTAINER
   ============================================ */
.container {
  max-width: 900px;
  margin: 0 auto;
}

/* ============================================
   CARD STYLES
   ============================================ */
.card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 30px;
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-title,
.search-section-title {
  font-size: 1.5em;
  font-weight: 600;
  color: #2e2e2e;
  text-align: center;
  margin-bottom: 30px;
  line-height: 1.3;
}

/* ============================================
   CATEGORY SELECTOR
   ============================================ */
.category-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.category-btn {
  padding: 20px 24px;
  font-size: 1.05em;
  font-weight: 600;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 60px;
}

.category-btn:hover {
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.category-btn.active.rekomendasi {
  background: #10b981;
  color: white;
  border-color: #10b981;
}

.category-btn.active.boikot {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

.category-btn .icon {
  font-size: 1.3em;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */
.action-buttons-section {
  margin-bottom: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 24px;
  font-size: 1.05em;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  border: none;
  min-height: 60px;
  text-align: center;
}

.jihad-btn {
  background: #f7ad19;
  color: white;
}

.jihad-btn:hover {
  background: #e49f16;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(247, 173, 25, 0.3);
}

.jihad-btn:active {
  background: #d89314;
  transform: translateY(-1px);
}

.pengajuan-btn {
  background: #0284c7;
  color: white;
}

.pengajuan-btn:hover {
  background: #0369a1;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(2, 132, 199, 0.3);
}

.pengajuan-btn:active {
  background: #075985;
  transform: translateY(-1px);
}

/* ============================================
   SEARCH BOX
   ============================================ */
.search-box {
  position: relative;
  margin-bottom: 24px;
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  pointer-events: none;
}

.search-icon img {
  width: 20px;
  height: 20px;
  opacity: 0.5;
}

.search-input {
  width: 100%;
  padding: 18px 55px 18px 55px;
  font-size: 1em;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  outline: none;
  transition: all 0.3s ease;
  color: #053f5c;
  background: white;
}

.search-input::placeholder {
  color: #94a3b8;
}

.search-input:focus {
  border-color: #053f5c;
  box-shadow: 0 0 0 3px rgba(5, 63, 92, 0.1);
}

.clear-search-btn {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: #e2e8f0;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #64748b;
  transition: all 0.3s ease;
  z-index: 2;
}

.clear-search-btn:hover {
  background: #cbd5e1;
  color: #334155;
}

.clear-search-btn:active {
  background: #94a3b8;
}

.search-btn {
  width: 100%;
  padding: 18px;
  font-size: 1.05em;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  background: #053f5c;
  min-height: 56px;
}

.search-btn:hover {
  transform: translateY(-2px);
  background: #042d40;
  box-shadow: 0 6px 12px rgba(5, 63, 92, 0.3);
}

.search-btn:active {
  transform: translateY(0);
  background: #031f2d;
}

.search-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ============================================
   RESULTS CONTAINER
   ============================================ */
.results-container {
  margin-top: 30px;
}

.no-results {
  text-align: center;
  padding: 60px 24px;
  color: #94a3b8;
  font-size: 1em;
  background: #f8fafc;
  border-radius: 12px;
  border: 2px dashed #e2e8f0;
}

/* ============================================
   PRODUCT CARDS
   ============================================ */
.product-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
}

.product-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.product-card.rekomendasi {
  border-left: 4px solid #10b981;
}

.product-card.boikot {
  border-left: 4px solid #ef4444;
}

.product-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 16px;
}

.product-name {
  font-size: 1.2em;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
  line-height: 1.3;
  word-break: break-word;
}

.product-code {
  font-size: 0.85em;
  color: #64748b;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
}

.product-badge {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  flex-shrink: 0;
}

.product-badge.rekomendasi {
  background: #10b981;
}

.product-badge.boikot {
  background: #ef4444;
}

.product-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.info-item {
  display: flex;
  flex-direction: column;
}

.info-label {
  font-size: 0.85em;
  color: #64748b;
  margin-bottom: 4px;
  font-weight: 500;
}

.info-value {
  font-size: 0.95em;
  color: #1e293b;
  font-weight: 500;
  word-break: break-word;
}

.info-value a {
  color: #0284c7;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.info-value a:hover {
  color: #0369a1;
}

.info-date {
  color: #64748b;
  font-size: 0.9em;
  font-weight: 400;
}

/* ============================================
   PRODUCT ACTIONS - FIXED: Full Color Button
   ============================================ */
.product-actions {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-edit-product {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.9em;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: #0284c7;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-edit-product:hover {
  background: #0369a1;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(2, 132, 199, 0.3);
}

.btn-edit-product:active {
  background: #075985;
  transform: translateY(0);
}

/* ============================================
   SWITCH & ADD PRODUCT SECTIONS
   ============================================ */
.switch-category-section {
  text-align: center;
  padding: 30px 20px;
  margin: 20px 0;
}

.btn-switch-category {
  display: inline-block;
  padding: 12px 24px;
  font-size: 1em;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  background: #64748b;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-switch-category:hover {
  background: #475569;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(100, 116, 139, 0.3);
}

.btn-switch-category:active {
  background: #334155;
  transform: translateY(0);
}

.add-product-section {
  text-align: center;
  padding: 40px 20px;
  margin: 30px 0;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.btn-add-product {
  display: inline-block;
  padding: 12px 28px;
  font-size: 1em;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: #10b981;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-add-product:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-add-product:active {
  background: #047857;
  transform: translateY(0);
}

.add-product-hint {
  margin-top: 16px;
  font-size: 0.9em;
  color: #64748b;
}

/* ============================================
   MODAL STYLES
   ============================================ */
.edit-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.edit-modal {
  background: white;
  border-radius: 16px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

.edit-modal-header {
  padding: 24px 30px;
  border-bottom: 2px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
}

.edit-modal-header h3 {
  font-size: 1.5em;
  color: #053f5c;
  margin: 0;
}

.close-modal-btn {
  background: none;
  border: none;
  font-size: 28px;
  color: #64748b;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.close-modal-btn:hover {
  background: #f1f5f9;
  color: #ef4444;
}

.edit-modal-body {
  padding: 30px;
}

/* ============================================
   FORM STYLES
   ============================================ */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #334155;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #053f5c;
  outline: none;
  box-shadow: 0 0 0 3px rgba(5, 63, 92, 0.1);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-group small {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
}

.required {
  color: #ef4444;
  margin-left: 2px;
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
}

.field-hint strong {
  color: #334155;
  font-weight: 600;
}

.field-hint a {
  color: #0284c7;
  text-decoration: underline;
}

/* ============================================
   FORM ACTIONS
   ============================================ */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.btn-cancel {
  flex: 1;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  background: #e2e8f0;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-cancel:hover {
  background: #cbd5e1;
  color: #475569;
}

.btn-cancel:active {
  background: #94a3b8;
}

.btn-submit {
  flex: 1.5;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: #10b981;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-submit:not(:disabled):hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.btn-submit:not(:disabled):active {
  background: #047857;
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   ALERT BOXES
   ============================================ */
.change-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  margin-bottom: 20px;
}

.change-alert-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.change-alert-content {
  flex: 1;
}

.change-alert-content strong {
  display: block;
  color: #92400e;
  font-size: 0.95em;
  margin-bottom: 4px;
}

.change-alert-content p {
  color: #78350f;
  font-size: 0.9em;
  margin: 0;
  line-height: 1.5;
}

.changes-summary {
  background: #ecfdf5;
  border: 1px solid #10b981;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.changes-summary-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #065f46;
  font-size: 0.95em;
  font-weight: 600;
}

.changes-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #10b981;
  color: white;
  border-radius: 50%;
  font-size: 14px;
}

#changesList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#changesList li {
  background: white;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  border: 1px solid #d1fae5;
}

#changesList li:last-child {
  margin-bottom: 0;
}

#changesList strong {
  display: block;
  color: #064e3b;
  font-size: 0.9em;
  margin-bottom: 6px;
}

.change-comparison {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.85em;
}

.old-value {
  color: #dc2626;
  text-decoration: line-through;
  background: #fee2e2;
  padding: 2px 6px;
  border-radius: 4px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arrow {
  color: #64748b;
  font-size: 0.9em;
}

.new-value {
  color: #059669;
  background: #d1fae5;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
   SUCCESS/ERROR MODALS
   ============================================ */
.success-modal-overlay,
.error-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.success-modal,
.error-modal {
  background: white;
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  animation: slideUp 0.3s ease;
}

.success-icon,
.error-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.success-icon {
  background: #d1fae5;
  color: #10b981;
}

.error-icon {
  background: #fee2e2;
  color: #ef4444;
}

.success-modal h3,
.error-modal h3 {
  font-size: 1.3em;
  margin-bottom: 10px;
  color: #1e293b;
}

.success-modal p,
.error-modal p {
  color: #64748b;
  font-size: 0.95em;
  line-height: 1.6;
  margin-bottom: 20px;
}

.btn-ok {
  padding: 10px 32px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: #053f5c;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-ok:hover {
  background: #042d40;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(5, 63, 92, 0.3);
}

.btn-ok:active {
  background: #031f2d;
  transform: translateY(0);
}

/* ============================================
   AI MESSAGE BOX
   ============================================ */
.ai-message-box {
  display: flex;
  gap: 16px;
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 24px;
  animation: slideDown 0.4s ease;
  border-left: 4px solid;
}

.ai-message-box.success {
  background: #ecfdf5;
  border-color: #10b981;
}

.ai-message-box.warning {
  background: #fef3c7;
  border-color: #f7ad19;
}

.ai-message-box.info {
  background: #e0f2fe;
  border-color: #0284c7;
}

.ai-message-box.error {
  background: #fee2e2;
  border-color: #ef4444;
}

.ai-content {
  flex: 1;
}

.ai-main-message {
  font-size: 1em;
  line-height: 1.6;
  margin-bottom: 12px;
  color: #334155;
}

.ai-suggestion {
  font-size: 0.95em;
  line-height: 1.6;
  padding: 12px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  margin-top: 12px;
  color: #475569;
  font-style: italic;
}

/* ============================================
   LOADING STATES
   ============================================ */
.ai-loading {
  text-align: center;
  padding: 60px 24px;
  animation: fadeIn 0.3s ease;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e2e8f0;
  border-top-color: #053f5c;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

.ai-loading p {
  color: #64748b;
  font-size: 1em;
  margin-top: 15px;
}

/* ============================================
   CHARACTER COUNTER
   ============================================ */
.char-counter {
  text-align: right;
  font-size: 12px;
  color: #64748b;
  margin-top: 5px;
  font-weight: 500;
  transition: color 0.3s ease;
}

.char-counter.warning {
  color: #f97316;
  font-weight: 600;
}

.char-counter.error {
  color: #ef4444;
  font-weight: 600;
  animation: pulse 1.5s ease-in-out infinite;
}
/* ============================================
   Ayat
   ============================================ */
.content-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 30px;
  line-height: 1.8;
}

.content-card h2 {
  font-size: 1.6em;
  color: #053f5c;
  margin-bottom: 20px;
  font-weight: 600;
  border-left: 4px solid #f7ad19;
  padding-left: 15px;
  transition: all 0.3s ease;
}

.content-card p {
  color: #334155;
  margin-bottom: 20px;
  text-align: justify;
  font-size: 1.05em;
}

.warning-box {
  background: #fef3c7;
  border: 2px solid #f7ad19;
  border-radius: 12px;
  padding: 25px;
  margin: 30px 0;
}

.warning-box h3 {
  color: #92400e;
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.warning-box p {
  color: #78350f;
  margin-bottom: 10px;
}

.ayat-box {
  background: linear-gradient(135deg, #053f5c 0%, #0a5a7d 100%);
  color: white;
  padding: 35px;
  border-radius: 12px;
  text-align: center;
  margin: 30px 0;
  box-shadow: 0 4px 12px rgba(5, 63, 92, 0.2);
}

.ayat-arabic {
  font-size: 1.8em;
  line-height: 2;
  margin-bottom: 20px;
  font-weight: 500;
  direction: rtl;
}

.ayat-translation {
  font-size: 1.05em;
  line-height: 1.8;
  opacity: 0.95;
  font-style: italic;
}

.ayat-reference {
  margin-top: 15px;
  font-weight: 600;
  font-size: 1.1em;
  color: #f7ad19;
}

/* ============================================
   ERROR MESSAGE
   ============================================ */
.error-message {
  display: none;
  color: #ef4444;
  font-size: 12px;
  margin-top: 5px;
  padding: 5px 10px;
  background: #fee2e2;
  border-left: 3px solid #ef4444;
  border-radius: 4px;
  animation: slideDown 0.3s ease;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

/* ============================================
   RESPONSIVE DESIGN - TABLET (768px)
   ============================================ */
@media (max-width: 768px) {
  .main-content {
    padding-top: 90px;
    padding-bottom: 50px;
    padding-left: 4%;
    padding-right: 4%;
  }

  .header-section {
    margin-bottom: 40px;
  }

  .header-section h1 {
    font-size: 2em;
    margin-bottom: 10px;
  }

  .header-section p {
    font-size: 1em;
  }

  .card {
    padding: 30px 24px;
    margin-bottom: 24px;
  }

  .card-title,
  .search-section-title {
    font-size: 1.35em;
    margin-bottom: 24px;
  }

  .category-selector {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .category-btn {
    padding: 18px 20px;
    font-size: 1em;
    min-height: 56px;
  }

  .action-buttons-section {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
  }

  .action-btn {
    padding: 18px 20px;
    font-size: 1em;
    min-height: 56px;
  }

  .search-input {
    padding: 16px 50px 16px 50px;
    font-size: 0.95em;
  }

  .search-icon {
    left: 16px;
  }

  .clear-search-btn {
    right: 16px;
  }

  .search-btn {
    padding: 16px;
    font-size: 1em;
    min-height: 52px;
  }

  .product-card {
    padding: 20px;
    margin-bottom: 14px;
  }

  .product-header {
    flex-direction: column;
    gap: 12px;
  }

  .product-name {
    font-size: 1.1em;
  }

  .product-badge {
    align-self: flex-start;
  }

  .product-info {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .product-actions {
    flex-direction: column;
    gap: 10px;
  }

  .btn-edit-product {
    width: 100%;
    justify-content: center;
  }

  .edit-modal {
    max-width: 95%;
    margin: 10px;
  }

  .edit-modal-header {
    padding: 20px 24px;
  }

  .edit-modal-header h3 {
    font-size: 1.3em;
  }

  .edit-modal-body {
    padding: 24px 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form-group {
    margin-bottom: 18px;
  }

  .change-comparison {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .old-value,
  .new-value {
    max-width: 100%;
  }

  .arrow {
    transform: rotate(90deg);
  }

  .content-card {
    padding: 25px 20px;
  }

  .content-card h2 {
    font-size: 1.4em;
  }

  .ayat-arabic {
    font-size: 1.5em;
  }

  .ayat-translation {
    font-size: 1em;
  }
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE (480px)
   ============================================ */
@media (max-width: 480px) {
  .main-content {
    padding-top: 85px;
    padding-bottom: 40px;
    padding-left: 3%;
    padding-right: 3%;
  }

  .header-section {
    margin-bottom: 30px;
  }

  .header-section h1 {
    font-size: 1.65em;
    margin-bottom: 8px;
  }

  .header-section p {
    font-size: 0.95em;
  }

  .card {
    padding: 24px 18px;
    margin-bottom: 20px;
    border-radius: 12px;
  }

  .card-title,
  .search-section-title {
    font-size: 1.2em;
    margin-bottom: 20px;
  }

  .category-selector {
    gap: 12px;
  }

  .category-btn {
    padding: 16px 18px;
    font-size: 0.95em;
    min-height: 52px;
    border-radius: 10px;
  }

  .category-btn .icon {
    font-size: 1.2em;
  }

  .action-buttons-section {
    gap: 12px;
    margin-bottom: 20px;
  }

  .action-btn {
    padding: 16px 18px;
    font-size: 0.95em;
    min-height: 52px;
    border-radius: 10px;
  }

  .search-box {
    margin-bottom: 20px;
  }

  .search-input {
    padding: 14px 45px 14px 45px;
    font-size: 0.9em;
    border-radius: 10px;
  }

  .search-icon {
    left: 14px;
  }

  .search-icon img {
    width: 18px;
    height: 18px;
  }

  .clear-search-btn {
    right: 14px;
    width: 26px;
    height: 26px;
    font-size: 14px;
  }

  .search-btn {
    padding: 14px;
    font-size: 0.95em;
    min-height: 48px;
    border-radius: 10px;
  }

  .results-container {
    margin-top: 24px;
  }

  .no-results {
    padding: 50px 20px;
    font-size: 0.95em;
  }

  .product-card {
    padding: 18px;
    margin-bottom: 12px;
    border-radius: 10px;
  }

  .product-header {
    gap: 10px;
  }

  .product-name {
    font-size: 1.05em;
    margin-bottom: 6px;
  }

  .product-code {
    font-size: 0.8em;
    padding: 3px 8px;
  }

  .product-badge {
    padding: 6px 14px;
    font-size: 0.8em;
    border-radius: 16px;
  }

  .product-info {
    gap: 10px;
    margin-top: 14px;
  }

  .info-label {
    font-size: 0.8em;
    margin-bottom: 3px;
  }

  .info-value {
    font-size: 0.9em;
  }

  .product-actions {
    margin-top: 16px;
    padding-top: 16px;
  }

  .btn-edit-product {
    padding: 10px 16px;
    font-size: 0.85em;
  }

  .btn-switch-category,
  .btn-add-product {
    padding: 11px 18px;
    font-size: 0.95em;
  }

  .add-product-section {
    padding: 30px 16px;
  }

  .edit-modal {
    max-width: 96%;
    margin: 8px;
    border-radius: 12px;
  }

  .edit-modal-header {
    padding: 18px 20px;
  }

  .edit-modal-header h3 {
    font-size: 1.15em;
  }

  .close-modal-btn {
    width: 36px;
    height: 36px;
    font-size: 24px;
  }

  .edit-modal-body {
    padding: 20px 18px;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .form-group label {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 11px 12px;
    font-size: 13px;
    border-radius: 8px;
  }

  .form-group textarea {
    min-height: 90px;
  }

  .form-group small {
    font-size: 11px;
    margin-top: 4px;
  }

  .form-actions {
    gap: 10px;
    margin-top: 20px;
    padding-top: 18px;
    flex-direction: column-reverse;
  }

  .btn-cancel,
  .btn-submit {
    width: 100%;
    padding: 12px 20px;
    font-size: 13px;
  }

  .change-alert {
    flex-direction: column;
    padding: 14px;
  }

  .change-alert-icon {
    font-size: 18px;
  }

  .changes-summary {
    padding: 14px;
  }

  #changesList li {
    padding: 10px;
  }

  .success-modal,
  .error-modal {
    padding: 24px 18px;
  }

  .success-icon,
  .error-icon {
    width: 50px;
    height: 50px;
    font-size: 28px;
  }

  .ai-loading {
    padding: 50px 20px;
  }

  .loading-spinner {
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
  }

  .ai-loading p {
    font-size: 0.95em;
  }

  .ai-message-box {
    padding: 18px;
    margin-bottom: 20px;
    gap: 12px;
  }

  .ai-main-message {
    font-size: 0.95em;
  }

  .ai-suggestion {
    font-size: 0.9em;
    padding: 10px;
  }

  .content-card {
    padding: 20px 16px;
  }

  .content-card h2 {
    font-size: 1.2em;
  }

  .ayat-arabic {
    font-size: 1.3em;
  }

  .quote-box,
  .warning-box,
  .ayat-box {
    padding: 20px;
  }
}

/* ============================================
   EXTRA SMALL MOBILE (360px)
   ============================================ */
@media (max-width: 360px) {
  .main-content {
    padding-top: 80px;
    padding-left: 2%;
    padding-right: 2%;
  }

  .header-section h1 {
    font-size: 1.5em;
  }

  .card {
    padding: 20px 16px;
  }

  .card-title,
  .search-section-title {
    font-size: 1.1em;
  }

  .category-btn,
  .action-btn {
    padding: 14px 16px;
    font-size: 0.9em;
    min-height: 48px;
  }

  .search-input {
    padding: 12px 42px 12px 42px;
    font-size: 0.85em;
  }

  .search-btn {
    padding: 12px;
    font-size: 0.9em;
    min-height: 44px;
  }

  .product-card {
    padding: 16px;
  }

  .product-name {
    font-size: 1em;
  }

  .edit-modal-body {
    padding: 18px 16px;
  }
}

/* ============================================
   TOUCH OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
  a,
  button,
  .category-btn,
  .search-btn,
  .action-btn,
  .btn-edit-product,
  .clear-search-btn {
    min-height: 44px;
    min-width: 44px;
  }

  .category-btn:hover,
  .action-btn:hover,
  .search-btn:hover,
  .btn-edit-product:hover {
    transform: none;
  }

  .category-btn:active,
  .action-btn:active,
  .search-btn:active,
  .btn-edit-product:active {
    opacity: 0.8;
    transform: scale(0.98);
  }
}

/* ============================================
   PREVENT MOBILE ZOOM ON INPUT FOCUS
   ============================================ */
@media screen and (max-width: 768px) {
  input,
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
*:focus-visible {
  outline: 2px solid #053f5c;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   SMOOTH SCROLLING
   ============================================ */
html {
  scroll-behavior: smooth;
}

/* ============================================
   PREVENT LAYOUT SHIFT
   ============================================ */
html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

* {
  -webkit-tap-highlight-color: transparent;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

/* ============================================
   IMAGE OPTIMIZATION
   ============================================ */
img {
  max-width: 100%;
  height: auto;
  transition: opacity 0.4s ease;
}

img.loaded {
  opacity: 1;
}

/* ============================================
   TEXT OVERFLOW HANDLING
   ============================================ */
.product-name,
.info-value,
.ai-main-message {
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

/* ============================================
   LANDSCAPE MOBILE OPTIMIZATIONS
   ============================================ */
@media (max-width: 768px) and (orientation: landscape) {
  .main-content {
    padding-top: 70px;
  }

  .header-section {
    margin-bottom: 30px;
  }

  .header-section h1 {
    font-size: 1.8em;
  }

  .edit-modal {
    max-height: 85vh;
  }
}

/* ============================================
   VERY LARGE SCREENS (1920px+)
   ============================================ */
@media (min-width: 1920px) {
  .main-content,
  .container {
    max-width: 1400px;
  }

  .card {
    padding: 50px;
  }

  .header-section h1 {
    font-size: 3em;
  }

  .header-section p {
    font-size: 1.3em;
  }

  .product-card {
    padding: 30px;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .header-section,
  .search-box,
  .search-btn,
  .action-buttons-section,
  .category-selector,
  .btn-edit-product,
  .edit-modal-overlay,
  footer {
    display: none;
  }

  .main-content {
    padding-top: 20px;
  }

  .product-card {
    page-break-inside: avoid;
    border: 1px solid #000;
  }

  body {
    background: white;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}