/* Modern CSS inspired by Tailwind CSS */

:root {
  --color-primary: #f92d57;
  --color-primary-rgb: 249, 45, 87;
  --color-primary-hover: #e01e54;
  --color-primary-dark: #c91448;
  --color-danger: #f92d57;
  --color-danger-rgb: 249, 45, 87;
  --color-danger-hover: #e01e54;
  --color-success: #34d399;
  --color-success-rgb: 52, 211, 153;
  --color-success-hover: #10b981;
}

/* Light theme colors */
:root, [data-theme="light"] {
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;
  
  /* Form and borders */
  --color-border: #d1d5db;
  --color-button-neutral: #f3f4f6;
  --color-hover: #e5e7eb;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-form-background: #ffffff;
  --color-form-focus: #f9fafb;
  --color-bg-body: #e5e7eb;
  
  /* AI analysis colors */
  --color-relevant: #34d399;
  --color-not-relevant: #9ca3af;
  --color-spam: #f92d57;
}

/* Dark theme colors */
[data-theme="dark"] {
  --color-gray-50: #1a1a1a;
  --color-gray-100: #2a2a2a;
  --color-gray-200: #3a3a3a;
  --color-gray-300: #4a4a4a;
  --color-gray-400: #6a6a6a;
  --color-gray-500: #8a8a8a;
  --color-gray-600: #aaaaaa;
  --color-gray-700: #cccccc;
  --color-gray-800: #eeeeee;
  --color-gray-900: #ffffff;
  
  /* Form and borders */
  --color-border: #3a3a3a;
  --color-button-neutral: #2a2a2a;
  --color-hover: #3a3a3a;
  --color-text: #ffffff;
  --color-text-muted: #aaaaaa;
  --color-form-background: #2a2a2a;
  --color-form-focus: #3a3a3a;
  --color-bg-body: #1a1a1a;
  
  /* AI analysis colors */
  --color-relevant: #34d399;
  --color-not-relevant: #8a8a8a;
  --color-spam: #f92d57;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--color-bg-body);
  color: var(--color-gray-800);
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Prevent background scrolling when modal is open */
body.modal-open {
  overflow: hidden;
}

/* Global scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-gray-100);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-300);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-400);
}

::-webkit-scrollbar-corner {
  background: var(--color-gray-100);
}

.container {
  max-width: 1200px;
  margin: 2rem auto;
  background-color: var(--color-gray-100);
  border-radius: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-gray-200);
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-gray-900);
}

.button-group {
  display: flex;
  gap: 0.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-weight: 500;
  border-radius: 1rem;
  border: none;
  cursor: pointer;
  transition: all 150ms ease-in-out;
  font-size: 0.875rem;
}

.prepare-email-modal .button {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  height: auto;
  min-height: auto;
}

.button-primary {
  background-color: var(--color-primary);
  color: white;
}

.button-primary:hover {
  background-color: var(--color-primary-hover);
}

.button-neutral {
  background-color: var(--color-gray-200);
  color: var(--color-gray-800);
}

.button-neutral:hover {
  background-color: var(--color-gray-300);
}

.button-danger {
  background-color: var(--color-danger);
  color: white;
}

.button-danger:hover {
  background-color: var(--color-danger-hover);
}

.button-success {
  background-color: var(--color-success);
  color: white;
}

.button-success:hover {
  background-color: var(--color-success-hover);
}

.button-forward {
  background-color: #f97316;
  color: white;
  margin-left: 0.5rem;
  padding: 0.375rem 0.75rem;
}

.button-forward:hover {
  background-color: #ea580c;
}

.forward-icon {
  font-size: 1.2rem;
  font-weight: bold;
}

.forward-container {
  margin-top: 1rem;
  text-align: center;
}

.email-list {
  width: 100%;
  border-collapse: collapse;
}

.email-list th {
  background-color: var(--color-gray-50);
  padding: 1rem;
  text-align: left;
  font-weight: 500;
  color: var(--color-gray-700);
  border-bottom: 1px solid var(--color-gray-200);
}

.email-list td {
  padding: 1rem;
  border: none;
  vertical-align: middle;
}

.email-row {
  transition: background-color 150ms ease-in-out;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  margin: 0.5rem;
  height: 80px;
}

.email-row.read {
  background-color: var(--color-gray-100);
}

.email-row.unread {
  background-color: var(--color-gray-200);
  font-weight: 500;
}

.email-row:hover {
  background-color: var(--color-hover);
  cursor: pointer;
}

.email-subject {
  font-weight: 500;
  color: var(--color-gray-900);
}

.email-label {
  display: inline-block;
  padding: 2px 8px;
  background-color: #e5e7eb;
  color: #6b7280;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.email-sender {
  color: var(--color-gray-700);
}

.email-date {
  white-space: nowrap;
  color: var(--color-gray-500);
  font-size: 0.875rem;
  text-align: right;
  min-width: 180px;
}

/* Email preview in list */
.email-preview {
  font-size: 0.75rem;
  color: var(--color-gray-600);
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

/* AI Analysis button and badge */
.email-actions {
  white-space: nowrap;
  text-align: center;
}

.ai-analyze-btn {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  min-width: 60px;
  background-color: var(--color-gray-100);
  color: var(--color-gray-700);
  border: 1px solid var(--color-gray-300);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ai-analyze-btn:hover {
  background-color: var(--color-gray-200);
  color: var(--color-gray-800);
}

/* AI button states based on analysis */
.ai-analyze-btn[data-analyzed="true"][data-result="Yes"] {
  background-color: #d1fae5; /* Light green */
  border-color: #a7f3d0;
  color: #065f46;
}

.ai-analyze-btn[data-analyzed="true"][data-result="Spam"] {
  background-color: #fee2e2; /* Light red */
  border-color: #fecaca;
  color: #b91c1c;
}

.ai-analyze-btn[data-analyzed="true"][data-result="No"] {
  background-color: #e5e7eb; /* Light gray */
  border-color: #d1d5db;
  color: #4b5563;
}

.ai-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.125rem 0.5rem;
}

.ai-badge.relevant {
  background-color: #d1fae5; /* Very light green background */
  color: #065f46; /* Darker green text for contrast */
}

.ai-badge.not-relevant {
  background-color: #e5e7eb; /* Light gray background */
  color: #4b5563; /* Darker gray text */
}

.ai-badge.spam {
  background-color: #fee2e2; /* Very light red background */
  color: #b91c1c; /* Darker red text for contrast */
}

/* AI Analysis section in modal */
.ai-analysis-section {
  background-color: var(--color-gray-50);
  border-radius: 0.375rem;
  padding: 1rem;
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}

.ai-analysis-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-gray-800);
  margin-bottom: 1rem;
}

