@import url('https://fonts.googleapis.com/css2?family=Aptos:wght@400;600&display=swap');

:root {
  --gradient-start: #ff6ec4;
  --gradient-end: #7873f5;
  --text: #333;
  --bg: #fff;
  --radius: 8px;
  --font: 'Aptos', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font);
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
}

.container {
  background: var(--bg);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 900px;
  position: relative;
}

header{
    text-align: center;
}
.header .title {
  font-size: 2.25rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  text-align: center;
  color: #ff6ec4;
}

.controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.select-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}

.select-group label {
  font-weight: 600;
}

.input-wrapper {
  position: relative;
}

.input-wrapper .icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
}

.input-wrapper input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.5rem;
  border: 1px solid #ccc;
  border-radius: var(--radius);
}

.select-group select {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: var(--radius);
}

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--gradient-start);
  transition: color 0.2s;
}

.icon-btn:hover {
  color: var(--gradient-end);
}

.swap {
  align-self: center;
  font-size: 1.5rem;
}

.text-group {
  margin-bottom: 1.5rem;
}

.textarea-wrapper {
  position: relative;
}

textarea {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  resize: vertical;
  min-height: 120px;
}

.clear-btn {
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #888;
}

.info, .actions, .extra {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

#char-count {
  font-size: 0.875rem;
  color: #666;
}

.primary-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
  transition: opacity 0.2s;
}

.primary-btn:hover:not(:disabled) {
  opacity: 0.9;
}

.primary-btn:disabled {
  background: #e0e0e0;
  color: #888;
  cursor: not-allowed;
}

.secondary-btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  background: #fff;
  color: var(--gradient-end);
  border: 1px solid var(--gradient-end);
  transition: background 0.2s;
}

.secondary-btn:hover:not(:disabled) {
  background: var(--secondary);
}

.secondary-btn:disabled {
  background: #e0e0e0;
  color: #888;
  border-color: #ccc;
  cursor: not-allowed;
}

/* Style file input */
.extra {
  position: relative;
}

#file-input {
  opacity: 0;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.extra label {
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--gradient-end), var(--gradient-start));
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  margin-right: 0.5rem;
}

.history {
  position: absolute;
  top: 2rem;
  right: -250px;
  width: 220px;
  background: #fafafa;
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  max-height: 80vh;
  overflow-y: auto;
}

.history h2 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.history ul {
  list-style: none;
  padding: 0;
}

.history li {
  padding: 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
}

.history li:hover {
 background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
 color: var(--bg);
}