/* Universal Tool Styles */
/* This CSS file handles all tool types with consistent styling */
:root {
  --text-1: #111827;
  --text-2: #6b7280;
  --text-dark-1: #333333;
  --text-medium-1: #555555;
  --text-light-1: #777777;
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

.header {
  text-align: center;
  margin: 1rem 0 2rem 0;
}

.header h1 {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-medium-1);
  margin-bottom: 0.5rem;
  letter-spacing: 0px;
}

.subtitle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  color: var(--text-medium);
  font-size: 1rem;
}

.ai-badge {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Main Tool Card */

/* Text Areas Layout */
.text-areas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

@media (max-width: 768px) {
  .text-areas {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.text-section {
  display: flex;
  flex-direction: column;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.5rem;
  position: relative;
}

.text-section label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.text-areas .text-area {
  min-height: 200px;
  border-radius: 12px;
  padding: 1rem 0;
  font-size: 16px;
  line-height: 1.6;
  resize: vertical;
  transition: all 0.3s ease;
  box-shadow: none;
  border: none;

  resize: none;
  font-size: 0.875rem;
  color: #111827;
  background: transparent;
  font-family: inherit;
  overflow-y: scroll;
  max-height: 400px;
}

.text-area:focus {
  outline: none;
  box-shadow: none;
  border: none;
}

.text-area::placeholder {
  color: var(--text-light);
}
.text-area.output-placeholder {
  color: var(--text-light);
}

/* Output Container */

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--secondary-light);
  color: white;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.copy-btn:hover,
.copy-btn:focus {
  background: var(--secondary-red);
  transform: translateY(-1px);
}

.copy-btn.success {
  background: #38a169;
}

.copy-icon {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

#checkIcon {
  display: none;
}

/* Status Indicator */
.status-indicator {
  margin-top: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  text-align: center;
  transition: all 0.3s ease;
}

/* .status-indicator.ready {
  background: #c6f6d5;
  color: #22543d;
} */

/* .status-indicator.processing {
  background: var(--secondary-0);
  color: var(--secondary-red);
  animation: pulse 2s infinite;
} */

.status-indicator.error {
  background: var(--secondary-0);
  color: var(--secondary-red);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Process Button */
.btn-container {
  width: 100%;
  display: flex;
  justify-content: center;
}

.process-btn {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  color: white;
  border: none;
  border-radius: 12px;
  padding: 16px 24px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.process-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px hsla(202, 85%, 61%, 0.3);
  background: linear-gradient(
    135deg,
    var(--primary-light) 0%,
    var(--primary) 100%
  );
}

.process-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.process-btn span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Loading State */
.loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

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

/* Features Section */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.feature-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
  display: block;
}

.feature-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--text-medium);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Messages */
.message {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.message.success {
  background: #c6f6d5;
  color: #22543d;
  border: 1px solid #9ae6b4;
}

.message.error {
  background: var(--secondary-0);
  color: var(--secondary-red);
  border: 1px solid var(--secondary-light);
}

.message.warning {
  background: #fefcbf;
  color: #744210;
  border: 1px solid #f6e05e;
}

/* MArk */
/* List styles for markdown output */
.output-area ul,
.output-area ol {
  margin: 1em 0;
  padding-left: 2em;
  line-height: 1.6;
  font-size: 1rem;
}

.output-area ul {
  list-style-type: disc;
  font-size: 1rem;
}

.output-area ol {
  list-style-type: decimal;
  font-size: 1rem;
}

.output-area li {
  margin: 0.5em 0;
  padding-left: 0.25em;
  font-size: 1rem;
}

/* Nested lists */
.output-area ul ul,
.output-area ol ol,
.output-area ul ol,
.output-area ol ul {
  margin: 0.25em 0;
  padding-left: 1.5em;
  font-size: 1rem;
}

.output-area ul ul {
  list-style-type: circle;
}

.output-area ul ul ul {
  list-style-type: square;
}

/* Additional markdown elements you might want */
.output-area h1,
.output-area h2,
.output-area h3,
.output-area h4,
.output-area h5,
.output-area h6 {
  margin: 1.2em 0 0.6em 0;
  font-weight: bold;
}

.output-area h1 {
  font-size: 1.5rem;
}
.output-area h2 {
  font-size: 1.3rem;
}
.output-area h3 {
  font-size: 1.1rem;
}

.output-area p {
  margin: 0.8em 0;
  line-height: 1.6;
  font-size: 1rem;
}

.output-area strong {
  font-weight: bold;
}

.output-area em {
  font-style: italic;
}

.output-area code {
  background: #f5f5f5;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.9em;
}

.output-area pre {
  background: #f5f5f5;
  padding: 1em;
  border-radius: 5px;
  overflow-x: auto;
  margin: 1em 0;
}

.output-area pre code {
  background: none;
  padding: 0;
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  .header {
    margin: 0.5rem 0;
  }
  .text-areas .text-area {
    min-height: 100px;
    max-height: 200px;
  }
  .tool-card {
    display: grid;
    grid-template-areas:
      "input"
      "button"
      "output";
    gap: 1rem;
  }

  .text-areas .text-section:first-child {
    grid-area: input;
  }

  .btn-container {
    grid-area: button;
  }

  .text-areas .text-section:last-child {
    grid-area: output;
  }

  /* Reset text-areas to not interfere */
  .text-areas {
    display: contents; /* Makes children act as direct children of grid */
  }
}

/* Responsive Design */
@media (max-width: 640px) {
  .container {
    padding: 8px;
  }

  .header h1 {
    font-size: 2rem;
  }

  .tool-card {
    padding: 20px;
  }

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

  .features {
    grid-template-columns: 1fr;
  }
}

/* Character Counter */
.char-counter {
  margin-top: auto;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-align: right;
  transition: color 0.2s ease;
}

.char-counter.error {
  color: var(--secondary-red);
  font-weight: 600;
}

.char-counter.error #charCount {
  color: var(--secondary-red);
}