.ai-analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 2rem;
}

.ai-analysis-item {
  display: flex;
  align-items: baseline;
}

.ai-analysis-label {
  font-weight: 500;
  color: var(--color-gray-700);
  margin-right: 0.5rem;
  min-width: 80px;
}

.ai-analysis-value {
  color: var(--color-gray-900);
}

.ai-analysis-value.relevant {
  color: var(--color-relevant);
  font-weight: 600;
}

.ai-analysis-value.not-relevant {
  color: var(--color-not-relevant);
}

.ai-analysis-value.spam {
  color: var(--color-spam);
  font-weight: 600;
}

.ai-analysis-value.not-spam {
  color: var(--color-success);
}

.ai-analysis-divider {
  border: 0;
  height: 1px;
  background-color: var(--color-gray-200);
  margin: 1rem 0;
}

.modal-footer {
  padding: 0;
  display: flex;
  justify-content: flex-end;
  margin: 0;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  background-color: transparent;
  width: fit-content;
  margin-left: auto;
}

.email-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 50;
  overflow: hidden;
}

.modal-content {
  background-color: var(--color-gray-100);
  margin: 1rem auto;
  padding: 0.625rem;
  border-radius: 2rem;
  max-width: 1000px;
  width: 50%;
  height: calc(100vh - 2rem);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  resize: horizontal;
  min-width: 600px;
  max-width: 95vw;
}

.close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  color: var(--color-gray-500);
  cursor: pointer;
  transition: color 150ms ease-in-out;
}

.close:hover {
  color: var(--color-gray-900);
}

.modal-header {
  border-bottom: 1px solid var(--color-gray-200);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}

.settings-modal .modal-header {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0.5rem;
}

.modal-subject {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-gray-900);
  margin-bottom: 0.5rem;
}

.modal-meta {
  color: var(--color-gray-600);
  font-size: 0.875rem;
}

.modal-body-container {
  flex: 1;
  min-height: 0;
  margin-bottom: 0.5rem;
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.modal-body {
  flex: 1;
  min-height: 0;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  width: 100%;
  background-color: var(--color-gray-200);
  overflow: hidden;
}

.email-content-iframe {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: none;
  border-radius: 1rem;
  background-color: transparent;
}

/* Scrollbar styling for modern browsers */
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: var(--color-gray-100);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--color-gray-400);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-500);
}

/* Loading spinner */
.loading {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--color-gray-200);
  border-radius: 50%;
  border-top-color: var(--color-primary);
  animation: spin 1s ease-in-out infinite;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--color-gray-600);
  text-align: center;
}

