/* Base64 image converter — golden luxury */

.tool-page-shell .main-width {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

.tool-page-shell .converter-container {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

.tool-page-shell .converter-container > *:last-child {
  margin-bottom: 0 !important;
}

.converter-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
  border-radius: 12px;
  background: rgba(182, 138, 58, 0.1);
  padding: 6px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.tab-btn {
  flex: 1;
  padding: 14px 20px;
  background: transparent;
  border: none;
  color: #7a572c;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.tab-btn i {
  margin-right: 8px;
}

.tab-btn:hover {
  background: rgba(182, 138, 58, 0.15);
}

.tab-btn.active {
  background: linear-gradient(180deg, #bc8e3d 0%, #9f742f 100%);
  color: #fff8ef;
  box-shadow: 0 4px 14px -6px rgba(94, 65, 30, 0.35);
}

.tab-btn.active:hover {
  background: linear-gradient(180deg, #c89a4a 0%, #aa7d34 100%);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.upload-section {
  margin-bottom: 30px;
}

.upload-area {
  border: 2px dashed rgba(145, 103, 48, 0.4);
  border-radius: 12px;
  padding: 60px 40px;
  text-align: center;
  background: rgba(255, 252, 246, 0.6);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.upload-area:hover {
  border-color: #ab7c34;
  background: rgba(182, 138, 58, 0.1);
  box-shadow: 0 4px 18px -12px rgba(94, 65, 30, 0.2);
}

.upload-area.drag-over {
  border-color: #5e4329;
  background: rgba(182, 138, 58, 0.14);
  box-shadow: 0 4px 20px -10px rgba(94, 65, 30, 0.22);
}

.upload-icon {
  font-size: 3rem;
  color: #b98b3b;
  margin-bottom: 20px;
}

.upload-area h3 {
  color: #4f3a24;
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.upload-area p {
  color: rgba(88, 64, 38, 0.72);
  margin: 0;
}

.browse-btn {
  background: linear-gradient(180deg, #bc8e3d 0%, #9f742f 100%);
  color: #fff8ef;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
  box-shadow: 0 6px 18px rgba(145, 103, 48, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.browse-btn:hover {
  background: linear-gradient(180deg, #c89a4a 0%, #aa7d34 100%);
  box-shadow: 0 6px 16px -4px rgba(145, 103, 48, 0.28);
}

.browse-btn:active {
  opacity: 0.92;
}

.image-preview {
  background: rgba(255, 252, 246, 0.75);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  border: 1px solid rgba(145, 103, 48, 0.12);
}

.image-preview img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  box-shadow: 0 8px 25px rgba(94, 65, 30, 0.2);
  margin-bottom: 20px;
}

.image-info {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.image-info span {
  color: #7a5526;
  font-size: 0.9rem;
  padding: 6px 12px;
  background: rgba(182, 138, 58, 0.12);
  border-radius: 6px;
}

.output-section,
.input-section {
  background: rgba(255, 252, 246, 0.75);
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 0;
  border: 1px solid rgba(145, 103, 48, 0.12);
}

.output-header,
.input-header,
.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.output-header h3,
.input-header h3,
.result-header h3 {
  color: #4f3a24;
  margin: 0;
  font-size: 1.2rem;
}

.output-controls,
.result-controls,
.input-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

#base64Output,
#base64Input {
  width: 100%;
  min-height: 150px;
  background: #fffaf2;
  border: 1px solid rgba(145, 103, 48, 0.2);
  border-radius: 8px;
  color: #4a351f;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  padding: 15px;
  resize: vertical;
  box-sizing: border-box;
  line-height: 1.4;
}

#base64Output:focus,
#base64Input:focus {
  outline: none;
  border-color: #ab7c34;
  box-shadow: 0 0 0 3px rgba(171, 124, 52, 0.12);
}

.convert-btn {
  width: 100%;
  margin-top: 20px;
}

.result-section {
  background: rgba(255, 252, 246, 0.75);
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 0;
  border: 1px solid rgba(145, 103, 48, 0.12);
}

.converted-image {
  text-align: center;
}

.converted-image img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
  box-shadow: 0 8px 25px rgba(94, 65, 30, 0.2);
}

.btn-secondary {
  border: 1px solid rgba(145, 103, 48, 0.4);
}

.btn i {
  margin-right: 10px;
}

[onclick*='copyToClipboard'].copied,
.btn-primary.copied {
  animation: copyPulse 0.6s ease;
  box-shadow: 0 0 0 2px rgba(171, 124, 52, 0.35);
}

[onclick*='copyToClipboard'].copied svg,
.btn-primary.copied svg {
  display: inline-block;
  vertical-align: middle;
}

@keyframes copyPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1.05);
  }
}

.btn-secondary:hover {
  color: #5e4329;
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(145, 103, 48, 0.25);
  border-radius: 50%;
  border-top-color: #ab7c34;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(180deg, #bc8e3d 0%, #9f742f 100%);
  color: #fff8ef;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 500;
  z-index: 1000;
  animation: slideIn 0.3s ease;
}

.toast.success {
  background: linear-gradient(180deg, #bc8e3d 0%, #9f742f 100%);
}

.toast.error {
  background: #c94a3a;
  color: #fff;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .main-width {
    padding: 0;
  }

  .converter-container {
    padding: 0;
  }

  .converter-tabs {
    max-width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .upload-area {
    padding: 40px 20px;
  }

  .upload-icon {
    font-size: 2rem;
  }

  .output-header,
  .input-header,
  .result-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .output-controls,
  .result-controls,
  .input-controls {
    width: 100%;
  }

  .btn {
    flex: 1;
    min-width: 120px;
  }

  .convert-btn {
    width: 100%;
  }

  .image-info {
    flex-direction: column;
    gap: 10px;
  }

  .toast {
    top: auto;
    bottom: 100px;
    left: 20px;
    right: 20px;
  }
}

@media (max-width: 480px) {
  .tab-btn {
    padding: 12px 16px;
    font-size: 0.9rem;
  }

  .upload-area {
    padding: 30px 15px;
  }

  .btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }
}
