/* Tool Container Styles */
.tool-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* HTML Tool Styles — golden luxury */
.html-tool {
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.97), rgba(248, 238, 222, 0.97));
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 14px 36px -24px rgba(94, 65, 30, 0.35);
  border: 1px solid rgba(145, 103, 48, 0.2);
}

.html-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.input-section,
.preview-section {
  display: flex;
  flex-direction: column;
}

.input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: rgba(182, 138, 58, 0.08);
  border-bottom: 1px solid rgba(145, 103, 48, 0.12);
  border-radius: 8px 8px 0 0;
}

.code-tabs {
  display: flex;
  gap: 10px;
  margin: 0;
  flex: 1;
}

.code-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #7a572c;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
}

.code-tab:hover {
  background: rgba(182, 138, 58, 0.1);
  border-color: rgba(145, 103, 48, 0.22);
}

.code-tab.active {
  background: rgba(182, 138, 58, 0.18);
  border-color: rgba(145, 103, 48, 0.35);
  color: #5e4329;
}

.code-tab i {
  font-size: 1.1rem;
}

.code-input {
  width: 100%;
  background: #fffaf2;
  border: 1px solid rgba(145, 103, 48, 0.26);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 16px;
  color: #4a351f;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  resize: none;
  transition: all 0.3s ease;
  box-sizing: border-box;
  display: none;
  min-height: 400px;
  max-height: 600px;
  height: 400px;
}

.code-input.active {
  display: block;
}

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

.code-input::placeholder {
  color: #8c7558;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: rgba(182, 138, 58, 0.08);
  border-bottom: 1px solid rgba(145, 103, 48, 0.12);
  border-radius: 8px 8px 0 0;
}

.result-header h3 {
  color: #5e4329;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-header h3 i {
  font-size: 1rem;
}

.copy-btn-small {
  background: transparent;
  border: 1px solid rgba(145, 103, 48, 0.28);
  color: #7a572c;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.copy-btn-small:hover {
  background: rgba(182, 138, 58, 0.12);
  border-color: #ab7c34;
  transform: scale(1.05);
}

.html-preview-iframe {
  flex: 1;
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(145, 103, 48, 0.2);
  border-radius: 0 0 8px 8px;
  border-top: none;
  min-height: 400px;
  max-height: 600px;
  box-sizing: border-box;
}

.action-buttons.btn-contain-x {
  margin-bottom: 25px;
}

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

  .html-tool {
    padding: 25px 20px;
  }

  .html-wrapper {
    grid-template-columns: 1fr;
  }

  .input-header {
    padding: 12px 15px;
  }

  .code-tabs {
    flex-wrap: wrap;
    gap: 8px;
  }

  .code-tab {
    flex: 1;
    min-width: 80px;
    justify-content: center;
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .html-preview-iframe {
    min-height: 300px;
    max-height: 400px;
  }

  .code-input {
    min-height: 300px;
    max-height: 400px;
    height: 300px;
  }

  .result-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .copy-btn-small.copied,
  #copyHtmlBtn.copied {
    animation: copyPulse 0.6s ease;
    box-shadow: 0 0 12px rgba(182, 138, 58, 0.35);
  }

  .copy-btn-small.copied svg,
  #copyHtmlBtn.copied svg {
    display: inline-block;
    vertical-align: middle;
  }

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

  .copy-btn-small {
    width: auto;
    flex-shrink: 0;
  }
}