.loading-container .loading {
  margin-bottom: 1rem;
}

.error-message {
  padding: 1rem;
  background-color: var(--color-danger);
  color: white;
  border-radius: 1rem;
  margin: 1rem 0;
}

/* Email content styling */
.modal-body img {
  max-width: 100%;
  height: auto;
}

.modal-body a {
  color: var(--color-primary);
  text-decoration: none;
}

.modal-body a:hover {
  text-decoration: underline;
}

.modal-body pre {
  white-space: pre-wrap;
  font-family: inherit;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive design */
@media (max-width: 640px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .email-date {
    display: none;
  }
  
  .modal-content {
    width: calc(100% - 1rem);
    margin: 1rem auto;
  }
  
  .ai-analysis-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-body {
    flex: 1;
    min-height: 300px;
  }
}

@media (min-width: 641px) and (max-width: 768px) {
  .email-date {
    min-width: auto;
  }
  
  .ai-analysis-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .modal-body {
    flex: 1;
    min-height: 400px;
  }
  
  .modal-content {
    max-width: 95%;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .modal-body {
    flex: 1;
    min-height: 500px;
  }
  
  .modal-content {
    max-width: 90%;
  }
}

@media (min-width: 1025px) {
  .modal-body {
    flex: 1;
    min-height: 550px;
  }
}

/* Email action buttons */
.action-buttons-row {
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  margin: 0.5rem;
  margin-top: 0.25rem;
  background-color: var(--color-gray-200);
}

.action-buttons-wrapper {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px 12px;
  border-top: none;
  background-color: transparent;
}

/* Update separator to be a thin transparent line */
.email-separator-row {
  height: 16px;
  background-color: transparent;
  border: none;
}

.email-separator-row td {
  padding: 0;
  border: none;
}

/* Match action buttons row background to its parent email row */
.email-row.read + .action-buttons-row {
  background-color: var(--color-gray-200);
}

.email-row.unread + .action-buttons-row {
  background-color: var(--color-gray-300);
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
  border: 1px solid var(--color-border);
  background-color: var(--color-gray-100);
  color: var(--color-text);
  min-width: 130px;
  height: 36px;
}

.action-button:hover {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.action-button .icon {
  margin-right: 6px;
  flex-shrink: 0;
}

/* Outline buttons */
.outline-button {
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
}

.outline-button:hover {
  background-color: rgba(79, 70, 229, 0.05);
}

.outline-button .icon {
  color: var(--color-primary);
}

/* Themed outline button for Forward */
.forward-action-button {
  border: 1px solid var(--color-text);
  color: var(--color-text);
  background-color: transparent;
}

.forward-action-button:hover {
  background-color: var(--color-hover);
}

.forward-action-button .icon {
  color: var(--color-text);
}

/* Regular buttons */
.connect-email-button, .prepare-button {
  border: 1px solid var(--color-gray-300);
  color: var(--color-gray-700);
}

.connect-email-button:hover, .prepare-button:hover {
  background-color: var(--color-gray-100);
}

/* Delete button - redesigned as a square with just the icon */
.delete-button {
  background-color: #f8d7da; /* Lighter red */
  color: #842029; /* Darker red text */
  border-color: #f5c2c7; /* Lighter red border */
  min-width: 36px; /* Make it square */
  width: 36px;
  padding: 6px;
}

.delete-button:hover {
  background-color: #f5c2c7;
}

.delete-button .icon {
  margin-right: 0; /* Remove the margin since there's no text */
  color: #842029;
}

/* Hide text in delete button */
.delete-button span:not(.icon) {
  display: none;
}

/* Completed state - MUST come last to override all other button styles */
.action-button.completed,
.outline-button.completed,
.account-button.completed,
.opportunity-button.completed,
.connect-email-button.completed,
.prepare-button.completed {
  border: 2px solid #10b981 !important;
}

/* Make action buttons responsive - keep horizontal but allow wrapping */
@media (max-width: 768px) {
  .action-buttons-wrapper {
    gap: 6px;
  }
  
  .action-button {
    min-width: auto;
    flex: 0 1 auto;
  }
}

/* Opportunity Modal Styles */
.opportunity-modal, .account-modal, .connect-email-modal, .prepare-email-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.5);
}

/* Fix prepare email modal positioning */
.prepare-email-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.opportunity-form, .account-form {
    padding: 1rem;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group.half {
    flex: 1;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    background-color: var(--color-form-background);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) inset;
    color: var(--color-text);
    transition: all 0.2s ease;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-select {
    background-color: var(--color-form-background);
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Light theme dropdown arrow */
[data-theme="light"] .form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

/* Dark theme dropdown arrow */
[data-theme="dark"] .form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23aaaaaa'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

/* Dropdown option styling for both light and dark themes */
.form-select option {
    background-color: var(--color-form-background);
    color: var(--color-text);
    padding: 8px 12px;
}

/* Hover and selected states for dropdown options */
.form-select option:hover,
.form-select option:focus {
    background-color: var(--color-primary);
    color: white;
}

.form-select option:checked {
    background-color: var(--color-primary);
    color: white;
}

.form-input:hover, .form-select:hover, .form-textarea:hover {
    border-color: var(--color-gray-400);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background-color: var(--color-form-focus);
}

.search-container {
    display: flex;
    gap: 0.5rem;
}

.search-container .form-input {
    flex: 1;
}

.search-results {
    margin: 1rem 0;
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    max-height: 200px;
    overflow-y: auto;
    background-color: var(--color-gray-200);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.results-list {
    padding: 0.5rem;
}

.result-item {
    padding: 0.75rem;
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 0.25rem;
    border: 1px solid transparent;
    background-color: var(--color-form-background);
    color: var(--color-text);
    transition: all 0.15s ease;
}

.result-item:hover {
    background-color: var(--color-form-focus);
    border-color: var(--color-primary);
}

.selected-account {
    margin: 1rem 0;
    padding: 0.75rem;
    border: 2px solid var(--color-success);
    background-color: rgba(52, 211, 153, 0.1);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.selected-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-success);
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: var(--color-gray-50);
    border-radius: 4px;
    border: 1px solid var(--color-border);
}

.agent-info {
    margin-top: 0.5rem;
    padding: 1rem;
    border-radius: 4px;
    background-color: var(--color-form-focus);
    border: 1px solid var(--color-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.no-results {
    padding: 1rem;
    text-align: center;
    color: var(--color-text-muted);
}

.error-message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 4px;
    background-color: rgba(var(--color-danger-rgb), 0.1);
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
}

.error-message ul {
    margin: 0;
    padding-left: 1.5rem;
}

/* Button styles that may be needed */
.button-primary {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.button-primary:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}

.button-neutral {
    background-color: var(--color-button-neutral);
    color: var(--color-text);
    border-color: var(--color-border);
}

.button-neutral:hover {
    background-color: var(--color-hover);
}

/* Prepare Email Modal - Only this modal gets 80% width */
.prepare-email-modal .modal-content {
    width: 80%;
    max-width: none;
    height: 95vh;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
}

/* Other modals keep 50% width like email preview */
.opportunity-modal .modal-content,
.account-modal .modal-content,
.connect-email-modal .modal-content {
    width: 50%;
    max-width: 1000px;
}

.prepare-email-form {
    width: 100%;
    flex: 1;
    overflow: hidden;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Custom scrollbar for prepare email form */
.prepare-email-form::-webkit-scrollbar {
    width: 8px;
}

.prepare-email-form::-webkit-scrollbar-track {
    background: var(--color-gray-100);
    border-radius: 4px;
}

.prepare-email-form::-webkit-scrollbar-thumb {
    background: var(--color-gray-400);
    border-radius: 4px;
}

.prepare-email-form::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-500);
}

.email-form-layout {
    display: flex;
    gap: 15px;
    flex: 1;
    min-height: 0;
    margin: 0;
    padding: 0;
}

.email-form-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Compact styling for recipients and subject fields */
.email-form-main .form-group:nth-child(1),
.email-form-main .form-group:nth-child(2) {
    margin-bottom: 0.5rem;
}

.email-form-main .form-group:nth-child(1) .form-input,
.email-form-main .form-group:nth-child(2) .form-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.email-form-main .form-group:nth-child(1) label,
.email-form-main .form-group:nth-child(2) label {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

/* Give more space to content area */
.email-form-main .form-group:nth-child(3) {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.email-form-main .form-group:nth-child(3) .form-textarea {
    flex: 1;
    min-height: 0;
}

.email-form-sidebar {
    width: 220px;
    flex-shrink: 0;
    padding: 0 0 0 15px;
    border-left: 1px solid var(--color-gray-200);
    overflow-y: auto;
    max-height: calc(100% - 4rem); /* Account for modal border-radius */
    margin-top: 1.5rem; /* Push down from curved top corner */
    margin-bottom: 1.5rem; /* Pull up from curved bottom corner */
    box-sizing: border-box;
    border-radius: 0 1rem 1rem 0; /* Match the modal's curve on the right side */
}

.prepare-email-form .form-textarea {
    min-height: 200px;
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    resize: vertical;
}

.prepare-email-form .email-content-large {
    min-height: 300px;
    height: 100%;
    flex: 1;
    max-height: none;
}

/* Custom scrollbar for email content textarea */
.prepare-email-form .email-content-large::-webkit-scrollbar {
    width: 8px;
}

.prepare-email-form .email-content-large::-webkit-scrollbar-track {
    background: var(--color-gray-100);
    border-radius: 4px;
}

.prepare-email-form .email-content-large::-webkit-scrollbar-thumb {
    background: var(--color-gray-400);
    border-radius: 4px;
}

.prepare-email-form .email-content-large::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-500);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.form-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.loading-container p {
    margin-top: 1rem;
    color: var(--color-text-muted);
}

/* Loading indicator for buttons */
button .loading {
    width: 1em;
    height: 1em;
    border-width: 2px;
    margin: 0 auto;
}

.input-help-text {
    font-size: 0.75rem;
    color: var(--color-gray-600);
    margin-top: 4px;
}

.input-with-button {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-button .form-input {
    flex: 1;
}

.input-with-button .button {
    padding: 0.5rem;
    height: 100%;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-with-button .button svg {
    display: block;
}

/* Theme Toggle Button */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 1.5rem;
  border-radius: 1rem;
  border: 2px solid var(--color-border);
  background-color: var(--color-gray-200);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 0.5rem;
}

.theme-toggle:hover {
  background-color: var(--color-hover);
}

.theme-toggle-icon {
  position: absolute;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background-color: var(--color-primary);
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .theme-toggle-icon {
  transform: translateX(-0.75rem);
}

[data-theme="dark"] .theme-toggle-icon {
  transform: translateX(0.75rem);
}

/* Loading state for email content */
.email-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  flex: 1;
  flex-direction: column;
  color: var(--color-text-muted);
}

.email-loading .loading {
  margin-bottom: 1rem;
}

.email-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  flex: 1;
  flex-direction: column;
  color: var(--color-danger);
  padding: 2rem;
  text-align: center;
}

/* Settings Modal Styles */
.settings-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.settings-modal-content {
  width: 95%;
  max-width: 1400px;
  max-height: 90vh;
  overflow-y: auto;
}

.settings-nav {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1rem;
  margin-top: 0;
}

.settings-tab {
  padding: 1rem 2rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  color: var(--color-text-muted);
  transition: all 0.3s ease;
}

.settings-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.settings-tab:hover {
  color: var(--color-text);
}

.settings-content {
  padding: 0 1rem;
}

.settings-tab-content {
  display: none;
}

.settings-tab-content.active {
  display: block;
}

/* Upload Section */
.upload-section {
  margin-bottom: 3rem;
}

.upload-area {
  border: 2px dashed var(--color-border);
  border-radius: 1rem;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: var(--color-gray-50);
}

.upload-area:hover {
  border-color: var(--color-primary);
  background-color: var(--color-form-focus);
}

.upload-area.drag-over {
  border-color: var(--color-primary);
  background-color: var(--color-form-focus);
}

.upload-text {
  color: var(--color-text-muted);
}

.upload-text svg {
  margin-bottom: 1rem;
  opacity: 0.5;
}

.upload-text p {
  margin: 1rem 0 0.5rem 0;
  font-size: 1.1rem;
}

.upload-text small {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Exposés List */
.exposes-section h3 {
  margin-bottom: 1rem;
  color: var(--color-text);
}

.exposes-list {
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  overflow: hidden;
}

.exposes-header {
  display: grid;
  grid-template-columns: 1fr 100px 100px 200px;
  gap: 1rem;
  padding: 1rem;
  background-color: var(--color-gray-100);
  font-weight: 600;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}

.expose-item {
  display: grid;
  grid-template-columns: 1fr 100px 100px 200px;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-form-background);
  transition: background-color 0.2s ease;
}

.expose-item:last-child {
  border-bottom: none;
}

.expose-item:hover {
  background-color: var(--color-hover);
}

.expose-name {
  font-family: 'Inter', monospace;
  word-break: break-all;
  display: flex;
  align-items: center;
}

.expose-size {
  display: flex;
  align-items: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  min-width: 80px;
}

.expose-compressed {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  min-width: 80px;
}

.expose-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 200px;
  justify-content: flex-end;
}

.button-small {
  font-size: 0.8rem;
  padding: 0.375rem 0.75rem;
}

/* Exposé Details Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.5);
}

.expose-details-content {
  padding: 1rem 0;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

/* Fix scrollbar positioning for modal content */
.expose-details-content::-webkit-scrollbar {
  width: 8px;
}

.expose-details-content::-webkit-scrollbar-track {
  background: var(--color-gray-100);
  border-radius: 4px;
}

.expose-details-content::-webkit-scrollbar-thumb {
  background: var(--color-gray-300);
  border-radius: 4px;
}

.expose-details-content::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-400);
}

/* Template Editor Styles */
.template-section {
  padding: 1rem 0;
}

.template-editor {
  max-width: 100%;
}

/* Template Language Toggle */
.template-language-toggle {
  display: flex;
  gap: 0.5rem;
  padding: 0.25rem;
  background: var(--color-gray-100);
  border-radius: 0.5rem;
  width: fit-content;
  border: 1px solid var(--color-border);
}

.template-toggle-btn {
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--color-gray-600);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.template-toggle-btn:hover {
  background: var(--color-gray-200);
  color: var(--color-gray-900);
}

.template-toggle-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .template-language-toggle {
  background: var(--color-gray-200);
  border: 1px solid var(--color-border);
}

[data-theme="dark"] .template-toggle-btn {
  color: var(--color-text);
}

[data-theme="dark"] .template-toggle-btn:hover {
  background: var(--color-gray-300);
  color: var(--color-text);
}

[data-theme="dark"] .template-toggle-btn.active {
  background: var(--color-primary);
  color: white;
}

.template-editor .form-textarea {
  min-height: 400px;
  font-family: 'Inter', monospace;
  line-height: 1.6;
  resize: vertical;
}

.template-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.template-preview-content {
  padding: 1rem 0;
}

.template-preview-content h4 {
  margin-bottom: 1rem;
  color: var(--color-text);
}

/* Responsive design for settings */
@media (max-width: 768px) {
  .settings-modal-content {
    width: 95%;
    margin: 1rem auto;
  }
  
  .settings-nav {
    flex-direction: column;
  }
  
  .settings-tab {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    border-right: 3px solid transparent;
  }
  
  .settings-tab.active {
    border-bottom-color: var(--color-border);
    border-right-color: var(--color-primary);
  }
  
  .exposes-header,
  .expose-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .expose-size,
  .expose-actions {
    justify-self: start;
  }
}

/* Template controls row - single row layout */
.template-controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

/* Template type toggle buttons */
.template-type-btn {
    background: var(--color-gray-200);
    border: 1px solid var(--color-border);
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 0.25rem;
    margin: 0 0.25rem;
    transition: all 0.2s;
    color: var(--color-text);
}

.template-type-btn:hover {
    background: var(--color-gray-300);
}

.template-type-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.template-type-btn.active:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}

