/* Custom styles for Calculator Website */

/* Global Variables */
:root {
  --primary: #8b5cf6;
  --primary-light: #a78bfa;
  --secondary: #10b981;
  --accent: #f59e0b;
  --background-light: #f9fafb;
  --background-dark: #1f2937;
  --text-light: #1f2937;
  --text-dark: #f9fafb;
}

/* Base Styles */
html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

/* Calculator Card Styles */
.calculator-card {
  background-color: white;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.dark .calculator-card {
  background-color: #2d3748;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.calculator-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

/* Result Display */
.calculator-result {
  background-color: #f3f4f6;
  padding: 1rem;
  border-radius: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1rem;
  text-align: right;
  transition: background-color 0.3s;
}

body.dark .calculator-result {
  background-color: #374151;
}

.calculator-explanation {
  background-color: #f8fafc;
  border-left: 4px solid var(--primary);
  padding: 1rem;
  margin-top: 1rem;
  border-radius: 0.25rem;
  font-size: 0.9rem;
}

body.dark .calculator-explanation {
  background-color: #374151;
  border-left: 4px solid var(--primary-light);
}

/* Form Controls */
input, select {
  background-color: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.5rem;
  width: 100%;
  transition: border-color 0.3s, box-shadow 0.3s;
}

body.dark input, body.dark select {
  background-color: #374151;
  border-color: #4b5563;
  color: white;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

button {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

button:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
}

/* Profit & Loss Colors */
.profit {
  color: #10b981;
}

.loss {
  color: #ef4444;
}

body.dark .profit {
  color: #34d399;
}

body.dark .loss {
  color: #f87171;
}

/* Footer Styles */
.footer {
  border-top: 1px solid #e5e7eb;
  margin-top: 2rem;
  padding-top: 2rem;
}

body.dark .footer {
  border-top-color: #4b5563;
}

/* Animation */
.loading {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: .5;
  }
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .calculator-card {
    padding: 1rem;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  h2 {
    font-size: 1.25rem;
  }
}

/* Theme Toggle */
.theme-toggle {
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 9999px;
  transition: background-color 0.3s;
}

.theme-toggle:hover {
  background-color: rgba(0,0,0,0.1);
}

body.dark .theme-toggle:hover {
  background-color: rgba(255,255,255,0.2);
}