/* ======================================= */
/* VOLUME CONVERTER - IMPROVED UX         */
/* ======================================= */

.volume-converter-card {
  --volume-converter-bg-card: var(--secondary-bg);
  --volume-converter-bg-input: var(--primary-bg);
  --volume-converter-bg-form: var(--secondary-bg);
  --volume-converter-border: var(--border-color);
  --volume-converter-text: var(--text-primary);
  --volume-converter-text-secondary: var(--text-secondary);
  --volume-converter-button-bg: var(--link-color);
  --volume-converter-button-text: var(--text-primary);
  --volume-converter-button-border: var(--border-color);
  --volume-converter-button-hover-border: var(--link-color);
  --volume-converter-button-hover-shadow: rgba(88, 166, 255, 0.2);
  --volume-converter-type-btn-active-bg: var(--link-color);
  --volume-converter-type-btn-active-border: var(--link-color);
  --volume-converter-type-btn-active-shadow: rgba(88, 166, 255, 0.3);
  --volume-converter-focus-border: var(--link-color);
  --volume-converter-focus-shadow: rgba(88, 166, 255, 0.1);
  --volume-converter-glass-fill: linear-gradient(to top, #00b0ff, #80d8ff);
  --volume-converter-glass-fill-medium: linear-gradient(to top, #ffa726, #ffb74d);
  --volume-converter-glass-overflow: linear-gradient(to top, #ff6b6b, #ff9999);
  --volume-converter-warning-color: #ff5252;
  --volume-converter-safe-color: #10b981;
}

:root.light-mode .volume-converter-card {
  --volume-converter-bg-card: #ffffff;
  --volume-converter-bg-input: #ffffff;
  --volume-converter-bg-form: #f9fafb;
  --volume-converter-border: #d0d7de;
  --volume-converter-text: #24292f;
  --volume-converter-text-secondary: #57606a;
  --volume-converter-button-bg: #ffffff;
  --volume-converter-button-text: #24292f;
  --volume-converter-button-border: #d0d7de;
  --volume-converter-button-hover-border: #0969da;
  --volume-converter-button-hover-shadow: rgba(9, 105, 218, 0.15);
  --volume-converter-type-btn-active-bg: #0969da;
  --volume-converter-type-btn-active-border: #0969da;
  --volume-converter-type-btn-active-shadow: rgba(9, 105, 218, 0.2);
  --volume-converter-focus-border: #0969da;
  --volume-converter-focus-shadow: rgba(9, 105, 218, 0.1);
  --volume-converter-glass-fill: linear-gradient(to top, #0969da, #54aeff);
  --volume-converter-glass-fill-medium: linear-gradient(to top, #fb8500, #ffb703);
  --volume-converter-glass-overflow: linear-gradient(to top, #d1242f, #ff6b6b);
  --volume-converter-warning-color: #d1242f;
  --volume-converter-safe-color: #057a55;
}

.volume-converter-card {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem;
  background: var(--volume-converter-bg-card);
  border: 1px solid var(--volume-converter-border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  color: var(--volume-converter-text);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.volume-converter-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #9333ea, #3b82f6, #9333ea);
  background-size: 200% 100%;
  animation: volume-converter-gradient-shift 3s ease infinite;
}

@keyframes volume-converter-gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.volume-converter-card h1 {
  color: var(--volume-converter-text);
  font-size: 1.6rem;
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.volume-converter-subtitle {
  text-align: center;
  color: var(--volume-converter-text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  font-weight: 400;
  line-height: 1.6;
}

/* ===== QUICK SELECT - bovenaan, primair ===== */
.volume-converter-quick-select {
  background: var(--volume-converter-bg-form);
  padding: 15px;
  border-radius: 12px;
  border: 1px solid var(--volume-converter-border);
  margin-bottom: 1.25rem;
}

.volume-converter-quick-select label {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--volume-converter-text);
  font-weight: 600;
  font-size: 0.9rem;
}

.volume-converter-quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.volume-converter-quick-btn {
  padding: 0.55rem 1rem;
  background: var(--volume-converter-bg-input);
  border: 2px solid var(--volume-converter-border);
  border-radius: 8px;
  color: var(--volume-converter-button-text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.volume-converter-quick-btn:hover {
  border-color: var(--volume-converter-button-hover-border);
  background: var(--volume-converter-type-btn-active-bg);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px var(--volume-converter-button-hover-shadow);
}

.volume-converter-quick-btn.active {
  border-color: var(--volume-converter-type-btn-active-border);
  background: var(--volume-converter-type-btn-active-bg);
  color: white;
}

.volume-converter-quick-btn:active {
  transform: translateY(0);
}

/* ===== LAYOUT ===== */
.volume-converter-content {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.25rem;
  margin-bottom: 1rem;
  align-items: start;
}

.volume-converter-column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.volume-converter-card label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--volume-converter-text);
  font-weight: 600;
  font-size: 0.95rem;
}

/* ===== INPUT ===== */
.volume-converter-input-group {
  margin-bottom: 0;
}

.volume-converter-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--volume-converter-bg-input);
  border: 2px solid var(--volume-converter-border);
  border-radius: 12px;
  overflow: hidden;
  height: 56px;
  transition: all 0.3s ease;
}

.volume-converter-input-wrapper:focus-within {
  border-color: var(--volume-converter-focus-border);
  box-shadow: 0 0 0 3px var(--volume-converter-focus-shadow);
}

.volume-converter-input-wrapper input[type="text"] {
  flex-grow: 1;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 1.3rem;
  padding: 0 15px;
  height: 100%;
  color: var(--volume-converter-text);
  font-weight: 700;
}

.volume-converter-input-wrapper input:focus {
  outline: none;
}

/* ===== SLIDER ===== */
.volume-converter-slider {
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: var(--volume-converter-border);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  margin-top: 10px;
}

.volume-converter-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--volume-converter-type-btn-active-bg);
  cursor: pointer;
  box-shadow: 0 2px 8px var(--volume-converter-type-btn-active-shadow);
  transition: transform 0.2s ease;
}

.volume-converter-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.volume-converter-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--volume-converter-type-btn-active-bg);
  cursor: pointer;
  border: none;
}

.volume-converter-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--volume-converter-text-secondary);
  margin-top: 4px;
  padding: 0 2px;
}

