/* calculator.css - Rediseño idéntico a la imagen */

.calc-redesign {
  background-color: #212130;
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-width: 400px;
  margin: 0 auto;
}

body.light-theme .calc-redesign {
  background-color: #f1f5f9;
}

.calc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background-color: #1a1a24;
}

body.light-theme .calc-header {
  background-color: #e2e8f0;
}

.calc-header-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.btn-calc-logout {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
  flex-shrink: 0;
}

.btn-calc-logout:hover {
  color: #f87171;
}

.calc-user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.calc-user-info .avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  color: #0f172a;
}

.calc-user-info h2 {
  margin: 0;
  font-size: 20px;
  color: #ffffff;
  font-weight: 700;
}

body.light-theme .calc-user-info h2 {
  color: #0f172a;
}

/* Stats Bar */
.calc-stats-bar {
  display: flex;
  background-color: #1e1e2d;
  padding: 10px 20px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

body.light-theme .calc-stats-bar {
  background-color: #cbd5e1;
  border-bottom-color: rgba(0,0,0,0.1);
}

.stat-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.box-dollar {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
}

body.light-theme .box-dollar {
  background-color: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}

.box-dollar input {
  background: transparent;
  border: none;
  color: #fff;
  width: 60px;
  font-size: 14px;
  outline: none;
  font-weight: 600;
}

body.light-theme .box-dollar input {
  color: #0f172a;
}

.money-icon {
  font-size: 16px;
}

.stat-num {
  font-size: 20px;
  font-weight: 700;
}

.text-orange {
  color: #f59e0b;
}

.stat-label {
  color: #9ca3af;
  font-size: 14px;
  font-weight: 600;
}

body.light-theme .stat-label {
  color: #475569;
}

/* Form Container */
.calc-form-container {
  padding: 20px;
}

.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.form-cols-2 > div {
  flex: 1;
}

.form-cols-3 > div {
  flex: 1;
}

.align-center {
  align-items: center;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  font-weight: 700;
}

body.light-theme .form-group label {
  color: #475569;
}

.form-group input[type="number"],
.form-group select {
  background-color: #2a2a3c;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 12px 15px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  outline: none;
  width: 100%;
}

body.light-theme .form-group input[type="number"],
body.light-theme .form-group select {
  background-color: #fff;
  border-color: rgba(0,0,0,0.1);
  color: #0f172a;
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  padding-right: 35px;
}

/* Toggles (iOS style) */
.toggle-group {
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
}

.toggle-label {
  font-size: 14px !important;
  color: #94a3b8 !important;
  text-transform: none !important;
  font-weight: 600 !important;
  margin: 0 !important;
}

.calc-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.switch-ios {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.switch-ios input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-ios.small {
  width: 40px;
  height: 22px;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: .3s;
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

body.light-theme .slider {
  background-color: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.1);
}

.slider .icon-sun, .slider .icon-moon {
  font-size: 11px;
  z-index: 1;
  opacity: 0.7;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: .3s;
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

body.light-theme .slider:before {
  background-color: #fff;
  border-color: #cbd5e1;
}

.switch-ios.small .slider:before {
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
}

input:checked + .slider {
  background-color: rgba(255, 255, 255, 0.15);
}

body.light-theme input:checked + .slider {
  background-color: rgba(0, 0, 0, 0.15);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.switch-ios.small input:checked + .slider:before {
  transform: translateX(18px);
}

/* Section Divider */
.section-divider {
  margin: 10px 0 5px 0;
}

.section-title {
  color: #8b5cf6 !important; /* Purple color from image */
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Gastos Aduaneros */
.gastos-aduaneros-container {
  background-color: #1a1a24;
  border-radius: 12px;
  padding: 15px;
  margin-top: 20px;
}

body.light-theme .gastos-aduaneros-container {
  background-color: #f8fafc;
  border: 1px solid rgba(0,0,0,0.05);
}

.gastos-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

body.light-theme .gastos-header {
  border-bottom-color: rgba(0,0,0,0.05);
}

.gastos-title {
  color: #8b5cf6;
  font-weight: 700;
  font-size: 13px;
}

.gastos-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: 0.3s opacity;
}

.gastos-body.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.gasto-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gasto-name, .gasto-name-input {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  border: none;
  outline: none;
  width: 120px;
}

.gasto-name-input:focus {
  border-bottom: 1px solid #4f46e5;
}

body.light-theme .gasto-name, body.light-theme .gasto-name-input {
  color: #0f172a;
}

.gasto-amount-wrapper {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-weight: 600;
  font-family: monospace;
  font-size: 14px;
}

body.light-theme .gasto-amount-wrapper {
  color: #0f172a;
}

.gasto-input {
  background: transparent;
  border: none;
  color: #fff;
  text-align: right;
  width: 70px;
  font-family: monospace;
  font-size: 14px;
  font-weight: 600;
  outline: none;
}

body.light-theme .gasto-input {
  color: #0f172a;
}

.gasto-input:focus {
  border-bottom: 1px solid #4f46e5;
}

.gastos-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

body.light-theme .gastos-footer {
  border-top-color: rgba(0,0,0,0.05);
}

.total-label {
  color: #fff;
  font-weight: 800;
  font-size: 14px;
}

body.light-theme .total-label {
  color: #0f172a;
}

.total-value {
  color: #fff;
  font-weight: 800;
  font-family: monospace;
  font-size: 15px;
}

body.light-theme .total-value {
  color: #0f172a;
}

/* Actions Row */
.calc-action-buttons {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 15px;
}
.btn-calc-action {
  flex: 1;
  background: #333345;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 12px 10px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}
.btn-calc-action:hover {
  background: #3f3f5a;
}
body.light-theme .btn-calc-action {
  background: #fff;
  color: #0f172a;
  border-color: rgba(0,0,0,0.1);
}
body.light-theme .btn-calc-action:hover {
  background: #f1f5f9;
}

.btn-actions-row {
  display: flex;
  gap: 15px;
  margin-top: 25px;
}

.btn-calc, .btn-trash {
  padding: 15px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-calc {
  flex: 3;
  background-color: #333345;
  color: #fff;
}

.btn-trash {
  flex: 1;
  background-color: #333345;
  color: #fff;
}

.btn-calc:hover, .btn-trash:hover {
  background-color: #3f3f5a;
}

body.light-theme .btn-calc, body.light-theme .btn-trash {
  background-color: #fff;
  border-color: rgba(0,0,0,0.1);
  color: #0f172a;
}

body.light-theme .btn-calc:hover, body.light-theme .btn-trash:hover {
  background-color: #f1f5f9;
}

/* Results Table */
.results-panel {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px;
  margin-top: 10px;
  overflow: hidden;
}

body.light-theme .results-panel {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(0, 0, 0, 0.05);
}

.calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.calc-table th {
  text-align: left;
  padding: 8px 4px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-theme .calc-table th {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

.calc-table td {
  padding: 8px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-theme .calc-table td {
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

.calc-table .lempiras,
.calc-table .dolares {
  text-align: right;
  font-family: monospace;
  font-size: 14px;
}

.calc-table .detalle-dolares,
.calc-table .derechos-aduaneros,
.calc-table .gastos-aduaneros {
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
  color: var(--primary);
  padding-top: 12px;
}

body.light-theme .calc-table .detalle-dolares,
body.light-theme .calc-table .derechos-aduaneros,
body.light-theme .calc-table .gastos-aduaneros {
  background: rgba(0, 0, 0, 0.02);
}

.calc-table .highlight-row td {
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

body.light-theme .calc-table .highlight-row td {
  background: rgba(0, 0, 0, 0.02);
  border-top-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .calc-table .final-row td {
  padding-top: 16px;
  padding-bottom: 16px;
  border-top: 2px solid var(--primary);
  border-bottom: none;
}

/* Modal styles for CAFTA and Alertas */
.calc-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.calc-overlay.hidden {
  display: none;
}
.calc-modal {
  background: #1e1e2d;
  padding: 25px;
  border-radius: 16px;
  text-align: center;
  width: 90%;
  max-width: 320px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  position: relative;
}
.modal-btn-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}
.modal-btn-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}
body.light-theme .modal-btn-close {
  color: #64748b;
}
body.light-theme .modal-btn-close:hover {
  color: #0f172a;
  background: rgba(0,0,0,0.08);
}
body.light-theme .calc-modal {
  background: #fff;
  color: #0f172a;
}
.calc-modal h4 { margin-top: 0; font-size: 18px; color: #fff; }
body.light-theme .calc-modal h4 { color: #0f172a; }
.calc-modal p { color: #9ca3af; font-size: 14px; margin-bottom: 20px; }
.modal-btn-group { display: flex; gap: 10px; justify-content: center; }

/* Logout Button */
.logout-top-btn {
  position: fixed;
  top: 15px;
  right: 15px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 16px;
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}
.logout-top-btn:hover {
  background: rgba(255,0,0,0.3);
}
body.light-theme .logout-top-btn {
  background: rgba(255,255,255,0.8);
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
