/* registerボタンがロゴと重なる場合は非表示にする（例: 画面幅が420px未満なら非表示） */
@media (max-width: 420px) {
  .auth-buttons .register-button {
    display: none !important;
  }
}
/* Base template styles */

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

html {
  height: 100%;
}

body {
  font-family: Arial, sans-serif;
  min-height: 100vh;
  padding-top: 60px;
  display: flex;
  flex-direction: column;
}

.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 9999;
}

.header-left,
.header-center,
.header-right {
  flex: 1;
  display: flex;
  align-items: center;
  height: 60px;
}

.header-left {
  flex: 1 0 0;
  justify-content: flex-start;
  min-width: 0;
}

.header-center {
  justify-content: center;
  flex: 0 1 auto;
  justify-content: center;
  position: absolute;
  left: 50%;
  top: 0;
  height: 60px;
  transform: translateX(-50%);
  width: max-content;
  z-index: 9998;
}

.header-right {
  justify-content: flex-end;
  min-width: 100px;
}

.hamburger-menu-wrapper {
  position: relative;
  cursor: pointer;
  z-index: 9999;
  padding: 10px;
  border-radius: 50%;
  transition: background-color 0.1s ease;
}

.hamburger-menu-wrapper:hover {
  background-color: #f5f5f5;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 16px;
  height: 12px;
}

.hamburger-icon span {
  display: block;
  width: 100%;
  height: 1px;
  background: #000;
}

.hamburger-menu-wrapper:hover .hamburger-icon span {
  height: 2px;
}

.hamburger-dropdown-menu {
  position: fixed;
  top: 0;
  left: -200px;
  width: 200px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.97); /* ほんの少しだけ透過 */
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  transition: left 0.3s ease;
  padding-top: 80px;
  z-index: 9999;
}

.hamburger-dropdown-menu.active {
  left: 0;
  display: block;
  opacity: 1;
  visibility: visible;
}

.hamburger-dropdown-menu a {
  display: block;
  padding: 15px 25px;
  font-size: 18px;
  color: #000;
  text-decoration: none;
  transition: background 0.3s;
}

.hamburger-dropdown-menu a:hover {
  background: #f5f5f5;
}

.logo-icon {
  max-height: 48px;
  width: auto;
  object-fit: contain;
}

.user-menu-wrapper {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 100px;
  z-index: 9997;
}

.user-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-icon i {
  font-size: 20px;
  color: #333;
}

.user-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  width: auto;
  min-width: 160px;
  max-width: 300px;
  padding: 8px 0;
  margin-top: 0;
  padding-top: 10px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 9999;
  white-space: nowrap;
}

.user-dropdown-menu a {
  display: block;
  padding: 8px 16px;
  color: #000;
  text-decoration: none;
  transition: background 0.3s;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  width: 100%;
  box-sizing: border-box;
}

.user-dropdown-menu a:hover {
  background: #f5f5f5;
}

.user-menu-wrapper:hover .user-dropdown-menu {
  opacity: 1;
  visibility: visible;
  display: block;
}

main {
  padding: 20px;
}

.auth-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.login-button {
  display: inline-block;
  padding: 8px 16px;
  background-color: #fff;
  color: #000;
  text-decoration: none;
  border: 1px solid #000;
  border-radius: 20px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.login-button:hover {
  background-color: #e0e0e0;
  color: #000;
}

.register-button {
  display: inline-block;
  padding: 8px 16px;
  background-color: #000;
  color: #fff;
  text-decoration: none;
  border: 1px solid #000;
  border-radius: 20px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.register-button:hover {
  background-color: #e0e0e0;
  color: #000;
}

/* Flash messages */
.flash-message {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 4px;
  background-color: #f8f9fa;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: opacity 0.3s ease-in-out;
  opacity: 1;
}

.flash-message.fade-out {
  opacity: 0;
}

.flash-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.flash-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.flash-message.info {
  background-color: #cce5ff;
  color: #004085;
  border: 1px solid #b3d9ff;
}

.flash-message.warning {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.user-name {
  margin-right: 10px;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-align: right;
}

.content-wrapper {
  flex: 1;
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 100vw;
  min-height: 0; /* flexboxの高さ計算を正常化 */
}

.content-container {
  display: flex;
  width: 100%;
  max-width: calc(1000px + 40px);
}

.content-left,
.content-right {
  flex: 1;
  min-width: 0;
}

.content-center {
  width: 1000px;
  padding: 20px;
}

@media (max-width: 1080px) {
  .content-container {
    max-width: 100%;
    justify-content: center;
  }

  .content-center {
    width: calc(100vw - 40px);
    max-width: 1000px;
    margin: 0 auto;
  }

  .content-left,
  .content-right {
    display: none;
  }
}

.main-content {
  margin-top: 80px;
  padding: 20px;
  min-height: calc(100vh - 80px);
}

/* Navigation styles if needed */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #fff;
  border-bottom: 1px solid #dee2e6;
  z-index: 999;
}

/* Responsive design */
@media (max-width: 768px) {
  .flash-message {
    top: 60px;
    left: 10px;
    right: 10px;
    transform: none;
  }

  .main-content {
    margin-top: 70px;
    padding: 10px;
  }
}

@media (max-width: 450px) {
  html, body {
    height: 100%;
    min-height: 100vh;
    overflow-x: hidden;
  }
  
  body {
    display: flex;
    flex-direction: column;
    position: relative;
  }
  
  .content-wrapper {
    flex: 1 0 auto;
    min-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
  }
  
  .content-center {
    width: calc(100vw - 20px);
    padding: 10px;
    flex: 1;
  }
  
  footer {
    position: relative;
    bottom: 0;
    width: 100%;
    margin-top: auto;
    flex-shrink: 0;
  }
}

/* Footer styles */
footer {
  background-color: #000;
  color: #999;
  padding: 40px 20px 20px 20px;
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
  min-height: 140px; /* フッターの最小高さを確保 */
}

/* Social links */
.social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #333;
  color: #999;
  text-decoration: none;
  font-size: 18px;
  transition: all 0.3s ease;
}

.social-link:hover {
  background-color: #555;
  color: #fff;
  transform: translateY(-2px);
}

.footer__copyright {
  text-align: center;
  font-size: 12px;
  color: #666;
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid #333;
}
