/* === 全体の基本設定 === */
* {
  box-sizing: border-box;
}

body {
  font-family: "Geist Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  color: #4b5563;
  line-height: 1.6;
}

/* === login === */
.center-box {
  width: 100%;
  max-width: 400px;
  margin: 10vh auto;
  padding: 2rem;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.05);
  text-align: center;
  border: 1px solid #f3f4f6;
}

.center-box h1 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: #1f2937;
  font-weight: 600;
  letter-spacing: -0.025em;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease;
  background: #ffffff;
  resize: vertical;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-color: #a16207;
  box-shadow: 0 0 0 3px rgba(161, 98, 7, 0.1);
}

button {
  background: #a16207;
  color: #ffffff;
  border: none;
  padding: 0.875rem 1.5rem;
  width: 100%;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

button:hover {
  background: #92400e;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(161, 98, 7, 0.3);
}

button:active {
  transform: translateY(0);
}

.error {
  color: #dc2626;
  margin-top: 1rem;
  font-size: 0.875rem;
  padding: 0.75rem;
  background: #fef2f2;
  border-radius: 8px;
  border: 1px solid #fecaca;
}

.forgot-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: #a16207;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.forgot-link:hover {
  color: #92400e;
  text-decoration: underline;
}

/* === mailbox === */
.container {
  display: flex;
  height: calc(100vh - 140px);
  max-height: 100vh;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  margin: 1rem;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.sidebar {
  width: 350px;
  background: #ffffff;
  overflow-y: auto;
  border-right: 1px solid #e5e7eb;
  padding: 0;
}

.mail-item {
  padding: 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.2s ease;
  position: relative;
}

.mail-item:hover {
  background: #fef3c7;
  border-left: 4px solid #a16207;
  padding-left: calc(1rem - 4px);
}

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

.mail-item .sender {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

.mail-item .subject {
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.mail-item .preview {
  color: #6b7280;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.mail-item .date {
  font-size: 0.75rem;
  color: #9ca3af;
  font-weight: 500;
}

.detail {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  background: #ffffff;
}

.detail h2 {
  margin-top: 0;
  color: #1f2937;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.detail .email-meta {
  background: #f9fafb;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 1px solid #f3f4f6;
}

.detail .email-meta p {
  margin: 0.25rem 0;
  font-size: 0.875rem;
}

.detail .email-body {
  font-size: 1rem;
  line-height: 1.7;
  color: #374151;
}

footer {
  margin: 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: #6b7280;
  background: rgba(255, 255, 255, 0.8);
  padding: 0.75rem;
  border-radius: 8px;
}

/* logout */
.logout-button {
  padding: 0.5rem 1rem;
  border: none;
  background: #dc2626;
  color: #ffffff;
  border-radius: 8px;
  cursor: pointer;
  display: inline-block;
  width: auto;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.logout-button:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

/* menu */
.tab-menu {
  display: flex;
  justify-content: center;
  background: #ffffff;
  padding: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid #e5e7eb;
  gap: 0.5rem;
}

.tab {
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  text-decoration: none;
  background: #f3f4f6;
  color: #6b7280;
  font-weight: 500;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.tab:hover {
  background: #e5e7eb;
  color: #374151;
}

.tab.active {
  background: #a16207;
  color: #ffffff;
  cursor: default;
}

/* burner */
.banner {
  background: #fef2f2;
  color: #dc2626;
  text-align: center;
  padding: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  border-bottom: 1px solid #fecaca;
}

/* sent-button */
.disabled-button {
  background: #d1d5db;
  color: #9ca3af;
  border: none;
  border-radius: 12px;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  cursor: not-allowed;
  font-weight: 500;
}

.site-footer {
  position: fixed;
  bottom: 0.5rem;
  right: 1rem;
  font-size: 0.75rem;
  color: #9ca3af;
  z-index: 999;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.back-link {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  text-align: center;
}

.back-link a {
  color: #6b7280;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.back-link a:hover {
  color: #a16207;
  text-decoration: underline;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    height: calc(100vh - 100px);
    margin: 0.5rem;
  }

  .sidebar {
    width: 100%;
    height: 40%;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }

  .detail {
    padding: 1rem;
  }

  .center-box {
    margin: 5vh auto;
    padding: 1.5rem;
  }
}

/* スクロールバー */
.sidebar::-webkit-scrollbar,
.detail::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track,
.detail::-webkit-scrollbar-track {
  background: #f3f4f6;
}

.sidebar::-webkit-scrollbar-thumb,
.detail::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.detail::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}
