/* Google Font (Optional - WordPress might already load one, but providing a fallback) */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;700&family=Zen+Kaku+Gothic+New:wght@400;500;700&display=swap');

/* --- Container & Reset for App Scope --- */
.dc-app-container {
  font-family: "Outfit", "Zen Kaku Gothic New", sans-serif;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  background-color: #f8f9fa;
  /* Light clean background */
  border-radius: 12px;
  box-sizing: border-box;
  color: #333;
}

.dc-app-container * {
  box-sizing: border-box;
}

/* --- Usage Count --- */
.dc-usage-note {
  text-align: center;
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 24px;
}

.dc-usage-count.loading {
  display: inline-block;
  min-width: 20px;
}

.dc-usage-count.loading::after {
  content: "…";
  animation: dc-blink 1s infinite;
}

@keyframes dc-blink {
  50% {
    opacity: 0;
  }
}

/* --- Grid Layout --- */
.dc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

/* --- Card Design --- */
.dc-card {
  background: #ffffff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  /* Soft, premium shadow */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.dc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  /* Lift effect */
}

/* --- Card Header --- */
.dc-card-header {
  font-size: 1.1rem;
  font-weight: 700;
  color: #444;
  border-bottom: 1px solid #eee;
  padding-bottom: 12px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dc-card-header::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.2em;
  background: #007bff;
  /* Primary Accent Color */
  border-radius: 2px;
}

/* --- Input Groups --- */
.dc-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dc-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #666;
}

.dc-input {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fdfdfd;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.dc-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
  background: #fff;
}

/* --- Result Area --- */
.dc-result-area {
  margin-top: 8px;
  background: #f0f7ff;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  position: relative;
}

.dc-result-label {
  font-size: 0.8rem;
  color: #555;
  margin-bottom: 4px;
  display: block;
}

.dc-result-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: #007bff;
  line-height: 1.2;
}

.dc-result-unit {
  font-size: 1rem;
  font-weight: 500;
  color: #666;
  margin-left: 4px;
}

/* --- Options & Switches --- */
.dc-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.9rem;
  margin-top: 4px;
}

.dc-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 0.85rem;
  color: #555;
}

.dc-checkbox-label input {
  accent-color: #007bff;
  width: 16px;
  height: 16px;
}

/* --- Global Actions (Clear/History) --- */
.dc-actions {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.dc-btn {
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dc-btn-secondary {
  background: #e9ecef;
  color: #495057;
}

.dc-btn-secondary:hover {
  background: #dee2e6;
  color: #212529;
}

.dc-btn-icon {
  font-size: 1.1em;
}

/* --- Copy Button (Small) --- */
.dc-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: #aaa;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s;
}

.dc-copy-btn:hover {
  color: #007bff;
  background: rgba(0, 0, 0, 0.03);
}

.dc-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  display: none;
  z-index: 1000;
  animation: fadein 0.3s;
}

@keyframes fadein {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* --- Responsive Adjustments --- */
@media (max-width: 600px) {
  .dc-app-container {
    padding: 12px;
  }

  .dc-grid {
    grid-template-columns: 1fr;
    /* Stack cards on mobile */
  }

  .dc-card {
    padding: 16px;
  }
}