/* Calculator Modal Styles - 2025 Glass-Morphism Design */

.calculator-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0.4) 50%,
    rgba(0, 0, 0, 0.6) 100%
  );
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  animation: overlayFadeIn 0.4s ease-out;
}

@keyframes overlayFadeIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(25px);
  }
}

.modal-content {
  position: relative;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 24px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.2);
  animation: modalSlideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(30px);
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    backdrop-filter: blur(30px);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 2.5rem 1.5rem;
  position: relative;
}

.modal-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 2.5rem;
  right: 2.5rem;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
}

.modal-header h3 {
  font-family: var(--font-primary);
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-white);
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-header h3::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--color-gold) 0%,
    var(--color-gold-light) 50%,
    var(--color-gold) 100%
  );
  border-radius: 2px;
  animation: accent-glow 2s ease-in-out infinite alternate;
}

@keyframes accent-glow {
  0% { opacity: 0.7; transform: scaleX(0.9); }
  100% { opacity: 1; transform: scaleX(1); }
}

.modal-close {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 0.75rem;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.modal-close::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.2),
    rgba(255, 255, 255, 0.1)
  );
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-close:hover::before {
  opacity: 1;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
  color: var(--color-white);
  transform: scale(1.05) rotate(90deg);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.modal-body {
  padding: 2rem 2.5rem;
}

.calculator-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.calculator-form label {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.75rem;
  display: block;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.calculator-form input,
.calculator-form select {
  width: 100%;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  font-family: var(--font-secondary);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-navy);
  outline: none;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.1),
    inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.calculator-form input::placeholder,
.calculator-form select::placeholder {
  color: rgba(10, 10, 10, 0.6);
}

.calculator-form input:focus,
.calculator-form select:focus {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--color-gold);
  transform: translateY(-2px);
  box-shadow:
    0 8px 25px rgba(212, 175, 55, 0.2),
    0 0 20px rgba(212, 175, 55, 0.1);
}

.calculator-form select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 1rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 3rem;
  appearance: none;
}

.calculator-submit {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 2.5rem;
  background: linear-gradient(135deg,
    var(--color-gold) 0%,
    var(--color-gold-light) 100%
  );
  color: var(--color-white);
  border: none;
  border-radius: 16px;
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
  margin-top: 1rem;
  justify-content: center;
}

.calculator-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.calculator-submit:hover::before {
  left: 100%;
}

.calculator-submit:hover {
  background: linear-gradient(135deg,
    var(--color-gold-dark) 0%,
    var(--color-gold) 100%
  );
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 15px 40px rgba(212, 175, 55, 0.4),
    0 0 25px rgba(212, 175, 55, 0.3);
}

.calculator-submit:disabled {
  background: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.6);
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.calculator-results {
  margin-top: 2rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  color: var(--color-white);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.2),
    inset 0 1px 2px rgba(255, 255, 255, 0.1);
  animation: resultsSlideIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.calculator-results::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
}

@keyframes resultsSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    backdrop-filter: blur(20px);
  }
}

.calculator-results h4 {
  font-family: var(--font-primary);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--color-white);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  position: relative;
}

.calculator-results h4::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg,
    var(--color-gold) 0%,
    var(--color-gold-light) 50%,
    var(--color-gold) 100%
  );
  border-radius: 1px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.result-item {
  text-align: center;
  padding: 1.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.result-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
}

.result-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.2),
    0 0 15px rgba(212, 175, 55, 0.1);
}

.result-label {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-bottom: 0.5rem;
  display: block;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.result-value {
  font-family: var(--font-primary);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-gold);
  text-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
  line-height: 1;
}

.calculator-error {
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  background: rgba(220, 53, 69, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--color-white);
  border-radius: 12px;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.2);
  animation: errorSlideIn 0.4s ease-out;
}

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

/* Responsive Design - 2025 Glass-Morphism */
@media (max-width: 968px) {
  .calculator-modal {
    padding: 1rem;
  }

  .modal-content {
    max-width: 100%;
    border-radius: 20px;
  }

  .modal-header {
    padding: 1.5rem 2rem 1rem;
  }

  .modal-header h3 {
    font-size: 1.75rem;
  }

  .modal-body {
    padding: 1.5rem 2rem;
  }

  .calculator-form {
    gap: 1.25rem;
  }

  .calculator-form label {
    font-size: 0.95rem;
  }

  .calculator-form input,
  .calculator-form select {
    padding: 0.9rem 1.1rem;
    font-size: 1rem;
  }

  .calculator-submit {
    padding: 1.1rem 2rem;
    font-size: 1.1rem;
  }

  .calculator-results {
    padding: 1.5rem;
  }

  .calculator-results h4 {
    font-size: 1.35rem;
  }

  .result-value {
    font-size: 1.5rem;
  }
}

@media (max-width: 768px) {
  .calculator-modal {
    padding: 0.5rem;
  }

  .modal-content {
    margin: 0.5rem;
    width: calc(100% - 1rem);
    border-radius: 16px;
  }

  .modal-header {
    padding: 1.25rem 1.5rem 0.75rem;
  }

  .modal-header h3 {
    font-size: 1.5rem;
  }

  .modal-close {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .modal-body {
    padding: 1.25rem 1.5rem;
  }

  .calculator-form {
    gap: 1rem;
  }

  .calculator-form input,
  .calculator-form select {
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
  }

  .calculator-submit {
    padding: 1rem 1.75rem;
    font-size: 1rem;
  }

  .results-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .result-item {
    padding: 1.25rem 0.75rem;
  }

  .result-value {
    font-size: 1.35rem;
  }
}

@media (max-width: 480px) {
  .calculator-modal {
    padding: 0.25rem;
  }

  .modal-content {
    margin: 0.25rem;
    width: calc(100% - 0.5rem);
    border-radius: 12px;
  }

  .modal-header {
    padding: 1rem 1.25rem 0.5rem;
  }

  .modal-header h3 {
    font-size: 1.25rem;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .modal-header h3::after {
    display: none;
  }

  .modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
  }

  .modal-body {
    padding: 1rem 1.25rem;
  }

  .calculator-form {
    gap: 0.875rem;
  }

  .calculator-form label {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }

  .calculator-form input,
  .calculator-form select {
    padding: 0.75rem 0.9rem;
    font-size: 0.9rem;
  }

  .calculator-submit {
    padding: 0.9rem 1.5rem;
    font-size: 0.95rem;
  }

  .calculator-results {
    padding: 1.25rem;
    margin-top: 1.5rem;
  }

  .calculator-results h4 {
    font-size: 1.2rem;
  }

  .result-item {
    padding: 1rem 0.5rem;
  }

  .result-value {
    font-size: 1.25rem;
  }

  .calculator-error {
    padding: 0.9rem 1.25rem;
    font-size: 0.9rem;
  }
}
