/* ======= Calculators Section ======= */
.calculators-section {
  padding: 80px 0;
}

.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 40px;
}

.section-header .section-tag {
  display: block;
  color: var(--secondary-color);
  font-weight: 600;
  margin-bottom: 10px;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: var(--headings-color);
}

.section-header .section-subtitle {
  font-size: 1.1rem;
  color: var(--text-color);
}

/* ======= Calculators Grid ======= */
.calculators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  justify-content: center;
  padding-top: 30px;
}

/* ======= Calculator Card ======= */
.calculator-card {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  padding: 30px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: 0.3s;
  min-height: 450px; /* קובע גובה אחיד לכל המחשבונים */
}

.calculator-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* ======= Icon ======= */
.calculator-icon {
  font-size: 48px;
  color: var(--secondary-color);
  margin-bottom: 20px;
}

/* ======= Title ======= */
.calculator-title {
  font-size: 22px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 15px;
}

/* ======= Info Button ======= */
.calculator-info-button {
  margin-bottom: 15px;
}

.cta-button.small {
  padding: 8px 20px;
  font-size: 14px;
  background: linear-gradient(45deg, #00b09b, #96c93d);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s;
}

.cta-button.small:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.25);
}

/* ======= Calculator Body ======= */
.calculator-body {
  width: 100%;
  max-width: 340px;
  margin: 0 auto 20px;
}

.form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
}

.form-row label {
  font-weight: 500;
  margin-bottom: 5px;
  font-size: 15px;
  color: #333;
}

.form-row input {
  padding: 10px 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
  width: 100%;
  transition: 0.2s;
}

.form-row input:focus {
  border-color: #00b09b;
  box-shadow: 0 0 8px rgba(0, 176, 155, 0.3);
  outline: none;
}

/* ======= Calculate Button ======= */
.calc-btn {
  width: 100%;
  padding: 12px;
  background: var(--secondary-color);
  color: white;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s;
  margin-top: 10px;
}

.calc-btn:hover {
  background: var(--primary-color);
}

/* ======= Calculator Result ======= */
.calculator-result {
  background: #f9f9f9;
  border-top: 1px solid #ddd;
  padding: 15px;
  font-size: 17px;
  font-weight: bold;
  color: #333;
  border-radius: 0 0 10px 10px;
  margin-top: 15px;
  width: 100%;
}

/* ======= Info Modal ======= */
.info-modal {
  display: none;
  position: fixed;
  z-index: 3000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto; /* במקום overflow רגיל */
  background-color: rgba(0,0,0,0.6);
  padding: 80px 20px;
}

.info-modal-content {
  background-color: #ffffff;
  margin: auto;
  padding: 30px;
  border: 1px solid #ccc;
  width: 90%;
  max-width: 700px;
  border-radius: 12px;
  position: relative;
  animation: fadeInModal 0.4s ease;
}

.close-modal {
  color: #aaa;
  position: absolute;
  top: 15px;
  left: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
  color: #000;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ======= Responsive ======= */
@media (max-width: 992px) {
  .calculators-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
}

@media (max-width: 768px) {
  .calculators-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .calculator-card {
    padding: 20px 15px;
  }
  .calculator-title {
    font-size: 20px;
  }
}

/* אנימציה לרקע מחשבונים */

.calculator-card {
  position: relative;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.07);
  padding: 30px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: 0.3s;
}

/* שכבת רקע מונפשת */
.calculator-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, #e0f7fa, #80deea, #26c6da);
  animation: backgroundMove 8s linear infinite;
  z-index: 0;
  opacity: 0.15;
}

/* צבעים לפי מחשבון */
#calc-self-employed::before {
  background: radial-gradient(circle, #e8f5e9, #a5d6a7, #66bb6a);
}

#calc-retirement-pension::before {
  background: radial-gradient(circle, #ede7f6, #b39ddb, #7e57c2);
}

/* אנימציה תנועה של רקע */
@keyframes backgroundMove {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}

/* לוודא שכל התוכן מעל */
.calculator-card > * {
  position: relative;
  z-index: 1;
}

/* רקע אנימטיבי למחשבון השקעות כללי */
#calc-general-investment::before {
  background: radial-gradient(circle at center, #f3e5f5, #ce93d8, #ab47bc);
}

/* ===== תיקוני רספונסיביות במובייל ===== */
@media (max-width: 768px) {
  /* 1) מחשבונים בשורה אחת */
  .calculators-grid {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  /* 2) כפתור הסבר קטן יותר */
  .calculator-info-button button {
    display: inline-block;
    width: auto;
    max-width: 180px;
    font-size: 14px;
    padding: 6px 12px;
    white-space: nowrap;
  }

  /* 3) מודאל מלא, גלילה פנימית */
  .info-modal {
    padding-top: 20px;
  }
  .info-modal-content {
    margin: 20px auto;
    width: 95%;
    max-width: 600px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
  }
}


/* רקע אנימטיבי למחשבון ביטוח בריאות */
#calc-health-insurance::before {
  background: radial-gradient(circle at center, #ffebee, #ffcdd2, #ef9a9a);
}

/* רקע אנימטיבי למחשבון ביטוח חיים */
#calc-life-insurance::before {
  background: radial-gradient(circle at center, #fff8e1, #ffecb3, #ffe082);
}

/* רקע אנימטיבי למחשבון משכנתא */
#calc-mortgage::before {
  background: radial-gradient(circle at center, #e3f2fd, #90caf9, #42a5f5);
}

/* רקע אנימטיבי למחשבון מחלות קשות */
#calc-critical-illness::before {
  background: radial-gradient(circle at center, #f3e5f5, #ce93d8, #ab47bc);
}

/* רקע אנימטיבי למחשבון אובדן כושר עבודה */
#calc-disability::before {
  background: radial-gradient(circle at center, #e8f5e9, #a5d6a7, #66bb6a);
}

/* רקע אנימטיבי למחשבון נסיעות לחו"ל */
#calc-travel::before {
  background: radial-gradient(circle at center, #fff3e0, #ffb74d, #fb8c00);
}
