/* ============================================
   CALC.MAL+ TOOL-SPECIFIC STYLES
   Styles for individual calculator tools
   ============================================ */

/* ============================================
   TOOL PANELS
   ============================================ */

.tool-panel {
  display: none;
}

.tool-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* ============================================
   BASIC CALCULATOR
   ============================================ */

.basic-calc-container {
  max-width: 400px;
  margin: 0 auto;
}

.calc-display {
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.calc-history {
  font-family: 'Orbitron', monospace;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: right;
  min-height: 1.2em;
  margin-bottom: 4px;
  opacity: 0.7;
}

.calc-display-input {
  width: 100%;
  background: transparent;
  border: none;
  font-family: 'Orbitron', monospace;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  text-align: right;
  outline: none;
  padding: 0;
}

.calc-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.calc-btn {
  font-family: 'Orbitron', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 18px;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calc-btn:hover {
  transform: translateY(-2px);
}

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

.calc-btn-number {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  color: var(--text-primary);
}

.calc-btn-number:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
  border-color: var(--text-secondary);
}

.calc-btn-operator {
  background: linear-gradient(135deg, rgba(255, 120, 0, 0.2), rgba(255, 69, 0, 0.15));
  color: var(--primary);
  border-color: rgba(255, 120, 0, 0.4);
}

.calc-btn-operator:hover {
  background: linear-gradient(135deg, rgba(255, 120, 0, 0.35), rgba(255, 69, 0, 0.25));
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(255, 120, 0, 0.3);
}

.calc-btn-function {
  background: linear-gradient(135deg, rgba(100, 100, 100, 0.15), rgba(80, 80, 80, 0.1));
  color: var(--text-secondary);
  font-size: 1rem;
}

.calc-btn-function:hover {
  background: linear-gradient(135deg, rgba(100, 100, 100, 0.25), rgba(80, 80, 80, 0.18));
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.calc-btn-equals {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--bg-dark);
  border-color: var(--accent);
}

.calc-btn-equals:hover {
  box-shadow: 0 0 20px var(--glow);
  border-color: var(--primary-light);
}

.calc-icon {
  width: 1.2em;
  height: 1.2em;
  stroke-width: 2.5;
}

/* Responsive calculator */
@media (max-width: 500px) {
  .calc-display-input {
    font-size: 2rem;
  }

  .calc-btn {
    padding: 14px;
    font-size: 1rem;
  }

  .calc-btn-function {
    font-size: 0.85rem;
  }
}

/* ============================================
   ELECTRIC CALCULATOR
   ============================================ */

.electric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.electric-info-box {
  background: linear-gradient(135deg, rgba(255, 120, 0, 0.1), rgba(255, 69, 0, 0.08));
  border: 2px solid rgba(255, 120, 0, 0.3);
  border-left: 4px solid var(--primary);
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
}

.electric-info-box h4 {
  font-family: 'Orbitron', monospace;
  font-size: 0.9rem;
  color: var(--primary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.electric-info-box p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 8px;
  font-family: 'Consolas', 'Monaco', monospace;
}

.electric-info-box p:last-child {
  margin-bottom: 0;
}

.electric-info-box strong {
  color: var(--primary-light);
}

/* ============================================
   COLOR CONVERTER
   ============================================ */

.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.color-picker-input {
  width: 100%;
  height: 44px;
  padding: 2px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--bg-input);
  cursor: pointer;
  transition: all 0.3s;
}

.color-picker-input:hover {
  border-color: var(--primary);
}

.color-picker-input::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.color-picker-input::-webkit-color-swatch {
  border: none;
  border-radius: 2px;
}

.color-preview-container {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, rgba(255, 120, 0, 0.1), rgba(255, 69, 0, 0.08));
  border: 2px solid rgba(255, 120, 0, 0.3);
  border-radius: 8px;
  margin-top: 20px;
}

.color-preview {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  border: 3px solid var(--border);
  background-color: #FF7800;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.color-preview-info {
  flex: 1;
}

.color-preview-info p {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  border-left: 3px solid var(--primary);
}

.color-preview-info p:last-child {
  margin-bottom: 0;
}

/* CSS Code Cards */
.css-code-card {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(20, 20, 20, 0.3));
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}

.css-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 120, 0, 0.1);
  border-bottom: 1px solid var(--border);
}

.css-code-title {
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.css-copy-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  color: var(--bg-dark);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.css-copy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--glow);
}

.css-code-content {
  padding: 16px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
  overflow-x: auto;
}