/* ===== ARROW CONTROLS ===== */
.volume-converter-arrow-controls {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-left: 1px solid var(--volume-converter-border);
}

.volume-converter-arrow-btn {
  flex: 1;
  width: 46px;
  background: var(--volume-converter-bg-form);
  color: var(--volume-converter-button-text);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.volume-converter-arrow-btn.up {
  border-bottom: 1px solid var(--volume-converter-border);
}

.volume-converter-arrow-btn:hover {
  background: var(--volume-converter-type-btn-active-bg);
  color: white;
}

.volume-converter-arrow-btn:active {
  transform: scale(0.95);
}

/* ===== SELECT GROUP ===== */
.volume-converter-select-group {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--volume-converter-bg-form);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--volume-converter-border);
}

.volume-converter-select-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.volume-converter-select-label {
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  color: var(--volume-converter-text-secondary) !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0 !important;
}

.volume-converter-select-group select {
  width: 100%;
  padding: 12px 14px;
  background: var(--volume-converter-bg-input);
  color: var(--volume-converter-text);
  border: 2px solid var(--volume-converter-border);
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.volume-converter-select-group select:hover {
  border-color: var(--volume-converter-button-hover-border);
}

.volume-converter-select-group select:focus {
  outline: none;
  border-color: var(--volume-converter-focus-border);
  box-shadow: 0 0 0 3px var(--volume-converter-focus-shadow);
}

/* ===== SWAP BUTTON - met label ===== */
.volume-converter-swap-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 12px;
  background: var(--volume-converter-bg-input);
  border: 2px solid var(--volume-converter-border);
  border-radius: 10px;
  color: var(--volume-converter-text);
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.volume-converter-swap-btn .swap-icon {
  font-size: 1.4rem;
  line-height: 1;
  display: block;
  transition: transform 0.3s ease;
}

.volume-converter-swap-btn .swap-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--volume-converter-text-secondary);
}

.volume-converter-swap-btn:hover {
  background: var(--volume-converter-type-btn-active-bg);
  border-color: var(--volume-converter-type-btn-active-border);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--volume-converter-button-hover-shadow);
}

.volume-converter-swap-btn:hover .swap-icon {
  transform: rotate(180deg);
}

.volume-converter-swap-btn:hover .swap-label {
  color: rgba(255,255,255,0.8);
}

/* ===== OUTPUT - groot & leesbaar ===== */
.volume-converter-output-section {
  margin-top: 0;
}

.volume-converter-output-box {
  background: var(--volume-converter-type-btn-active-bg);
  border: 2px solid var(--volume-converter-type-btn-active-border);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 4px 20px var(--volume-converter-type-btn-active-shadow);
  transition: all 0.3s ease;
  flex-wrap: wrap;
}

.output-from,
.output-to {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  font-family: "Courier New", monospace;
  letter-spacing: -0.5px;
}

.output-equals {
  font-size: 1.3rem;
  color: rgba(255,255,255,0.6);
  font-weight: 300;
}

.volume-converter-output-box:hover {
  box-shadow: 0 6px 30px var(--volume-converter-type-btn-active-shadow);
  transform: translateY(-2px);
}

.volume-converter-context {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--volume-converter-bg-form);
  border: 1px solid var(--volume-converter-border);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--volume-converter-text-secondary);
  text-align: center;
  font-style: italic;
  transition: all 0.3s ease;
}

/* ===== GLASS ===== */
.volume-converter-glass-section {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0 20px;
}

.volume-converter-glass-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.volume-converter-glass-tooltip {
  font-size: 0.72rem;
  color: var(--volume-converter-text-secondary);
  text-align: center;
  padding: 4px 10px;
  background: var(--volume-converter-bg-form);
  border: 1px solid var(--volume-converter-border);
  border-radius: 20px;
  white-space: nowrap;
}