.template-type-toggle {
    display: flex;
    justify-content: center;
}

/* Dark theme support for template type buttons */
[data-theme="dark"] .template-type-btn {
    background: var(--color-gray-200);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

[data-theme="dark"] .template-type-btn:hover {
    background: var(--color-gray-300);
}

[data-theme="dark"] .template-type-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.prepare-email-modal .modal-footer {
    position: absolute;
    bottom: 0.25rem;
    right: 0.25rem;
    justify-content: flex-end;
    width: auto;
    max-width: 180px;
    margin: 0;
    padding: 0;
    gap: 0.4rem;
    background: transparent;
    z-index: 100;
}

.prepare-email-modal .modal-body-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 0;
    padding-bottom: 0;
    padding-top: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* CSV Office Spaces Table Styles */
.csv-file-info {
    background: var(--color-gray-50);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--color-border);
}

.csv-file-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-text);
}

.csv-data-table {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.office-spaces-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-form-background);
}

.office-spaces-table th {
    background: var(--color-gray-50);
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid var(--color-border);
    font-weight: 600;
    position: sticky;
    top: 0;
    color: var(--color-text);
}

.office-spaces-table td {
    padding: 12px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}

.office-spaces-table tr:hover {
    background: var(--color-hover);
}

.office-spaces-table tr:nth-child(even) {
    background: var(--color-gray-50);
}

