/* ====================================================================
   Defaa Calculator - Main Stylesheet
   Extracted from Visual layout of the calculator – Arabic.html
   ==================================================================== */

/* Global Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  /* background: linear-gradient(135deg, #c2f0e7 0%, #a8e6cf 100%); */
  padding: 20px;
  line-height: 1.6;
  min-height: 100vh;
}

/* Main Container - Grid Layout */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 350px;
  /* Content area + Fixed sidebar */
  gap: 25px;
}

@media (max-width: 1024px) {
  .main-container {
    grid-template-columns: 1fr;
  }

  .cart-sidebar {
    order: 2;
  }
}

/* Content Area - Main Calculator Section */
.content-area {
  background: white;
  padding: 35px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

h1 {
  color: #004d40;
  margin-bottom: 10px;
  text-align: center;
  font-size: 32px;
  font-weight: 700;
}

.subtitle {
  text-align: center;
  color: #666;
  margin-bottom: 35px;
  font-size: 16px;
}

/* Section Styling */
.section {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 12px;
  margin-bottom: 25px;
  border-right: 4px solid #26a69a;
}

.section-title {
  color: #26a69a;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-number {
  background: #26a69a;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}

/* Form Styling */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.form-group {
  margin-bottom: 0;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #333;
  font-weight: 600;
  font-size: 14px;
}

select,
input[type="number"],
input[type="text"],
input[type="tel"],
input[type="email"] {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e4e8;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.3s ease;
  background: white;
  box-sizing: border-box;
  /* Prevent overflow */
}

select:focus,
input[type="number"]:focus,
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus {
  outline: none;
  border-color: #26a69a;
  box-shadow: 0 0 0 3px rgba(38, 166, 154, 0.1);
}

/* Service Cards */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
}

.service-card {
  background: white;
  padding: 15px;
  border-radius: 12px;
  border: 2px solid #e0e4e8;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  /* Prevent overflow */
}

.service-card:hover {
  border-color: #26a69a;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(38, 166, 154, 0.15);
}

.service-card.selected {
  border-color: #26a69a;
  background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 100%);
}

.service-card.disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

.service-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.service-name {
  font-weight: 600;
  color: #333;
  font-size: 13px;
  line-height: 1.3;
}

/* Service Details */
.service-details {
  background: white;
  padding: 25px;
  border-radius: 12px;
  margin-top: 20px;
  border: 2px solid #26a69a;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.service-details h4 {
  color: #004d40;
  margin-bottom: 20px;
  font-size: 18px;
}

/* Buttons */
.action-buttons {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.btn {
  flex: 1;
  padding: 14px 25px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  box-sizing: border-box;
  /* Prevent overflow */
}

.btn-primary {
  background: linear-gradient(135deg, #20b2aa 0%, #20b2aa 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(3, 166, 147, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(3, 166, 147, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #20b2aa 0%, #20b2aa 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 77, 64, 0.3);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 77, 64, 0.4);
}

.btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  box-sizing: border-box;
  /* Prevent overflow */
}

.btn-edit {
  background: #f59e0b;
  color: white;
}

.btn-edit:hover {
  background: #d97706;
}

.btn-delete {
  background: #ef4444;
  color: white;
}

.btn-delete:hover {
  background: #dc2626;
}

/* Cart Sidebar */
.cart-sidebar {
  background: white;
  padding: 25px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  height: fit-content;
  position: sticky;
  top: 20px;
  width: 350px;
  /* Fixed width matching grid */
  box-sizing: border-box;
  /* Prevent overflow */
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e0e4e8;
}

.cart-title {
  color: #004d40;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-count {
  background: #26a69a;
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 14px;
}

.cart-items {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.cart-item {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 12px;
  border-right: 4px solid #26a69a;
}

.cart-item-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 8px;
}

.cart-item-name {
  font-weight: 600;
  color: #333;
  font-size: 14px;
  flex: 1;
}

.cart-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.cart-summary {
  background: linear-gradient(135deg, #20b2aa 0%, #20b2aa 100%);
  padding: 20px;
  border-radius: 12px;
  color: white;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
}

.summary-row.total {
  font-size: 20px;
  font-weight: 700;
  padding-top: 15px;
  border-top: 2px solid rgba(255, 255, 255, 0.3);
  margin-top: 15px;
}

.discount-badge {
  background: #26a69a;
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 15px;
  font-weight: 600;
  font-size: 14px;
}

.min-charge-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 15px;
  font-weight: 600;
  font-size: 14px;
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.empty-cart {
  text-align: center;
  color: #999;
  padding: 40px 20px;
}

.empty-cart-icon {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.5;
}

.hidden {
  display: none !important;
}

/* Warning Banner */
.warning-banner {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border: 2px solid #ffc107;
  padding: 10px 20px;
  margin: 20px 0;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  animation: pulse 2s ease-in-out infinite;
  border-radius: 12px;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }
}

.warning-banner strong {
  color: #000000;
  font-size: 16px;
  font-weight: normal;
}

.sidecart-hide-totals {
  display: none !important;
}

.sidecart-show-totals {
  display: block !important;
}

#sideCartNote {
  text-align: center;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  margin: 15px 0;
  border: 2px dashed #26a69a;
}

