/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e0e7ff 100%);
  color: #333;
  line-height: 1.5;
  min-height: 100vh;
}

.layout {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, 800px) minmax(120px, 1fr);
  gap: 20px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px;
}

main {
  grid-column: 2;
  text-align: center;
}

.ad-placeholder {
  width: 160px;
  height: 600px;
  flex-shrink: 0;
}

.ad-left, .ad-right {
  min-width: 0;
}

.ad-left {
  grid-column: 1;
}

.ad-right {
  grid-column: 3;
}

header {
  margin-bottom: 1rem;
  padding: 1rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

header.hero {
  position: relative;
  padding: 2rem 1rem;
  background: url('images/hero-utilish.jpg') no-repeat center center;
  background-size: cover;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

header.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

header.hero .header-icon,
header.hero h1 {
  position: relative;
  z-index: 2;
}

.header-icon {
  font-size: 2.5rem;
  color: #007bff;
  margin-bottom: 0.75rem;
  display: block;
  animation: pulse 2s infinite;
}

header.hero .header-icon {
  color: #fff;
  font-size: 3rem;
}

h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  color: #222;
}

header.hero h1 {
  color: #fff;
  font-size: 2rem;
}

header.hero p,
header.hero a {
  color: #ddd;
  position: relative;
  z-index: 2;
}

p a {
  color: #007bff;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

p a:hover {
  color: #0056b3;
  text-decoration: underline;
}

.intro {
  font-size: 1rem;
  margin-bottom: 2.5rem;
  color: #555;
  background: rgba(255, 255, 255, 0.8);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.tool-links {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 2.5rem 0;
}

.tool-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  background: linear-gradient(45deg, #007bff, #00c4ff);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(0, 123, 255, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.tool-button i {
  margin-right: 0.5rem;
}

.tool-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 123, 255, 0.4);
}

.features {
  margin: 2.5rem 0;
  padding: 1.5rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.features h2 {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  color: #222;
}

.features ul {
  list-style: none;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.features li {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: #444;
  display: flex;
  align-items: center;
  text-align: left;
  max-width: 100%;
  transition: transform 0.2s;
}

.features li:hover {
  transform: translateX(5px);
}

.features i {
  margin-right: 0.75rem;
  color: #007bff;
  min-width: 1.25rem;
}

.features strong {
  color: #222;
  margin-right: 0.5rem;
}

.controls, .passphrase-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
  background: #fff;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.5rem;
}

label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
}

input[type="checkbox"] {
  accent-color: #007bff;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#length-slider, #word-count-slider {
  flex-grow: 1;
  width: 100%;
  accent-color: #007bff;
}

#length-value, #word-count-value {
  font-size: 1rem;
  color: #555;
  min-width: 2rem;
  text-align: center;
}

#password-output, #passphrase-output {
  font-size: 1.5rem;
  font-family: 'Courier New', 'Roboto Mono', monospace;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  word-break: break-all;
  margin: 0.5rem auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  max-width: 100%;
}

button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  background: linear-gradient(45deg, #007bff, #00c4ff);
  color: #fff;
  border: none;
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(0, 123, 255, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  margin: 0.25rem 0;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 123, 255, 0.4);
}

#copy-btn, #passphrase-copy-btn {
  background: linear-gradient(45deg, #28a745, #34d058);
  min-width: 14rem; /* Set to accommodate "Copied to Clipboard!" on desktop */
  white-space: nowrap; /* Prevent text wrapping */
}

#copy-btn:hover, #passphrase-copy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(40, 167, 69, 0.4);
}

.strength-container {
  margin: 0.5rem 0;
}

.strength-bar {
  width: 100%;
  height: 0.5rem;
  background: #e0e0e0;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.strength-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.strength-text {
  font-size: 0.875rem;
  margin-top: 0.25rem;
  color: #666;
}

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

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    padding: 10px;
  }
  .ad-placeholder {
    width: 100%;
    height: 50px;
    max-width: 320px;
    margin: 0 auto;
  }
  .ad-left, .ad-right {
    grid-column: 1;
  }
  .ad-left {
    grid-row: 1;
  }
  main {
    grid-column: 1;
    grid-row: 2;
  }
  .ad-right {
    grid-row: 3;
  }
}