.css-code-content pre {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Color palette cards */
.color-palette-container {
  grid-column: 1 / -1;
  margin-top: 8px;
}

.color-palette-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.color-swatch-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
}

.color-swatch-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.color-swatch {
  width: 100%;
  height: 60px;
  background-color: currentColor;
}

.color-swatch-info {
  padding: 12px;
  text-align: center;
}

.color-swatch-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.color-swatch-value {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 600;
}

/* Color format cards */
.color-format-card {
  cursor: pointer;
  transition: all 0.2s;
}

.color-format-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* ============================================
   FDM CALCULATOR
   ============================================ */

.fdm-grid,
.crow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.fdm-grid .input-field input,
.fdm-grid .input-field select,
.crow-grid .input-field input,
.crow-grid .input-field select {
  width: 100%;
}

.fdm-info-section,
.crow-info-section {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.info-card {
  background: linear-gradient(135deg, rgba(255, 120, 0, 0.08), rgba(255, 69, 0, 0.05));
  border: 1px solid rgba(255, 120, 0, 0.2);
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  border-radius: 6px;
  transition: all 0.3s;
}

.info-card:hover {
  background: linear-gradient(135deg, rgba(255, 120, 0, 0.12), rgba(255, 69, 0, 0.08));
  border-color: rgba(255, 120, 0, 0.4);
  transform: translateY(-2px);
}

.info-card h4 {
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-card p,
.info-card ul,
.info-card li {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.info-card ul {
  padding-left: 20px;
  margin-top: 8px;
}

.info-card li {
  margin-bottom: 4px;
}

.info-card strong {
  color: var(--primary-light);
}

/* ============================================
   CROW CALCULATOR
   ============================================ */

.crow-peanut-info {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(79, 70, 229, 0.1));
  border: 2px solid rgba(99, 102, 241, 0.3);
  border-left: 4px solid var(--crow-accent);
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
}

.crow-fact-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(79, 70, 229, 0.08));
  border: 2px solid rgba(99, 102, 241, 0.25);
  border-left: 4px solid var(--crow-accent);
  transition: all 0.3s;
}

.crow-fact-card:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(79, 70, 229, 0.12));
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-4px);
}

.crow-fact-card .result-label {
  color: var(--crow-accent);
}

.crow-fact-text {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-top: 8px;
}

.crow-info-section {
  grid-column: 1 / -1;
}

.crow-info-section .info-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(79, 70, 229, 0.05));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-left: 4px solid var(--crow-accent);
}

.crow-info-section .info-card:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(79, 70, 229, 0.08));
  border-color: rgba(99, 102, 241, 0.4);
}

.crow-info-section .info-card h4 {
  color: var(--crow-accent);
}

.crow-info-section .info-card a {
  color: var(--crow-accent);
}

.crow-info-section .info-card a:hover {
  text-decoration: underline;
}

/* ============================================
   D&D DICE ROLLER
   ============================================ */

.dnd-dice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.dnd-dice-btn {
  font-family: 'Orbitron', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 20px 10px;
  background: linear-gradient(135deg, rgba(218, 165, 32, 0.2), rgba(184, 134, 11, 0.15));
  color: gold;
  border: 2px solid rgba(218, 165, 32, 0.4);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.dnd-dice-btn:hover {
  background: linear-gradient(135deg, rgba(218, 165, 32, 0.35), rgba(184, 134, 11, 0.25));
  border-color: gold;
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(218, 165, 32, 0.3);
}

.dnd-preset-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  color: var(--text-primary);
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.dnd-preset-btn:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
  border-color: gold;
  transform: translateY(-2px);
}

.dnd-roll-display {
  font-family: 'Orbitron', monospace;
  font-size: 2rem;
  color: gold;
  text-align: center;
  padding: 20px;
  margin-top: 20px;
  background: linear-gradient(135deg, rgba(218, 165, 32, 0.1), rgba(184, 134, 11, 0.08));
  border: 2px solid rgba(218, 165, 32, 0.3);
  border-radius: 8px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dnd-roll-details {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 12px;
  text-align: center;
}

.dnd-crit-success {
  color: var(--success);
  text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

.dnd-crit-fail {
  color: var(--danger);
  text-shadow: 0 0 10px rgba(248, 113, 113, 0.5);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--bg-dark);
  padding: 16px 24px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
  .fdm-info-section,
  .crow-info-section {
    grid-template-columns: 1fr;
  }

  .electric-grid {
    grid-template-columns: 1fr;
  }

  .color-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .color-preview-container {
    flex-direction: column;
  }

  .color-preview {
    width: 100%;
    height: 80px;
  }

  .dnd-dice-grid {
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  }
}
