/* ========================================
   TOOLS PAGE STYLES
   ======================================== */

/* Tool container */
.tool-container {
  text-align: center;
  margin-top: 40px;
  padding: 0 20px;
  flex: 1;
}

.tool-container h1 {
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* Tool intro text */
.tool-intro {
  text-align: center;
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.7;
}

/* ========================================
   TEXTAREA & INPUTS
   ======================================== */

textarea {
  width: 100%;
  min-height: 180px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  resize: vertical;
  transition: var(--transition);
  line-height: 1.6;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: var(--bg-white);
}

textarea::placeholder {
  color: var(--text-tertiary);
}

/* ========================================
   BUTTONS IN TOOLS
   ======================================== */

.btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 28px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

button:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

button:active {
  transform: translateY(0);
}

.copy-btn {
  padding: 8px 12px;
  font-size: 13px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.copy-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* ========================================
   ACTION AREA
   ======================================== */

.action-area {
  margin-top: 20px;
  margin-bottom: 32px;
  /* display: flex; */
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* ========================================
   RESULTS SECTION
   ======================================== */

.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 32px;
  animation: fadeInUp 0.6s ease-out;
}

.results p {
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-primary);
  text-align: center;
  transition: var(--transition);
  word-break: break-word;
}

.results p:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.results p span {
  display: block;
  font-weight: 700;
  color: var(--primary);
  font-size: 18px;
  margin-top: 4px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  gap: 12px;
  transition: var(--transition);
}

.result-row:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.result-row span {
  color: var(--primary);
  font-weight: 700;
  word-break: break-all;
  flex: 1;
}

/* ========================================
   INPUT GROUPS
   ======================================== */

.input-group {
  margin-top: 16px;
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.input-group input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-primary);
  transition: var(--transition);
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: var(--bg-white);
}

.input-group input::placeholder {
  color: var(--text-tertiary);
}

/* ========================================
   CALCULATION BOXES
   ======================================== */

.calc-box {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-top: 24px;
  margin-bottom: 24px;
  text-align: center;
  transition: var(--transition);
}

.calc-box:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.calc-box h3 {
  margin-bottom: 16px;
  font-size: 18px;
  color: var(--text-primary);
}

.calc-box input {
  width: auto;
  max-width: 200px;
  padding: 10px 16px;
  margin: 8px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-primary);
  text-align: center;
  transition: var(--transition);
}

.calc-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.calc-box button {
  margin-top: 12px;
}

.calc-box p {
  margin-top: 16px;
  font-weight: 600;
  color: var(--primary);
  font-size: 16px;
}

/* ========================================
   CHECKBOX GROUPS
   ======================================== */

.checkbox-group {
  margin-top: 16px;
  margin-bottom: 16px;
  text-align: left;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* ========================================
   SPECIAL RESULTS
   ======================================== */

#passwordResult,
#resultLink,
#outputText {
  font-weight: 600;
  color: var(--primary);
  word-break: break-all;
  padding: 12px;
  background: var(--primary-light);
  border-radius: var(--radius);
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

#resultLink {
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
}

#resultLink:hover {
  text-decoration: underline;
}

/* ========================================
   MOBILE RESPONSIVENESS
   ======================================== */

@media (max-width: 768px) {
  .tool-container {
    text-align: center;
    margin-top: 30px;
    padding: 0 16px;
  }

  .tool-container h1 {
    font-size: 22px;
  }

  textarea {
    min-height: 140px;
    font-size: 16px;
    /* Prevents zoom on mobile */
  }

  .results {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
  }

  .action-area {
    flex-direction: column;
  }

  .action-area button {
    width: 100%;
  }

  .calc-box input {
    max-width: 100%;
    width: 100%;
    margin: 8px 0;
  }

  .input-group input {
    font-size: 16px;
    /* Prevents zoom on mobile */
  }
}

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

  .tool-container h1 {
    font-size: 20px;
  }

  .tool-intro {
    font-size: 14px;
  }

  textarea {
    min-height: 120px;
  }

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

  button {
    width: 100%;
  }

  .result-row {
    flex-direction: column;
    text-align: center;
  }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ensure animations respect prefer-reduced-motion */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   PAGE LAYOUTS
   ======================================== */

.about-container,
.contact-container,
.page-title {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.page-title {
  text-align: center;
  margin-bottom: 32px;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Card design for about/contact pages */
.card {
  background: var(--bg-card);
  padding: 24px;
  margin-bottom: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.card h2 {
  margin-bottom: 12px;
  color: var(--text-primary);
}

.card h3 {
  margin-bottom: 8px;
  color: var(--text-primary);
}

.card p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 12px;
}

.card ul {
  padding-left: 24px;
  margin: 12px 0;
}

.card li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.contact-form input,
.contact-form textarea {
  padding: 11px 14px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  transition: var(--transition);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-tertiary);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: var(--bg-white);
}

.contact-form button {
  margin-top: 8px;
}

@media (max-width: 768px) {
  .page-title {
    font-size: 24px;
  }

  .card {
    padding: 18px;
  }

  .contact-form {
    padding: 18px;
  }
}