/* === Simple Calorie Calculator — Modern Light UI === */
.scc-calculator {
  --scc-primary: #FF822E;
  --scc-secondary: #10b981;
  --scc-accent: #f59e0b;
  --scc-text: #1f2937;
  --scc-text-light: #6b7280;
  --scc-border: #e5e7eb;
  --scc-bg: #ffffff;
  --scc-bg-light: #f9fafb;
  --scc-bg-lighter: #f3f4f6;

  position: relative;
  max-width: 900px;
  margin: 2rem auto;
  padding: 2.5rem;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f3f4f6 100%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  color: var(--scc-text);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
}

.scc-calculator::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.scc-calculator h3 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: center;
  color: var(--scc-text);
}

.scc-subtitle {
  text-align: center;
  color: var(--scc-text-light);
  font-size: 18px;
  margin-bottom: 20px !important;
  font-weight: 400;
}

/* Form */
.scc-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2.5rem;
  background: var(--scc-bg);
  padding: 1.2rem;
  border-radius: 16px;
  border: 2px solid var(--scc-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

@media (max-width: 640px) {
  .scc-form {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
}

.scc-form input[type="text"],
.scc-form input[type="search"],
.scc-form .scc-query {
  padding: 1rem 1.2rem;
  border-radius: 12px;
  border: 2px solid var(--scc-border);
  background: var(--scc-bg-lighter);
  font-size: 16px;
  transition: all 0.3s ease;
  color: var(--scc-text);
}

.scc-form input[type="text"]:focus,
.scc-form .scc-query:focus {
  outline: none;
  border-color: var(--scc-primary);
  background: var(--scc-bg);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.scc-form input[type="text"]::placeholder,
.scc-form .scc-query::placeholder {
  color: var(--scc-text-light);
}

.scc-form button,
.scc-submit {
  background: linear-gradient(135deg, var(--scc-primary) 0%, #ffac6a 100%);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-weight: 600;
  font-size: 16px;
  padding: 1rem 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 130, 46, 0.3);
  white-space: nowrap;
}

.scc-form button:hover:not([disabled]) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 130, 46, 0.4);
}

.scc-form button:active:not([disabled]) {
  transform: translateY(0);
}

.scc-form button[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Results grid */
.scc-results {
  margin-top: 2rem;
}

/* Food items cards */
.scc-item {
  background: var(--scc-bg);
  border-radius: 14px;
  border: 2px solid var(--scc-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  transition: all 0.3s ease;
  animation: scc-fade-slide 0.4s ease both;
  display: flex;
  flex-direction: column;
  height: 100%;
  margin-bottom: 1rem;
}

.scc-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  border-color: var(--scc-primary);
}

.scc-item h4 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--scc-primary);
  line-height: 1.4;
}

/* Macro display */
.scc-macros {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: auto;
}

.scc-macro-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--scc-bg-lighter);
  border-radius: 10px;
  border-left: 4px solid var(--scc-primary);
  font-size: 0.95rem;
  font-weight: 600;
}

.scc-macro-label {
  color: var(--scc-text-light);
  font-weight: 600;
  font-size: 16px;
}

.scc-macro-value {
  color: var(--scc-primary);
  font-weight: 700;
  font-size: 16px;
}

/* Total summary */
.scc-total {
  background: linear-gradient(135deg, var(--scc-primary) 0%, #FF822E 100%);
  border: none;
  border-radius: 14px;
  padding: 2rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: #ffffff;
  margin-top: 20px;
  text-align: center;
  box-shadow: 0 8px 25px rgba(255, 130, 46, 0.3);
  animation: scc-fade-slide 0.5s ease both 0.1s;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  align-items: center;
}

.scc-total-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.scc-total-label {
  font-size: 18px;
  font-weight: 600;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.scc-total-value {
  font-size: 16px;
  font-weight: 700;
}

/* Error messages */
.scc-error {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  border: 2px solid #fca5a5;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  font-weight: 600;
  animation: scc-fade-slide 0.3s ease both;
  margin-top: 1rem;
}

/* Loading spinner */
.scc-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: scc-spin 0.8s linear infinite;
  margin-left: 0.6rem;
  vertical-align: middle;
}

/* Skeleton loaders */
.scc-skel-card {
  background: var(--scc-bg);
  border: 2px solid var(--scc-border);
  border-radius: 14px;
  padding: 1.5rem;
  min-height: 200px;
  animation: scc-pulse 2s ease-in-out infinite;
  margin-bottom: 1rem;
}

.scc-skel-item {
  background: var(--scc-bg-lighter);
  border-radius: 8px;
  height: 16px;
  margin-bottom: 1rem;
}

.scc-skel-item.title {
  height: 24px;
  margin-bottom: 1.5rem;
}

.scc-skel-item.row {
  height: 48px;
  margin-bottom: 0.8rem;
}

.scc-skel-total {
  background: linear-gradient(135deg, #dbeafe 0%, #dbeafe 100%);
  border-radius: 14px;
  height: 80px;
  animation: scc-pulse 2s ease-in-out infinite;
  margin-top: 1rem;
}

/* Animations */
@keyframes scc-spin {
  to { transform: rotate(360deg); }
}

@keyframes scc-fade-slide {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scc-pulse {
  0%, 100% { background-color: var(--scc-bg-lighter); }
  50%      { background-color: var(--scc-border); }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .scc-calculator {
    --scc-text: #f3f4f6;
    --scc-text-light: #d1d5db;
    --scc-border: #374151;
    --scc-bg: #1f2937;
    --scc-bg-light: #111827;
    --scc-bg-lighter: #374151;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  }
  .scc-form,
  .scc-item { background: var(--scc-bg); border-color: var(--scc-border); }
  .scc-macro-row { background: var(--scc-bg-lighter); }
  .scc-error {
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.3) 0%, rgba(127, 29, 29, 0.2) 100%);
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.4);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .scc-item,
  .scc-form button,
  .scc-total,
  .scc-skel-card,
  .scc-skel-total {
    animation: none;
    transition: none;
  }
}