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 */
.format-options {
  display: flex;
  gap: 30px;
  align-items: center;
  margin-bottom: 15px;
}

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

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

/* 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 Base */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(30, 30, 47, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.hidden {
  display: none !important;
}

/* Modal Content */
.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;
}

.sending-modal-content {
  max-width: 520px;
  padding: 30px 35px;
}

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

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

/* Sending Progress Modal Styles */
#sendingStatus {
  margin: 20px 0;
  font-size: 1.1em;
  min-height: 1.6em;
  text-align: center;
  color: #d8dee9;
}

.sending-controls {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 25px;
  flex-wrap: wrap;
}

.control-btn {
  padding: 12px 24px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  min-width: 110px;
}

.control-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

#pauseBtn, #resumeBtn {
  background-color: #ff9800;
  color: white;
}

#pauseBtn:hover {
  background-color: #f57c00;
}

#resumeBtn:hover {
  background-color: #ffb74d;
}

#stopBtn {
  background-color: #f44336;
  color: white;
}

#stopBtn:hover {
  background-color: #d32f2f;
}

/* Progress Bar */
#progressBarContainer {
  height: 10px;
  background-color: #2c2c44;
  border-radius: 10px;
  overflow: hidden;
  margin: 20px 0;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

/* Summary */
#sendingSummary {
  margin-top: 20px;
  padding: 15px;
  background-color: #2c2c44;
  border-radius: 8px;
  text-align: left;
  font-size: 15px;
  line-height: 1.6;
}

#sendingSummary p {
  margin: 8px 0;
}

/* 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;
}

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

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

.attach-smtp-thread-container input[type="number"] {
  width: 70px;
}

/* Scrollbar */
.side-panel::-webkit-scrollbar {
  width: 7px;
}
.side-panel::-webkit-scrollbar-thumb {
  background-color: #81a1c1;
  border-radius: 10px;
}
.side-panel::-webkit-scrollbar-thumb:hover {
  background-color: #a1b9d6;
}
.side-panel::-webkit-scrollbar-track {
  background-color: #22253a;
}

/* Loader (kept for fallback) */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(30, 30, 47, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.loader-content {
  background-color: #3b3e5a;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0,0,0,0.7);
  color: #d8dee9;
  text-align: center;
  min-width: 400px;
}

/* Preview Modal */
#previewModal .modal-content {
  max-width: 620px;
  padding: 25px;
}

#previewContent {
  background-color: #2c2c44;
  padding: 18px;
  border-radius: 8px;
  color: #eee;
  max-height: 420px;
  overflow-y: auto;
  line-height: 1.5;
}

/* Consent checkbox */
.form-group label[for="consent"] {
  font-size: 14.5px;
  color: #ccc;
  line-height: 1.5;
}

/* Media Queries */
@media (max-width: 1200px) {
  .layout-container {
    flex-direction: column;
    align-items: center;
  }
  .side-panel, .mailer-container {
    width: 100%;
    margin-bottom: 20px;
  }
}

@media (max-width: 768px) {
  .attach-smtp-thread-container {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }
  .modal-content, .sending-modal-content {
    max-width: 92%;
    padding: 20px;
  }
  .sending-controls {
    flex-direction: column;
    align-items: center;
  }
  button {
    width: 100%;
    margin-top: 8px;
  }
}