.volume-converter-glass {
  position: relative;
  width: 140px;
  height: 280px;
  border: 3px solid var(--volume-converter-border);
  border-radius: 15px 15px 8px 8px;
  background: var(--volume-converter-bg-input);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.5s ease;
  cursor: pointer;
}

.volume-converter-glass:hover {
  border-color: var(--volume-converter-focus-border);
  box-shadow: 0 0 0 3px var(--volume-converter-focus-shadow);
}

.volume-converter-glass.safe {
  border-color: var(--volume-converter-safe-color);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.volume-converter-glass.medium {
  border-color: #ffa726;
  box-shadow: 0 0 20px rgba(255, 167, 38, 0.3);
}

.volume-converter-glass-fill {
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  background: var(--volume-converter-glass-fill);
  height: 0%;
  transition: height 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.5s ease;
  border-top: 2px solid rgba(255, 255, 255, 0.3);
}

.volume-converter-glass.safe .volume-converter-glass-fill {
  background: var(--volume-converter-glass-fill);
}

.volume-converter-glass.medium .volume-converter-glass-fill {
  background: var(--volume-converter-glass-fill-medium);
}

.volume-converter-glass-glare {
  position: absolute;
  top: 0; left: 15%;
  width: 30%; height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0.15), transparent);
  pointer-events: none;
}

.volume-converter-percentage {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--volume-converter-text);
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  z-index: 10;
  pointer-events: none;
  transition: all 0.3s ease;
}

.volume-converter-glass.overflow {
  animation: volume-converter-shake 0.5s ease 2;
  border-color: var(--volume-converter-warning-color);
  box-shadow: 0 0 30px rgba(255, 82, 82, 0.5);
}

.volume-converter-glass.overflow .volume-converter-glass-fill {
  background: var(--volume-converter-glass-overflow);
  animation: volume-converter-overflow-anim 1s ease-in-out infinite alternate;
}

@keyframes volume-converter-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

@keyframes volume-converter-overflow-anim {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* Glasvolume slider onder het glas */
.volume-converter-glass-capacity-slider {
  width: 100%;
  text-align: center;
}

.volume-converter-glass-capacity-slider label {
  font-size: 0.8rem;
  color: var(--volume-converter-text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
  display: block;
}

.capacity-slider {
  width: 140px;
}

/* ===== STATS ===== */
.volume-converter-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.volume-converter-stat {
  background: var(--volume-converter-bg-input);
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid var(--volume-converter-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.volume-converter-stat:hover {
  border-color: var(--volume-converter-button-hover-border);
  transform: translateX(4px);
}

.volume-converter-stat-label {
  font-size: 0.8rem;
  color: var(--volume-converter-text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.volume-converter-stat-value {
  font-size: 1.1rem;
  color: var(--volume-converter-type-btn-active-bg);
  font-weight: 700;
  font-family: "Courier New", monospace;
}

/* ===== RESET ===== */
.volume-converter-reset-btn {
  padding: 0.875rem 1.5rem;
  background: var(--volume-converter-bg-input);
  border: 2px solid var(--volume-converter-border);
  border-radius: 8px;
  color: var(--volume-converter-button-text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.volume-converter-reset-btn:hover {
  border-color: var(--volume-converter-warning-color);
  color: var(--volume-converter-warning-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 82, 82, 0.2);
}

.volume-converter-reset-btn:active {
  transform: translateY(0);
}

/* ===== WARNING ===== */
.volume-converter-warning {
  color: var(--volume-converter-warning-color);
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0;
  transition: all 0.3s ease;
  transform: translateY(10px);
  margin-top: 1rem;
  text-align: center;
  padding: 15px;
  background: rgba(255, 82, 82, 0.1);
  border: 2px solid rgba(255, 82, 82, 0.3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.volume-converter-warning.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .volume-converter-card { padding: 1rem; }
  .volume-converter-card h1 { font-size: 1.4rem; }
  .volume-converter-subtitle { font-size: 0.85rem; margin-bottom: 1rem; }
  .volume-converter-content { grid-template-columns: 1fr; gap: 1rem; }
  .volume-converter-glass-section { order: -1; padding: 10px 0; }
  .volume-converter-glass { width: 120px; height: 220px; }
  .capacity-slider { width: 120px; }
  .volume-converter-quick-buttons { justify-content: center; }
}

@media (max-width: 480px) {
  .volume-converter-card { padding: 1rem; border-radius: 12px; }
  .volume-converter-card h1 { font-size: 1.3rem; }
  .volume-converter-select-group { flex-direction: column; gap: 12px; padding: 14px; }
  .volume-converter-swap-btn { flex-direction: row; align-self: center; padding: 8px 16px; gap: 8px; }
  .volume-converter-swap-btn .swap-icon { transform: rotate(90deg); }
  .volume-converter-swap-btn:hover .swap-icon { transform: rotate(270deg); }
  .volume-converter-glass { width: 100px; height: 200px; }
  .capacity-slider { width: 100px; }
  .output-from, .output-to { font-size: 1.2rem; }
  .volume-converter-quick-btn { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
}
