/**
 * Estilos da Calculadora - Visual Sóbrio
 * Cores neutras e design minimalista
 */

.calculator-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.calculator-modal.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.calculator-container {
  background: #2c2c2c;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  min-width: 350px;
  max-width: 90%;
  animation: slideIn 0.3s ease;
}

.calculator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #444;
}

.calculator-title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  color: #e0e0e0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.calculator-title i {
  color: #999;
}

.calculator-close {
  background: transparent;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.calculator-close:hover {
  background: #444;
  color: #fff;
}

/* Histórico de Cálculos */
.calculator-history {
  background: #1a1a1a;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  max-height: 120px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
}

.calculator-history::-webkit-scrollbar {
  width: 6px;
}

.calculator-history::-webkit-scrollbar-track {
  background: #2c2c2c;
  border-radius: 3px;
}

.calculator-history::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 3px;
}

.calculator-history::-webkit-scrollbar-thumb:hover {
  background: #666;
}

.history-item {
  color: #999;
  font-size: 12px;
  padding: 3px 5px;
  border-bottom: 1px solid #2c2c2c;
}

.history-item:last-child {
  border-bottom: none;
}

.history-empty {
  color: #666;
  font-size: 12px;
  text-align: center;
  padding: 8px;
  font-style: italic;
}

/* Display Principal */
.calculator-display {
  background: #1a1a1a;
  color: #fff;
  font-size: 32px;
  font-family: 'Courier New', monospace;
  padding: 20px;
  border-radius: 8px;
  text-align: right;
  margin-bottom: 15px;
  min-height: 60px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  border: 1px solid #444;
}

/* Botões */
.calculator-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.calc-btn {
  background: #3a3a3a;
  border: 1px solid #4a4a4a;
  color: #e0e0e0;
  font-size: 20px;
  padding: 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.calc-btn:hover {
  background: #4a4a4a;
  border-color: #5a5a5a;
  transform: translateY(-1px);
}

.calc-btn:active {
  transform: translateY(0);
}

/* Botão Clear - destaque sutil */
.calc-btn.clear {
  background: #4a4a4a;
  color: #fff;
  font-weight: 600;
}

.calc-btn.clear:hover {
  background: #5a5a5a;
}

/* Operadores */
.calc-btn.operator {
  background: #505050;
  color: #fff;
  font-weight: 600;
}

.calc-btn.operator:hover {
  background: #606060;
}

/* Botão Igual - destaque principal */
.calc-btn.equals {
  background: #666;
  color: #fff;
  font-weight: 600;
}

.calc-btn.equals:hover {
  background: #777;
}

/* Animações */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Dark Mode Support */
body.dark-mode .calculator-container {
  background: #2c2c2c;
}

body.dark-mode .calculator-display {
  background: #1a1a1a;
  color: #fff;
}

/* Tema Claro (se necessário) */
body:not(.dark-mode) .calculator-container {
  background: #f5f5f5;
}

body:not(.dark-mode) .calculator-header {
  border-bottom-color: #ddd;
}

body:not(.dark-mode) .calculator-title {
  color: #333;
}

body:not(.dark-mode) .calculator-close {
  color: #666;
}

body:not(.dark-mode) .calculator-close:hover {
  background: #e0e0e0;
  color: #000;
}

body:not(.dark-mode) .calculator-history {
  background: #e8e8e8;
}

body:not(.dark-mode) .history-item {
  color: #666;
  border-bottom-color: #ddd;
}

body:not(.dark-mode) .calculator-display {
  background: #fff;
  color: #000;
  border-color: #ddd;
}

body:not(.dark-mode) .calc-btn {
  background: #fff;
  border-color: #ddd;
  color: #333;
}

body:not(.dark-mode) .calc-btn:hover {
  background: #f0f0f0;
  border-color: #ccc;
}

body:not(.dark-mode) .calc-btn.clear {
  background: #e0e0e0;
  color: #333;
}

body:not(.dark-mode) .calc-btn.clear:hover {
  background: #d0d0d0;
}

body:not(.dark-mode) .calc-btn.operator {
  background: #e8e8e8;
  color: #333;
}

body:not(.dark-mode) .calc-btn.operator:hover {
  background: #d8d8d8;
}

body:not(.dark-mode) .calc-btn.equals {
  background: #ddd;
  color: #000;
}

body:not(.dark-mode) .calc-btn.equals:hover {
  background: #ccc;
}

/* Responsividade */
@media (max-width: 480px) {
  .calculator-container {
    min-width: unset;
    width: 95%;
  }
  
  .calculator-display {
    font-size: 28px;
    padding: 15px;
  }
  
  .calc-btn {
    padding: 15px;
    font-size: 18px;
  }
}

/* Estilos para botões no header */
.btn-calculator {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 20px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-calculator:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Botão minimalista no kiosk */
.kiosk-calculator-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 24px;
  padding: 12px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
}

.kiosk-calculator-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
