/* ======================================= */
/* BASE CONVERTER - MODERN UNIFIED        */
/* ======================================= */

/* ===== COLOR DEFINITIONS ===== */
/* Dark mode is default, light mode overrides via :root.light-mode */

.base-converter-card {
  /* Dark mode colors */
  --base-converter-bg-card: var(--secondary-bg);
  --base-converter-bg-input: var(--primary-bg);
  --base-converter-bg-form: var(--secondary-bg);
  --base-converter-border: var(--border-color);
  --base-converter-text: var(--text-primary);
  --base-converter-text-secondary: var(--text-secondary);
  --base-converter-button-bg: var(--link-color);
  --base-converter-button-text: var(--text-primary);
  --base-converter-button-border: var(--border-color);
  --base-converter-button-hover-border: var(--link-color);
  --base-converter-button-hover-shadow: rgba(88, 166, 255, 0.2);
  --base-converter-type-btn-active-bg: var(--link-color);
  --base-converter-type-btn-active-border: var(--link-color);
  --base-converter-type-btn-active-shadow: rgba(88, 166, 255, 0.3);
  --base-converter-focus-border: var(--link-color);
  --base-converter-focus-shadow: rgba(88, 166, 255, 0.1);
}

/* Light mode color overrides */
:root.light-mode .base-converter-card {
  --base-converter-bg-card: #ffffff;
  --base-converter-bg-input: #ffffff;
  --base-converter-bg-form: #f9fafb;
  --base-converter-border: #d0d7de;
  --base-converter-text: #24292f;
  --base-converter-text-secondary: #57606a;
  --base-converter-button-bg: #ffffff;
  --base-converter-button-text: #24292f;
  --base-converter-button-border: #d0d7de;
  --base-converter-button-hover-border: #0969da;
  --base-converter-button-hover-shadow: rgba(9, 105, 218, 0.15);
  --base-converter-type-btn-active-bg: #0969da;
  --base-converter-type-btn-active-border: #0969da;
  --base-converter-type-btn-active-shadow: rgba(9, 105, 218, 0.2);
  --base-converter-focus-border: #0969da;
  --base-converter-focus-shadow: rgba(9, 105, 218, 0.1);
}

/* ===== MAIN CARD ===== */
.base-converter-card {
  max-width: 100%;
  margin: 0 auto;
  padding: 1.25rem;
  background: var(--base-converter-bg-card);
  border: 1px solid var(--base-converter-border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  color: var(--base-converter-text);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

/* Gradient top border */
.base-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: base-converter-gradient-shift 3s ease infinite;
}

@keyframes base-converter-gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ===== HEADER ===== */
.base-converter-card h1 {
  color: var(--base-converter-text);
  font-size: 1.6rem;
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.base-converter-subtitle {
  text-align: center;
  color: var(--base-converter-text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  font-weight: 400;
  line-height: 1.6;
}

/* ===== LAYOUT ===== */
.base-converter-content {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 0;
  align-items: start;
}

.base-converter-column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ===== LABELS ===== */
.base-converter-card label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--base-converter-text);
  font-weight: 600;
  font-size: 0.95rem;
}

/* ===== INPUT GROUPS ===== */
.base-converter-input-group {
  margin-bottom: 0;
}

.base-converter-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--base-converter-bg-input);
  border: 2px solid var(--base-converter-border);
  border-radius: 12px;
  overflow: hidden;
  height: 56px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.base-converter-input-wrapper:focus-within {
  border-color: var(--base-converter-focus-border);
  box-shadow: 0 0 0 3px var(--base-converter-focus-shadow);
}

.base-converter-input-wrapper input[type="text"] {
  flex-grow: 1;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 1.1rem;
  padding: 0 20px;
  height: 100%;
  color: var(--base-converter-text);
  font-weight: 600;
  width: 100%;
  font-family: "Courier New", "Roboto Mono", monospace;
}

.base-converter-input-wrapper input[type="text"]:focus {
  outline: none;
}

.base-converter-input-wrapper input[type="text"]::placeholder {
  color: var(--base-converter-text-secondary);
  opacity: 0.6;
}

/* ===== SELECT SECTION - BASE BUTTONS ===== */
.base-converter-select-section {
  background: var(--base-converter-bg-form);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--base-converter-border);
}

.base-converter-select-section label {
  margin-bottom: 12px;
}

/* BASE BUTTONS GRID */
.base-buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.base-button {
  background: var(--base-converter-bg-input);
  border: 2px solid var(--base-converter-border);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.base-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(147, 51, 234, 0.1), transparent);
  transition: left 0.5s ease;
}

.base-button:hover::before {
  left: 100%;
}

.base-button:hover {
  border-color: var(--base-converter-button-hover-border);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--base-converter-button-hover-shadow);
}

.base-button.active {
  border-color: var(--base-converter-type-btn-active-border);
  background: var(--base-converter-type-btn-active-bg);
  box-shadow: 0 0 20px var(--base-converter-type-btn-active-shadow);
}

.base-button-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--base-converter-text);
  text-align: center;
}

.base-button.active .base-button-label {
  color: white;
}

.base-button-number {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--base-converter-text-secondary);
  font-family: "Courier New", "Roboto Mono", monospace;
}