@media (max-width: 600px) {
  html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
  }
  .layout {
    padding: 0;
    margin: 0;
    max-width: 100%;
    width: 100%;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 0;
  }
  main {
    grid-column: 1;
    width: 100%;
    margin: 0;
    padding: 0;
  }
  header {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 0;
  }
  header.hero {
    padding: 1.5rem 0.75rem;
    border-radius: 0;
  }
  .header-icon {
    font-size: 2.25rem;
  }
  header.hero .header-icon {
    font-size: 2.75rem;
  }
  h1 {
    font-size: 1.75rem;
  }
  header.hero h1 {
    font-size: 2rem;
  }
  .intro {
    font-size: 1.125rem;
    padding: 0.5rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0;
  }
  .tool-links {
    gap: 1rem;
    margin: 1.5rem 0;
  }
  .tool-button {
    padding: 0.6rem 1.2rem;
    font-size: 1.125rem;
    border-radius: 0;
  }
  .features {
    padding: 2rem;
    margin: 2.5rem 0;
    border-radius: 0;
  }
  .features h2 {
    font-size: 1.375rem;
    margin-bottom: 1.5rem;
  }
  .features ul {
    align-items: center;
    padding: 0;
  }
  .features li {
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.8;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .features i {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    color: #007bff;
  }
  .features strong {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #222;
  }
  .features .description {
    display: block;
    color: #444;
  }
  .controls, .passphrase-controls {
    padding: 0.75rem;
    margin: 0.25rem 0 0.5rem;
    gap: 0.5rem;
    border-radius: 0;
  }
  .checkbox-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem 1rem;
  }
  label {
    font-size: 1.125rem;
  }
  #password-output, #passphrase-output {
    font-size: 1.5rem;
    padding: 0.5rem;
    margin: 0.25rem auto;
    border-radius: 0;
  }
  button {
    padding: 0.5rem 1rem;
    font-size: 1.125rem;
    margin: 0.15rem 0;
    border-radius: 0;
  }
  #copy-btn {
    min-width: 12rem; /* Already set for mobile */
    white-space: nowrap;
  }
  button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 123, 255, 0.4);
  }
}

/* Tablet Breakpoint for iPad Air (601px–959px) */
@media (min-width: 601px) and (max-width: 959px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    padding: 10px;
    margin: 0 auto;
    max-width: 100%;
    width: 90%;
  }
  main {
    grid-row: 2;
    grid-column: 1;
    width: 100%;
  }
  .ad-placeholder {
    width: 100%;
    height: 50px;
    max-width: 320px;
    margin: 0 auto;
  }
  .ad-left { grid-row: 1; }
  .ad-right { grid-row: 3; }
  header {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  header.hero {
    padding: 1.5rem;
    margin: 0 auto;
    width: 100%;
    border-radius: 0;
  }
  .intro {
    margin-bottom: 2rem;
  }
  .tool-links {
    margin: 2rem 0;
  }
  .tool-button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
  .features {
    margin: 2rem 0;
    padding: 1.5rem;
  }
  .features h2 {
    font-size: 1.25rem;
  }
  .features li {
    font-size: 0.95rem;
  }
  .controls, .passphrase-controls {
    margin: 0.5rem 0 1rem;
    padding: 1rem;
  }
  .checkbox-grid {
    grid-template-columns: 1fr 1fr;
  }
  #password-output, #passphrase-output {
    font-size: 1.5rem;
    padding: 0.75rem;
  }
  button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
  #copy-btn {
    min-width: 14rem; /* Ensure consistency in tablet view */
    white-space: nowrap;
  }
}

button.copied::after {
  content: ' ✓';
  color: #fff;
}

/* Footer Styles (from utilish.com) */
footer {
  background: #f8f9fa;
  border-top: 1px solid #ddd;
  margin-top: 2rem;
}

footer .footer-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1rem 20px;
  text-align: center;
  color: #333;
  font-size: 0.9rem;
}

footer a {
  color: #007bff;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

@media (max-width: 960px) {
  footer .footer-content {
    padding: 1rem 10px;
  }
}

@media (max-width: 600px) {
  footer .footer-content {
    padding: 1rem 0;
  }
}

@media (min-width: 601px) and (max-width: 959px) {
  footer .footer-content {
    padding: 1rem 10px;
  }
}

/* Content Section for Pages like Privacy Policy */
.content {
  margin: 2rem 0;
  padding: 1.5rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-align: center; /* Center all text */
}

.content h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #222;
}

.content h3 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem;
  color: #222;
}

.content p {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #444;
  max-width: 600px; /* Limit width for readability */
  margin-left: auto; /* Center the paragraph block */
  margin-right: auto;
}

.content a {
  color: #007bff;
  text-decoration: none;
}

.content a:hover {
  color: #0056b3;
  text-decoration: underline;
}

/* Left-align the email link for better readability */
.content p a[href^="mailto:"] {
  display: inline-block;
  text-align: left;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
  .content {
    padding: 1rem;
    margin: 1.5rem 0;
    border-radius: 0;
  }
  .content h2 {
    font-size: 1.375rem;
  }
  .content h3 {
    font-size: 1.125rem;
  }
  .content p {
    font-size: 1rem;
  }
}

@media (min-width: 601px) and (max-width: 959px) {
  .content {
    margin: 2rem 0;
    padding: 1.5rem;
  }
}
