body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #1e1e2f;
  color: #ccc;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.layout-container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px;
  gap: 20px;
  min-height: 100vh;
  box-sizing: border-box;
}

/* Side panels (SMTP List and Tags) */
.side-panel {
  width: 25%;
  background-color: #2c2c44;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
  color: #ccc;
  overflow-y: auto;
  max-height: 90vh;
  scrollbar-width: thin;
  scrollbar-color: #81a1c1 #22253a;
}

.side-panel h3 {
  margin-top: 0;
  color: #81a1c1;
  font-weight: 600;
  text-shadow: 0 0 3px rgba(129, 161, 193, 0.7);
}

/* Main mailer container */
.mailer-container {
  width: 50%;
  background-color: #28293d;
  padding: 30px 25px;
  border-radius: 12px;
  box-shadow: 0 0 25px rgba(0,0,0,0.7);
  color: #eee;
  transition: box-shadow 0.3s ease;
}

.mailer-container h2 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #88c0d0;
  font-weight: 700;
  text-shadow: 0 0 5px #88c0d0;
}

/* Form groups */
.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #a3a9bc;
  user-select: none;
  transition: color 0.3s ease;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #555a7a;
  background-color: #3b3e5a;
  color: #eee;
  font-size: 15px;
  box-sizing: border-box;
  transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  outline: 2px solid #81a1c1;
  outline-offset: 2px;
  border-color: #81a1c1;
  background-color: #434763;
  color: #fff;
}

textarea {
  resize: vertical;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Checkboxes container for format options */
.format-options {
  display: flex;
  gap: 30px;
  align-items: center;
  margin-bottom: 15px;
}

/* Style checkboxes with labels inline */
.format-options label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 500;
  color: #a3a9bc;
  user-select: none;
  font-size: 15px;
  transition: color 0.3s ease;
}

.format-options input[type="checkbox"] {
  margin-right: 8px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #81a1c1;
}

/* General checkboxes style */
input[type="checkbox"] {
  cursor: pointer;
  accent-color: #81a1c1;
  width: 18px;
  height: 18px;
  margin-right: 6px;
}

/* Buttons */
button {
  background-color: #5e81ac;
  color: #eceff4;
  padding: 12px 25px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease, box-shadow 0.25s ease;
  box-shadow: 0 3px 6px rgba(94,129,172,0.5);
}

button:hover,
button:focus {
  background-color: #81a1c1;
  box-shadow: 0 6px 12px rgba(129,161,193,0.7);
  outline: none;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(30, 30, 47, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  background-color: #3b3e5a;
  padding: 25px 30px;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 0 20px rgba(0,0,0,0.7);
  color: #d8dee9;
  transition: transform 0.3s ease;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 26px;
  font-weight: 700;
  cursor: pointer;
  color: #88c0d0;
  user-select: none;
  transition: color 0.3s ease;
}

.close-btn:hover {
  color: #a3c0e0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background-color: #2c2c44;
  color: #d8dee9;
  font-size: 14px;
}

table thead tr {
  background-color: #434763;
}

table th,
table td {
  padding: 10px 12px;
  border: 1px solid #3b3e5a;
  text-align: left;
}

table tbody tr:hover {
  background-color: #4c5176;
  transition: background-color 0.3s ease;
}

/* Html attachment section */
.html-attachment {
  margin-top: 10px;
  padding: 15px;
  background-color: #2e2f51;
  border-radius: 8px;
  border: 1px solid #555a7a;
  color: #ccc;
}

/* Scrollbar for side panels (optional) */
.side-panel::-webkit-scrollbar {
  width: 7px;
}

.side-panel::-webkit-scrollbar-thumb {
  background-color: #81a1c1;
  border-radius: 10px;
  transition: background-color 0.3s ease;
}

.side-panel::-webkit-scrollbar-thumb:hover {
  background-color: #a1b9d6;
}

.side-panel::-webkit-scrollbar-track {
  background-color: #22253a;
}

/* ----------- NEW: Horizontal arrangement for Attachment, HTML Attachment, Use SMTP, Thread Count ----------- */

.attach-smtp-thread-container {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: nowrap;
  margin-bottom: 15px;
}

.attach-smtp-thread-container label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 500;
  color: #a3a9bc;
  user-select: none;
  font-size: 15px;
  transition: color 0.3s ease;
}

.attach-smtp-thread-container input[type="checkbox"],
.attach-smtp-thread-container input[type="number"],
.attach-smtp-thread-container input[type="text"] {
  margin-right: 8px;
  cursor: pointer;
  accent-color: #81a1c1;
  width: 18px;
  height: 18px;
}

.attach-smtp-thread-container input[type="number"] {
  width: 60px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid #555a7a;
  background-color: #3b3e5a;
  color: #eee;
  font-size: 15px;
  box-sizing: border-box;
  transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

/* Nested inputs hidden by default for HTML Attachment */
.html-attachment-nested {
  display: none;
  margin-left: 5px;
  font-size: 14px;
  color: #ccc;
}

/* Show nested inputs if HTML Attachment checkbox is checked */
#htmlAttachmentCheckbox:checked ~ .html-attachment-nested {
  display: inline-block;
}
