/* css/mail.css */
/* Baseball Hot - Mail MVP */

.mail-page-wrapper {
  display: block !important;
  width: 100%;
}

.mail-page-divider {
  border: 0;
  height: 5px;
  background: rgb(5, 71, 0);
  margin: -10px 10px 14px 0;
  opacity: 1;
}

.mail-toolbar-card,
.mail-list-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(12, 64, 20, 0.14);
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.mail-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mail-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.mail-unread-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #e8f5e9;
  color: #145c21;
  font-weight: 900;
  white-space: nowrap;
  border: 1px solid rgba(20, 92, 33, 0.14);
}

.mail-unread-pill strong {
  font-size: 17px;
  color: #b45309;
}

.mail-primary-btn,
.mail-secondary-btn,
.mail-action-btn {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.mail-primary-btn {
  min-height: 36px;
  padding: 7px 15px;
  background: #facc15;
  color: #17310c;
  box-shadow: none;
}

.mail-secondary-btn {
  min-height: 34px;
  padding: 7px 13px;
  background: #e8f5e9;
  color: #13561e;
}

.mail-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 13px;
  background: #145c21;
  color: #fff;
  text-decoration: none;
}

.mail-danger-btn {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  min-height: 34px;
  padding: 7px 13px;
  background: #fee2e2;
  color: #991b1b;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.mail-danger-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(153, 27, 27, 0.12);
}

.mail-primary-btn:hover,
.mail-secondary-btn:hover,
.mail-action-btn:hover {
  transform: translateY(-1px);
}

.mail-primary-btn:disabled,
.mail-secondary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.mail-toolbar-card {
  padding: 14px;
  margin: 0 10px 14px 0;
}

.mail-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mail-tab {
  border: 1px solid rgba(20, 92, 33, 0.18);
  background: #f6fbf5;
  color: #204622;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mail-tab:hover {
  background: #e8f5e9;
}

.mail-tab.active {
  background: #145c21;
  color: #fff;
  border-color: #145c21;
  box-shadow: 0 8px 18px rgba(20, 92, 33, 0.18);
}

.mail-status {
  display: none;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
}

.mail-status.active {
  display: block;
  background: #eef8ee;
  color: #225b24;
}

.mail-status.error {
  display: block;
  background: #fff0f0;
  color: #a12626;
}

.mail-list-card {
  padding: 14px;
  margin: 0 10px 30px 0;
}

.mail-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mail-empty {
  padding: 28px 18px;
  border-radius: 14px;
  text-align: center;
  background: #f7faf7;
  color: #6b7280;
  font-weight: 800;
}

.mail-item {
  position: relative;
  border: 1px solid rgba(12, 64, 20, 0.12);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.mail-item:hover {
  border-color: rgba(20, 92, 33, 0.28);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.07);
}

.mail-item.unread {
  border: 2px solid rgba(20, 92, 33, 0.35);
  background: linear-gradient(90deg, rgba(232, 245, 233, 0.9), #fff 26%);
  box-shadow: 0 8px 20px rgba(20, 92, 33, 0.08);
}

.mail-item-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  cursor: pointer;
}

.mail-unread-dot {
  width: 10px;
  height: 10px;
  margin-top: 8px;
  border-radius: 999px;
  background: transparent;
}

.mail-item.unread .mail-unread-dot {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.mail-item-main {
  min-width: 0;
}

.mail-item-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.mail-category-badge,
.mail-severity-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 900;
}

.mail-category-badge {
  background: #e8f5e9;
  color: #166323;
}

.mail-severity-badge {
  background: #f3f4f6;
  color: #4b5563;
}

.mail-severity-badge.success {
  background: #dcfce7;
  color: #166534;
}

.mail-severity-badge.warning {
  background: #fef3c7;
  color: #92400e;
}

.mail-severity-badge.danger {
  background: #fee2e2;
  color: #991b1b;
}

.mail-severity-badge.announcement {
  background: #ede9fe;
  color: #5b21b6;
}

.mail-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mail-title {
  margin: 0;
  color: #152115;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.35;
}

.mail-sender,
.mail-date {
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

.mail-date-inline {
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
}

.mail-preview {
  margin-top: 7px;
  color: #4b5563;
  line-height: 1.65;
  font-size: 14px;
}

.mail-item-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mail-read-label {
  color: #9ca3af;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.mail-item.unread .mail-read-label {
  color: #ef4444;
}

.mail-expand-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #374151;
    transition:
        transform 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
}

.mail-expand-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.18s ease;
}

.mail-item-header:hover .mail-expand-icon {
    background: #e7f5ec;
    border-color: #9ac7a4;
    color: #145c22;
}

.mail-item.expanded .mail-expand-icon {
    background: #145c22;
    border-color: #145c22;
    color: #ffffff;
}

.mail-item.expanded .mail-expand-icon svg {
    transform: rotate(180deg);
}

.mail-item-body {
  display: none;
  padding: 0 16px 16px 38px;
}

.mail-item.expanded .mail-item-body {
  display: block;
}

.mail-body-content {
  border-top: 1px solid rgba(12, 64, 20, 0.1);
  padding-top: 14px;
  color: #263326;
  line-height: 1.85;
  white-space: pre-wrap;
}

.mail-body-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

@media (max-width: 768px) {
  .mail-hero-card {
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
  }

  .mail-hero-card h2 {
    font-size: 24px;
  }

  .mail-hero-actions {
    justify-content: flex-start;
  }

  .mail-toolbar-card,
  .mail-list-card,
  .mail-hero-card {
    margin-right: 0;
  }

  .mail-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .mail-tab {
    white-space: nowrap;
  }

  .mail-item-header {
    grid-template-columns: auto 1fr;
  }

  .mail-item-side {
    grid-column: 2;
    justify-content: flex-start;
  }

  .mail-item-body {
    padding-left: 16px;
  }
}