.office-spaces-table tr:nth-child(even):hover {
    background: var(--color-hover);
}

.csv-section {
    margin-bottom: 2rem;
}

.csv-section h3 {
    margin-bottom: 1rem;
    color: var(--color-text);
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
}

.no-results p {
    margin: 0.5rem 0;
}

/* PAX input and actions styling */
.csv-file-actions {
    display: flex;
    gap: 0.5rem;
}

.pax-input {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
    background: var(--color-form-background);
    color: var(--color-text);
}

.pax-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.25);
}

.pax-input:invalid {
    border-color: var(--color-danger);
}

.missing-pax-indicator {
    color: var(--color-danger);
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(var(--color-danger-rgb), 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid rgba(var(--color-danger-rgb), 0.3);
}

.has-pax-indicator {
    color: var(--color-success);
    font-size: 1rem;
    font-weight: bold;
}

.office-spaces-table th:last-child,
.office-spaces-table td:last-child {
    width: 100px;
    text-align: center;
}

/* CSV Table Input Fields */
.pax-input,
.location-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-form-background);
    color: var(--color-text);
    font-size: 14px;
    transition: all 0.2s ease;
}

.pax-input {
    max-width: 80px;
}

.location-input {
    min-width: 150px;
}

.pax-input:focus,
.location-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.pax-input:disabled,
.location-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Email Editor Styles */
.email-editor-container {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-form-background);
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.email-editor-toolbar {
    background: var(--color-gray-50);
    border-bottom: 1px solid var(--color-border);
    padding: 8px 12px;
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.toolbar-btn {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    height: 28px;
    min-width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
}

.toolbar-btn:hover {
    background: var(--color-hover);
}

.toolbar-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.toolbar-separator {
    width: 1px;
    height: 20px;
    background: var(--color-border);
    margin: 0 4px;
}

.email-editor-content {
    padding: 12px;
    flex: 1;
    overflow-y: auto;
    background: var(--color-form-background);
    color: var(--color-text);
}

.email-template {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.html-source-view {
    width: 100%;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    border: none;
    background: var(--color-form-background);
    color: var(--color-text);
    resize: vertical;
    flex: 1;
    min-height: 300px;
}

/* Email template content - ensure no extra height */
.email-template .email-banner,
.email-template .email-content,
.email-template .email-signature {
    min-height: 0;
    height: auto;
}

.email-template .office-options-container {
    min-height: 0;
    height: auto;
}

.email-editor-content[contenteditable="true"] {
    outline: none;
}

.email-editor-content[contenteditable="true"]:focus {
    background: var(--color-form-focus);
}

/* PDF Upload Area Styles */
.pdf-upload-area {
    border: 2px dashed var(--color-border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--color-form-background);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-upload-area:hover {
    border-color: var(--color-primary);
    background: var(--color-gray-50);
}

.pdf-upload-area.drag-over {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upload-text {
    font-weight: 500;
    color: var(--color-text);
    margin: 0 0 4px 0;
}

.upload-subtext {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: 0;
}

.uploaded-files-list {
    margin-top: 12px;
}

.uploaded-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--color-gray-50);
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.875rem;
}

.uploaded-file-name {
    color: var(--color-text);
    font-weight: 500;
}

.remove-file-btn {
    background: none;
    border: none;
    color: var(--color-danger);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.remove-file-btn:hover {
    background: var(--color-danger-light);
}

/* Model Management Styles */
.status-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s ease;
    margin-left: 8px;
}

.status-success {
    background-color: var(--color-success);
}

.status-error {
    background-color: var(--color-danger);
}

.status-loading {
    background-color: #ff9800;
    animation: pulse 1s infinite;
}

.status-neutral {
    background-color: var(--color-gray-400);
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.message {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.message.success {
    background-color: rgba(var(--color-success-rgb), 0.1);
    color: var(--color-success);
    border: 1px solid rgba(var(--color-success-rgb), 0.3);
}

.message.error {
    background-color: rgba(var(--color-danger-rgb), 0.1);
    color: var(--color-danger);
    border: 1px solid rgba(var(--color-danger-rgb), 0.3);
}

.message.info {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .message.info {
    color: #60a5fa;
}

/* Validate button styles */
.validate-btn {
    background: var(--color-gray-200);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 150ms ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.validate-btn:hover {
    background: var(--color-hover);
}

.validate-btn.validating {
    background: #ff9800;
    color: white;
    border-color: #ff9800;
}

.validate-btn.success {
    background: var(--color-success);
    color: white;
    border-color: var(--color-success);
}

.validate-btn.error {
    background: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}

/* Radio button styles for attachment method selection */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.radio-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.radio-item input[type="radio"] {
  margin-right: 0.5rem;
  cursor: pointer;
}

.radio-item label {
  cursor: pointer;
  font-weight: 500;
  color: var(--color-text);
  display: flex;
  align-items: center;
}

.radio-item .input-help-text {
  margin-left: 1.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Toggle Switch Styles for Exposé Selection */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--color-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.expose-selection-list .expose-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-bottom: 1px solid var(--color-border);
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.expose-selection-list .expose-item:hover {
    background-color: var(--color-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.expose-selection-list .expose-item.disabled {
    opacity: 0.6;
    transform: translateY(0);
}

.expose-selection-list .expose-item.disabled:hover {
    transform: translateY(0);
    box-shadow: none;
}

.expose-selection-list .expose-info {
    flex: 1;
}

.expose-selection-list .expose-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.expose-selection-list .expose-size {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.expose-selection-summary {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--color-form-background);
    border-radius: 4px;
    text-align: center;
}

/* Attachment Item Styles */
.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    background: var(--color-form-background);
    border-radius: 4px;
    border: 1px solid var(--color-border);
}

.attachment-name {
    flex: 1;
    font-size: 0.875rem;
    color: var(--color-text);
}

.remove-attachment {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--color-text-muted);
    transition: color 0.2s;
}

.remove-attachment:hover {
    color: var(--color-error);
}

/* Office option animations */
.office-option {
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.office-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.expose-details-formatted {
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.no-attachments {
    padding: 1rem;
    text-align: center;
    color: var(--color-text-muted);
    font-style: italic;
}

/* ========================================
   NEW EMAIL COMPOSE MODAL STYLES
   ======================================== */

/* Modal Container */
.modal-content-new {
    background: white;
    width: 90%;
    max-width: 1400px;
    height: 90vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* Header */
.modal-header-new {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header-new h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.modal-close-new {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close-new:hover {
    background: #f3f4f6;
    color: #111827;
}

/* Body */
.modal-body-new {
    flex: 1;
    overflow: hidden;
    padding: 24px;
}

/* Grid Layout */
.email-compose-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    height: 100%;
}

/* Left Column */
.email-main-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.form-field input[type="text"] {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.form-field input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Email Editor Field */
.email-editor-field {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.email-editor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    min-height: 0;
}

/* Toolbar */
.editor-toolbar {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 12px;
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}

.tool-btn {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.tool-btn:active {
    background: #e5e7eb;
}

.tool-divider {
    width: 1px;
    height: 20px;
    background: #d1d5db;
    margin: 0 4px;
}

/* Editor Content */
.editor-content-wrapper {
    flex: 1;
    overflow-y: auto;
    background: white;
    min-height: 0;
}

.editor-visual {
    padding: 20px;
    min-height: 100%;
}

.editor-html {
    width: 100%;
    height: 100%;
    padding: 16px;
    border: none;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    resize: none;
    background: #1f2937;
    color: #f3f4f6;
}

/* Email Template Styles */
.email-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    text-align: center;
    border-radius: 8px 8px 0 0;
    margin-bottom: 20px;
}

.email-banner img {
    max-width: 120px;
    height: auto;
}

.email-body {
    line-height: 1.6;
}

.email-body h1 {
    font-size: 1.5rem;
    margin: 0 0 16px 0;
    color: #111827;
}

.email-body p {
    margin: 0 0 12px 0;
    color: #374151;
}

.email-body a {
    color: #3b82f6;
    text-decoration: underline;
}

.editable:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

.editable:empty:before {
    content: attr(data-placeholder);
    color: #9ca3af;
    font-style: italic;
}

.office-options {
    margin: 16px 0;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.office-option {
    margin-bottom: 12px;
}

.office-option:last-child {
    margin-bottom: 0;
}

.office-option h3 {
    font-size: 1.125rem;
    margin: 0 0 4px 0;
    color: #111827;
}

.office-option p {
    margin: 0;
    color: #4b5563;
}

.email-signature {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

/* Right Column - Sidebar */
.email-sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    padding-right: 4px;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-section label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.sidebar-section input[type="text"],
.sidebar-section select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
}

.sidebar-section input[type="text"]:focus,
.sidebar-section select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Buttons */
.btn-primary-full {
    width: 100%;
    padding: 10px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-primary-full:hover {
    background: #2563eb;
}

.btn-secondary-full {
    width: 100%;
    padding: 10px 16px;
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-secondary-full:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-secondary-small {
    padding: 6px 12px;
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-secondary-small:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-icon {
    padding: 8px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.input-with-btn {
    display: flex;
    gap: 8px;
}

.input-with-btn input {
    flex: 1;
}

/* Help Text */
.help-text {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
}

.help-text-small {
    font-size: 0.6875rem;
    color: #9ca3af;
    margin: 0 0 8px 24px;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Radio */
.radio-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
    padding: 6px 0;
}

.radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #f9fafb;
}

.upload-zone:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.upload-zone svg {
    color: #9ca3af;
    margin-bottom: 8px;
}

.upload-zone p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Attached Files */
.attached-files {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    min-height: 60px;
    background: #f9fafb;
}

.no-files {
    text-align: center;
    color: #9ca3af;
    font-size: 0.8125rem;
    font-style: italic;
}

/* Footer */
.modal-footer-new {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-cancel {
    padding: 10px 20px;
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #f9fafb;
}

.btn-send {
    padding: 10px 24px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-send:hover {
    background: var(--color-primary-dark);
}

.error-msg {
    padding: 12px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #991b1b;
    font-size: 0.875rem;
}