#sideCartNote p {
  color: #666;
  margin-bottom: 15px;
  font-size: 14px;
  line-height: 1.5;
}

/* Personal Info Grid */
.personal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
}

@media (max-width: 768px) {
  .personal-grid {
    grid-template-columns: 1fr;
  }
}

#personalInfoSection {
  scroll-margin-top: 80px;
}

/* Final Options Section */
#finalOptionsSection .action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
  margin-top: 25px;
}

@media (max-width: 768px) {
  #finalOptionsSection .action-buttons {
    grid-template-columns: 1fr;
  }
}

/* Error Messages */
.error-message {
  color: #d32f2f;
  font-size: 12px;
  margin-top: 4px;
  display: none;
}

.input-error {
  border-color: #d32f2f !important;
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1) !important;
}

/* Payment Plans */
.payment-plan-box {
  background: #f5f5f5;
  border: 3px solid transparent;
  padding: 25px;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s ease;
  box-sizing: border-box;
  /* Prevent overflow */
}

.payment-plan-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.payment-plan-box.selected {
  border-color: #FFD700;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
  background: #fffef5;
}

.payment-container {
  background: linear-gradient(135deg, #20b2aa 0%, #20b2aa 100%);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.payment-header {
  color: #ffffff;
  margin-bottom: 15px;
  font-size: 18px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 10px;
  font-weight: 600;
}

.service-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.service-item {
  padding: 12px;
  background: #f5f5f5;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.service-item-icon {
  font-size: 24px;
}

.service-item-name {
  font-size: 15px;
  color: #333;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.cost-row-label {
  font-size: 16px;
  color: #333333;
}

.cost-row-value {
  font-size: 16px;
  font-weight: 600;
  color: #333333;
}

.cost-row-discount {
  color: #d32f2f;
}

.cost-row-discount .cost-row-label,
.cost-row-discount .cost-row-value {
  color: #d32f2f;
}

.payment-plans-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 15px;
}

.plan-box {
  background: #f5f5f5;
  border: 3px solid transparent;
  padding: 25px;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s ease;
  box-sizing: border-box;
  /* Prevent overflow */
}

.plan-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.plan-box.selected {
  border-color: #20b2aa;
  box-shadow: 0 4px 12px rgba(32, 178, 170, 0.3);
}

.plan-amount {
  font-size: 28px;
  font-weight: 700;
  color: #004d40;
  margin-bottom: 10px;
}

.plan-title {
  font-size: 14px;
  color: #666;
  margin-bottom: 5px;
}

.plan-subtitle {
  font-size: 12px;
  color: #999;
}

.plan-savings {
  font-size: 12px;
  color: #d32f2f;
  font-weight: 600;
}

.plan-hint {
  margin-top: 15px;
  padding: 12px;
  background: #fff3cd;
  border-radius: 8px;
  text-align: center;
  font-size: 13px;
  color: #856404;
}

.info-box {
  background: #e3f2fd;
  color: #1976d2;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  margin-bottom: 15px;
}

/* Currency Icon Styling */
.currency-icon {
  height: 14px;
  width: auto;
  vertical-align: middle;
  display: inline-block;
  object-fit: contain;
}

/* Icon spacing for LTR (English) - icon before number */
[dir="ltr"] .currency-icon {
  margin-right: 5px;
  margin-left: 0;
  display: inline-block;
}

/* Icon spacing for RTL (Arabic) - icon before number in HTML with dir="rtl", appears on right (start) */
[dir="rtl"] .currency-icon {
  margin-right: 5px;
  margin-left: 0;
  display: inline-block;
}

/* Ensure RTL containers properly display icon on right */
[dir="rtl"] span:has(.currency-icon) {
  direction: rtl;
  display: inline-block;
}

/* Currency text fallback styling */
.currency-text {
  font-size: 14px;
  vertical-align: middle;
  margin-right: 5px;
}

/* Print Styles - Import from separate file */
/* Print styles are in calculator-print-styles.css.css */