.base-button.active .base-button-number {
  color: white;
}

.base-button:active {
  transform: translateY(0);
}

/* ===== FEEDBACK MESSAGE ===== */
.base-converter-feedback {
  opacity: 0;
  transition: all 0.3s ease;
  transform: translateY(10px);
  padding: 12px 16px;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.base-converter-feedback.visible {
  opacity: 1;
  transform: translateY(0);
}

.base-converter-feedback.success {
  background: var(--button-primary-bg);
  color: white;
  box-shadow: 0 4px 15px rgba(35, 134, 54, 0.3);
}

.base-converter-feedback.error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* ===== INFO SECTION ===== */
.base-converter-info-section {
  background: var(--base-converter-bg-form);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--base-converter-border);
}

.base-converter-info-section h4 {
  color: var(--base-converter-text);
  font-size: 1rem;
  margin-bottom: 16px;
  font-weight: 600;
  text-align: center;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px;
  background: var(--base-converter-bg-input);
  border-radius: 8px;
  border: 1px solid var(--base-converter-border);
  transition: all 0.2s ease;
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-item:hover {
  border-color: var(--base-converter-button-hover-border);
  transform: translateX(4px);
}

.info-badge {
  background: var(--base-converter-type-btn-active-bg);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 6px;
  min-width: 32px;
  text-align: center;
  flex-shrink: 0;
  font-family: "Courier New", "Roboto Mono", monospace;
}

.info-item p {
  color: var(--base-converter-text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
}

/* ===== RESULTS SECTION ===== */
.base-converter-results-section {
  background: var(--base-converter-bg-form);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--base-converter-border);
}

.base-converter-results-section h3 {
  color: var(--base-converter-text);
  font-size: 1.1rem;
  margin-bottom: 18px;
  font-weight: 600;
  text-align: center;
}

.base-converter-result-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
}

.base-converter-result-row:last-child {
  margin-bottom: 0;
}

.base-converter-result-label {
  font-size: 0.85rem;
  color: var(--base-converter-text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.base-converter-result-display {
  background: var(--base-converter-bg-input);
  border: 2px solid var(--base-converter-border);
  border-radius: 10px;
  padding: 14px 16px;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.base-converter-result-display:hover {
  border-color: var(--base-converter-button-hover-border);
  transform: translateX(4px);
}

.base-converter-result-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(147, 51, 234, 0.1), transparent);
  transition: left 0.5s ease;
}

.base-converter-result-display:hover::before {
  left: 100%;
}

.base-converter-result-value {
  flex-grow: 1;
  font-family: "Courier New", "Roboto Mono", monospace;
  font-size: 1rem;
  font-weight: 600;
  color: var(--base-converter-type-btn-active-bg);
  word-break: break-all;
  line-height: 1.4;
}

.base-converter-copy-button {
  background: transparent;
  border: none;
  color: var(--base-converter-text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px 10px;
  flex-shrink: 0;
  transition: all 0.2s ease;
  border-radius: 6px;
}

.base-converter-copy-button:hover {
  color: var(--base-converter-type-btn-active-bg);
  background: var(--base-converter-bg-form);
  transform: scale(1.1);
}

.base-converter-copy-button:active {
  transform: scale(0.95);
}

/* ===== RESPONSIVE - TABLET ===== */
@media (max-width: 1024px) {
  .base-converter-content {
    grid-template-columns: 1fr 1fr;
  }
  
  .base-converter-column:nth-child(3) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .base-converter-card {
    padding: 1rem;
  }

  .base-converter-card h1 {
    font-size: 1.5rem;
  }

  .base-converter-subtitle {
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
  }

  .base-converter-content {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ===== RESPONSIVE - MOBILE ===== */
@media (max-width: 480px) {
  .base-converter-card {
    padding: 1rem;
    border-radius: 12px;
  }

  .base-converter-card h1 {
    font-size: 1.35rem;
  }

  .base-converter-subtitle {
    font-size: 0.8rem;
  }

  .base-converter-input-wrapper {
    height: 50px;
  }

  .base-converter-input-wrapper input[type="text"] {
    font-size: 1rem;
  }

  .base-converter-select-section {
    padding: 16px;
  }

  .base-buttons-grid {
    gap: 10px;
  }
  
  .base-button {
    padding: 12px 14px;
  }
  
  .base-button-label {
    font-size: 0.85rem;
  }
  
  .base-button-number {
    font-size: 1rem;
  }

  .base-converter-result-display {
    padding: 12px 14px;
    min-height: 46px;
  }

  .base-converter-result-value {
    font-size: 0.95rem;
  }

  .base-converter-copy-button {
    font-size: 1.1rem;
    padding: 4px 8px;
  }

  .base-converter-feedback {
    padding: 10px 14px;
    font-size: 0.85rem;
  }
}

/* ===== EXTRA SMALL SCREENS ===== */
@media (max-width: 375px) {
  .base-converter-card {
    padding: 1rem;
  }

  .base-converter-card h1 {
    font-size: 1.3rem;
  }

  .base-converter-subtitle {
    font-size: 0.75rem;
  }

  .base-converter-result-value {
    font-size: 0.9rem;
  }
}