body {
  margin: 0;
  font-family: 'Inter', Arial, sans-serif;
  background: linear-gradient(135deg, #f3f7fa 0%, #e0e7ff 100%);
  color: #222;
  min-height: 100vh;
}
/* Tool page container for centering content */
 .sidebar {
  flex: 0 0 220px;
  background: #f1f3f6;
  padding: 32px 16px;
  min-height: 300px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.sidebar.left {
  border-right: 1px solid #e0e7ef;
}
.sidebar.right {
  border-left: 1px solid #e0e7ef;
}
.ad-placeholder {
  width: 100%;
  min-height: 180px;
  background: #e0e7ef;
  border: 2px dashed #b0b8c1;
  color: #7a869a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  border-radius: 10px;
  margin-bottom: 16px;
}
.main-content {
  flex: 1;
  padding: 0 16px 36px 16px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0;
}
.main-content h1 {
  margin: 0;
  padding: 0 0 12px 0;
  font-size: 2em;
  color: #2a4d8f;
  font-weight: 700;
  letter-spacing: 0.5px;
  width: 100%;
  text-align: center;
}
.tool-categories {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}
.tool-categories h2 {
  margin-top: 16px;
  margin-bottom: 12px;
  font-size: 1.35em;
  font-weight: 600;
  color: #2a4d8f;
  background: linear-gradient(90deg, #e0e7ff 60%, #f8fafc 100%);
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(44, 62, 80, 0.04);
  letter-spacing: 0.5px;
}
.tool-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  padding: 14px 0 8px 0;
  justify-content: center;
  margin: 0 0 32px 0;
  padding: 0;
}
.tool-card {
  background: #f8fafc;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(44, 62, 80, 0.08);
  padding: 36px 24px 28px 24px;
  min-width: 0;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: #2a4d8f;
  font-size: 1.13em;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1.5px solid #e0e7ff;
}
.tool-card:hover {
  transform: translateY(-8px) scale(1.04);
  box-shadow: 0 8px 32px rgba(44, 62, 80, 0.16);
  color: #1a2d4f;
  border: 1.5px solid #4f8cff;
  background: #f0f6ff;
}
.tool-card i {
  font-size: 2.7em;
  margin-bottom: 16px;
  color: #4f8cff;
  display: block;
}
.tool-card div {
  font-weight: 600;
  font-size: 1.13em;
  margin-bottom: 6px;
}
.tool-card small {
  color: #4f5d75;
  font-size: 0.98em;
  margin-top: 4px;
  display: block;
  line-height: 1.5;
}
form {
  width: 100%;
  max-width: 480px;
  margin: 0 auto 24px auto;
  background: #f8fafc;
  padding: 28px 24px 18px 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(44, 62, 80, 0.07);
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}
form input[type="text"], form textarea {
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #b0b8c1;
  font-size: 1.08em;
  background: #fff;
  transition: border 0.2s;
  box-sizing: border-box;
}
/* Improved form elements for mobile */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="url"],
textarea {
  width: 100%;
  padding: 12px;
  font-size: 16px; /* Prevents iOS zoom on focus */
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-bottom: 12px;
}
textarea {
  min-height: 120px;
  line-height: 1.4;
}
form input[type="text"]:focus, form textarea:focus {
  border: 1.5px solid #4f8cff;
  outline: none;
}
form button {
  padding: 13px 18px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(90deg, #2a4d8f 60%, #4f8cff 100%);
  color: #fff;
  font-size: 1.08em;
  font-weight: 600;
  cursor: pointer;
  margin-right: 0;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(44, 62, 80, 0.07);
  min-width: 120px;
}
form button:hover {
  background: linear-gradient(90deg, #1a2d4f 60%, #2a4d8f 100%);
}
form .button-group {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
}
.result textarea, .result pre {
  width: 100%;
  margin-top: 10px;
  font-size: 1em;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #b0b8c1;
  background: #f8f9fa;
  resize: vertical;
}
.error {
  color: #e74c3c;
  background: #fff0f0;
  border: 1px solid #e74c3c;
  border-radius: 6px;
  padding: 10px;
  margin-top: 10px;
  width: 100%;
  max-width: 480px;
}
footer {
  background: linear-gradient(90deg, #2a4d8f 60%, #4f8cff 100%);
  color: #fff;
  text-align: center;
  padding: 18px 0;
  font-size: 1em;
  margin-top: 40px;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 -2px 8px rgba(44, 62, 80, 0.07);
}
/* Medium screens */
@media (max-width: 900px) {
  .container {
    flex-direction: column;
    box-shadow: none;
    border-radius: 0;
  }
  .sidebar {
    flex: none;
    min-height: 100px;
    flex-direction: row;
    justify-content: space-around;
    padding: 10px 0;
  padding: 18px 16px 36px 16px;
    max-width: 100%;
  }
  .sidebar.left, .sidebar.right {
    width: 100%;
    max-width: 100%;
  }
  .sidebar.right {
    order: 3;
  }
  .main-content {
    padding: 16px 4px;
    order: 2;
  }
  .tool-categories {
    padding: 0 8px;
    width: calc(100% - 16px);
    margin: 0 auto;
  }
  /* Improve sidebar ad display on medium screens */
  .ad-placeholder {
    width: 45%;
    min-height: 120px;
    display: inline-flex;
    margin: 0 5px;
  }
  /* Show second ad placeholder on medium screens */
  .sidebar.right .ad-placeholder[style*="display: none"] {
    display: inline-flex !important;
  }
}
@media (max-width: 600px) {
  .main-content h1 {
    font-size: 1.5em;
  }
  .tool-categories h2 {
    font-size: 1.13em;
    padding: 7px 10px;
    margin-top: 32px;
    margin-bottom: 12px;
    font-weight: 700;
    background: #e0e7ff;
    border-radius: 8px;
    box-shadow: none;
    color: #2a4d8f;
    display: block;
  }
  .tool-list {
    grid-template-columns: 1fr;
    gap: 18px;
    width: calc(100% - 16px);
    margin: 0 auto;
  }
  .tool-card {
    padding: 22px 8px 18px 8px;
    font-size: 1em;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    width: calc(100% - 16px);
    margin: 0 auto;
  }
  .tool-card:hover {
    transform: translateY(-4px) scale(1.02);
  }
  .sidebar {
    display: none;
  }
  .container {
    margin: 0;
    box-shadow: none;
    border-radius: 0;
  }
  .ad-placeholder {
    min-height: 80px;
    font-size: 0.95em;
  }
  /* Improved button styling for mobile */
  .button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: calc(100% - 20px);
    margin: 10px auto;
    padding: 0 10px;
  }
  .button-group button {
    flex: 1;
    min-width: 90px;
    max-width: calc(100% - 20px);
    padding: 10px 8px;
    font-size: 1em;
    border-radius: 8px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
  }
  form {
    padding: 16px 12px;
    margin-bottom: 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  }
  .qr-code-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 0 12px 0;
    width: 100%;
  }
  .qr-code-container img {
    max-width: 90vw;
    height: auto;
    margin: 0 auto;
    display: block;
    box-sizing: border-box;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }
  /* Improve form elements on small screens */
  form input[type="text"], form textarea {
    font-size: 16px; /* Prevent iOS zoom on focus */
    padding: 10px;
    border-radius: 8px;
    width: calc(100% - 10px);
    margin-left: 5px;
    margin-right: 5px;
  }
  form button {
    width: calc(100% - 20px);
    margin-top: 8px;
    margin-left: 10px;
    margin-right: 10px;
    padding: 10px 14px;
    height: 42px;
    font-size: 1em;
  }
  form .button-group {
    flex-direction: column;
    width: calc(100% - 20px);
    margin: 10px auto;
    gap: 10px;
  }
}
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4vw;
  background: linear-gradient(90deg, #2a4d8f 60%, #4f8cff 100%);
  position: relative;
}
.site-title {
  margin: 0;
  font-size: 2.3em;
  letter-spacing: 1px;
  font-weight: 700;
  flex: 1;
  text-align: left;
  color: #fff;
  text-shadow: 0 2px 8px rgba(44,62,80,0.18);
}
.tool-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  box-shadow: none;
  max-width: 340px;
  width: 100%;
  margin-left: auto;
}
.tool-search-bar input[type="text"] {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #b0b8c1;
  font-size: 1em;
  min-width: 160px;
  background: #fff;
  transition: border 0.2s;
  width: 100%;
}
.tool-search-bar input[type="text"]:focus {
  border: 1.5px solid #4f8cff;
  outline: none;
}
.tool-search-bar button {
  background: #4f8cff;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s;
}
.tool-search-bar button:hover {
  background: #2a4d8f;
}
@media (max-width: 900px) {
  .main-header {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 2vw 6px 2vw;
  }
  .site-title {
    text-align: center;
    width: 100%;
  }
  .tool-search-bar {
    margin-top: 8px;
    width: 100%;
    max-width: 100%;
    justify-content: center;
  }
  .tool-search-bar input[type="text"] {
    width: 100%;
    min-width: 0;
    background: #fff;
  }
}
@media (max-width: 600px) {
  .main-header {
    flex-direction: column;
    align-items: stretch;
    padding: 8px 2vw 4px 2vw;
  }
  .site-title {
    font-size: 1.5em;
    text-align: center;
    width: 100%;
  }
  .tool-search-bar {
    margin-top: 6px;
    width: 100%;
    background: none;
    box-shadow: none;
    padding: 0;
    justify-content: center;
  }
  .tool-search-bar input[type="text"] {
    width: 100%;
    min-width: 0;
    background: #fff;
    border: 1px solid #b0b8c1;
  }
  .tool-search-bar button {
    padding: 8px 12px;
    font-size: 1em;
  }
}
/* QR Generator Specific Styles */
.qr-generator-form {
  align-items: stretch !important;
  box-sizing: border-box;
  width: 100%;
  max-width: 400px;
  margin: 0 auto 24px auto;
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 2px 12px #0001;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.qr-generator-form input[type="text"] {
  width: 100%;
  font-size: 1.1em;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}
.qr-generator-form button[type="submit"] {
  width: 100%;
  font-size: 1.1em;
  padding: 10px;
  background: linear-gradient(90deg,#2563eb,#3b82f6);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
@media (max-width: 600px) {
  .qr-generator-form {
    max-width: 98vw;
    padding: 12px 4vw 8px 4vw;
  }
}