/* Common Header Styles - Rose Pink theme */
@import url('https://fonts.googleapis.com/css2?family=Allura&display=swap');

/* CSS Variables for rose pink theme */
:root {
  --rose-deep: #4d1a2e;
  --rose-dark: #6b2d44;
  --rose-rich: #a85a72;
  --rose-medium: #c9899e;
  --rose-light: #e8b4c4;
  --gold: #d4a5a0;
  --gold-bright: #e8c4bf;
  --gold-light: #f5e0dc;
  --cream: #fffbfa;
  /* Legacy aliases */
  --teal-deep: var(--rose-deep);
  --teal-dark: var(--rose-dark);
  --teal-rich: var(--rose-rich);
  --teal-medium: var(--rose-medium);
  --teal-light: var(--rose-light);
}

/* Common body background for all pages */
body {
  font-family: 'Noto Serif JP', '游明朝', 'Yu Mincho', 'Hiragino Mincho ProN', 'MS P明朝', serif;
  background: linear-gradient(180deg, var(--teal-deep) 0%, var(--teal-dark) 40%, var(--teal-rich) 100%);
  background-attachment: fixed;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  isolation: isolate;
}

/* Floating particles container */
.particles {
  position: fixed;
  top: 100px;
  left: 0;
  width: 100%;
  height: calc(100% - 100px);
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

@media (max-width: 900px) {
  .particles {
    top: 60px;
    height: calc(100% - 60px);
  }
}

.bokeh {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.25), transparent 70%);
  animation: bokehFloat 12s ease-in-out infinite;
}

@keyframes bokehFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
    opacity: 0.25;
  }
  50% {
    transform: translateY(-30px) scale(1.15);
    opacity: 0.5;
  }
}

/* Content containers above particles */
.concerota-section,
.concerota-card,
.opera-card,
.container,
.card,
.storage-card,
.account-card,
.change-card,
.notification-card,
.notification-section,
.input-section,
.upload-box,
.purchase-container,
.auth-container,
.login-container,
.register-container,
.reset-container,
.resetpw-container,
.error-container,
.plans-container,
.plan-card,
.tickets-container,
.info-box,
.ttt-container,
.dropdown-wrapper,
.collusion-group-card,
.stats-box,
.histogram-box,
.upgrade-plans-container,
.upgrade-plan-card,
.current-plan-card,
.current-plan-section,
.table-wrapper,
.output-wrapper,
section,
main,
form {
  position: relative;
  z-index: 2 !important;
}

/* Base header structure */
header {
  background-color: #6b2d44;
  height: 100px;
  padding: 0 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  font-family: 'Playfair Display', 'Noto Serif JP', '游明朝', 'Yu Mincho', 'Hiragino Mincho ProN', 'MS P明朝', serif;
  position: relative;
  border: none;
  box-shadow: none;
}

/* Logo takes flexible space */
.logo-wrapper {
  flex: 1;
  display: inline-block;
  width: auto;
}

/* Profile section on the right */
.header-second-line {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

header img {
  height: 100px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

/* Profile container */
.profile-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 42px;
  cursor: pointer;
  position: relative;
  font-family: 'Noto Serif JP', '游明朝', serif;
  max-width: 100%;
  overflow: visible;
}

.profile-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: rgba(255, 255, 255, 0.9);
}

.profile-circle:hover {
  color: #fff;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5)) drop-shadow(0 0 15px rgba(255, 255, 255, 0.3));
}

.profile-circle svg {
  width: 36px;
  height: 36px;
}

/* Plan color circles - metallic ring borders */
.profile-circle.bronze-plan,
.profile-circle.silver-plan,
.profile-circle.gold-plan {
  position: relative;
  border: 2px solid transparent;
  border-radius: 50%;
  background-clip: padding-box;
}

.profile-circle.bronze-plan {
  background-image: linear-gradient(#6b2d44, #6b2d44), linear-gradient(135deg, #8B4513 0%, #CD7F32 25%, #F4A460 50%, #CD7F32 75%, #8B4513 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.profile-circle.silver-plan {
  background-image: linear-gradient(#6b2d44, #6b2d44), linear-gradient(135deg, #808080 0%, #C0C0C0 25%, #F5F5F5 50%, #C0C0C0 75%, #808080 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.profile-circle.gold-plan {
  background-image: linear-gradient(#6b2d44, #6b2d44), linear-gradient(45deg, #d4a5a0, #f5e0dc, #b08080);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.profile-name {
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.9);
  font-weight: bold;
  font-family: 'Noto Serif JP', '游明朝', 'Yu Mincho', 'Hiragino Mincho ProN', 'MS P明朝', serif;
  text-align: center;
}

.profile-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

/* Logout Menu Styles */
.logout-menu {
  position: fixed;
  background-color: #ffffff;
  border: 1px solid #6b2d44;
  box-shadow: 0 4px 10px rgba(77, 26, 46, 0.2);
  width: auto;
  min-width: 120px;
  max-width: 200px;
  display: none;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s;
  transform: translateY(-8px) scale(0.98);
  z-index: 1000;
  font-family: 'Noto Serif JP', '游明朝', 'Yu Mincho', 'Hiragino Mincho ProN', 'MS P明朝', serif;
  padding: 0;
  border-radius: 0;
  overflow: hidden;
}

.logout-menu * {
  box-sizing: border-box;
}

.logout-menu.show {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.logout-menu a {
  padding: 10px 15px;
  text-decoration: none;
  color: #4d1a2e;
  font-weight: bold;
  font-size: 0.85em;
  border-bottom: 1px solid #eee;
  white-space: nowrap;
  display: block;
  font-family: 'Noto Serif JP', '游明朝', 'Yu Mincho', 'Hiragino Mincho ProN', 'MS P明朝', serif;
  border-radius: 0;
}

.logout-menu a:last-child {
  border-bottom: none;
}

.logout-menu a:hover {
  background-color: #f5e0dc;
  color: #4d1a2e;
}

/* Logout button specific styles */
.logout-link-button {
  width: 100%;
  padding: 10px 15px;
  text-align: left;
  background: none;
  border: none;
  color: #d32f2f;
  font-weight: bold;
  font-family: 'Noto Serif JP', '游明朝', 'Yu Mincho', 'Hiragino Mincho ProN', 'MS P明朝', serif;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  font-size: 0.85em;
  line-height: 1.3em;
  white-space: nowrap;
}

.logout-link-button:hover {
  background-color: #ffebee;
  color: #b71c1c;
}

/* Hamburger button */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 100;
  margin-right: 20px;
}

.hamburger-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger-btn:hover span {
  background-color: #fff;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5)) drop-shadow(0 0 15px rgba(255, 255, 255, 0.3));
}

/* Sidebar overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1100;
}

.sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Sidebar menu */
.sidebar-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100%;
  background: linear-gradient(180deg, var(--rose-deep) 0%, var(--rose-dark) 100%);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 1101;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.sidebar-menu.show {
  transform: translateX(0);
}

/* Sidebar header with close button */
.sidebar-header {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .sidebar-header {
    height: 60px;
    padding: 0 18px;
  }
}

.sidebar-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 28px;
  cursor: pointer;
  padding: 10px;
  line-height: 1;
  transition: color 0.2s;
}

.sidebar-close:hover {
  color: #fff;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding-top: 10px;
}

.sidebar-links a {
  display: block;
  padding: 18px 30px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 1.05em;
  font-weight: 600;
  font-family: 'Noto Serif JP', '游明朝', serif;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.sidebar-links a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding-left: 35px;
}

/* Sidebar language switcher */
.sidebar-language {
  margin-top: auto;
  padding: 20px 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
}

.sidebar-language-switcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Noto Serif JP', '游明朝', serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.4;
  box-sizing: border-box;
  width: fit-content;
  /* Cool double border effect */
  border: 1px solid rgba(255, 255, 255, 0.4);
  outline: 1px solid rgba(255, 255, 255, 0.15);
  outline-offset: 2px;
}

.sidebar-language-switcher:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.08) 100%);
  border-color: rgba(255, 255, 255, 0.6);
  outline-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15), inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.sidebar-language-switcher span {
  color: rgba(255, 255, 255, 0.95);
  font-size: 15px;
  letter-spacing: 0.03em;
  margin: 0;
  padding: 0;
  line-height: inherit;
}

/* Show/hide sidebar language toggle based on current language */
.sidebar-language-switcher .lang-toggle-jp {
  display: inline;
}

.sidebar-language-switcher .lang-toggle-en {
  display: none;
}

body.lang-en .sidebar-language-switcher .lang-toggle-jp,
html.lang-en .sidebar-language-switcher .lang-toggle-jp {
  display: none;
}

body.lang-en .sidebar-language-switcher .lang-toggle-en,
html.lang-en .sidebar-language-switcher .lang-toggle-en {
  display: inline;
}

/* Sidebar responsive - small phones */
@media (max-width: 500px) {
  .sidebar-menu {
    width: 45%;
    min-width: 160px;
  }

  .sidebar-links a {
    padding: 14px 16px;
    font-size: 14px;
  }

  .sidebar-language {
    padding: 15px 16px;
  }

  .sidebar-language-switcher {
    padding: 10px 16px;
    font-size: 14px;
  }

  .sidebar-language-switcher span {
    font-size: 14px;
  }
}

/* Sidebar responsive - very small phones */
@media (max-width: 380px) {
  .sidebar-links a {
    padding: 12px 14px;
    font-size: 13px;
  }

  .sidebar-language {
    padding: 12px 14px;
  }

  .sidebar-language-switcher {
    padding: 8px 14px;
    font-size: 13px;
  }

  .sidebar-language-switcher span {
    font-size: 13px;
  }
}

/* Language switcher styles - sophisticated rectangle box */
.language-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 20px 0 0;
  font-family: 'Noto Serif JP', '游明朝', serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.4;
  position: relative;
  cursor: pointer;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
  user-select: none;
  min-width: 70px;
  box-sizing: border-box;
  /* Cool double border effect */
  border: 1px solid rgba(255, 255, 255, 0.4);
  outline: 1px solid rgba(255, 255, 255, 0.15);
  outline-offset: 2px;
}

.language-switcher:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.08) 100%);
  border-color: rgba(255, 255, 255, 0.6);
  outline-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15), inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.language-switcher:active {
  transform: scale(0.98);
}

.language-switcher span {
  color: rgba(255, 255, 255, 0.95);
  text-align: center;
  letter-spacing: 0.05em;
  margin: 0;
  padding: 0;
  line-height: inherit;
}

/* Show/hide based on current language */
.language-switcher .lang-toggle-jp {
  display: inline;
}

.language-switcher .lang-toggle-en {
  display: none;
}

body.lang-en .language-switcher .lang-toggle-jp,
html.lang-en .language-switcher .lang-toggle-jp {
  display: none;
}

body.lang-en .language-switcher .lang-toggle-en,
html.lang-en .language-switcher .lang-toggle-en {
  display: inline;
}

/* ===========================================
   Pre-login page language switcher (JP | EN style)
   Used on: login, register, forgot_password,
   reset_password, error, login_with_recovery,
   reset_recovery_login pages
   =========================================== */

/* Pre-login pages: language switcher in header (absolute positioning) */
.language-switcher.prelogin-header {
  position: absolute;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  outline: none;
  min-width: auto;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.4;
  box-sizing: border-box;
}

/* Pre-login pages: language switcher fixed position (e.g., error page) */
.language-switcher.prelogin-fixed {
  position: fixed;
  top: 20px;
  right: 20px;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  outline: none;
  min-width: auto;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.4;
  box-sizing: border-box;
  z-index: 100;
}

/* Pre-login language switcher span styles */
.language-switcher.prelogin-header span,
.language-switcher.prelogin-fixed span {
  color: white;
  cursor: pointer;
  margin: 0;
  padding: 5px 8px;
  transition: all 0.3s ease;
  user-select: none;
  letter-spacing: normal;
  line-height: 1.4;
  box-sizing: border-box;
}

.language-switcher.prelogin-header span:hover,
.language-switcher.prelogin-fixed span:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* Language divider between JP and EN */
.language-switcher .language-divider {
  cursor: default !important;
  padding: 0 !important;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 3px;
  font-weight: 400;
}

.language-switcher .language-divider:hover {
  background-color: transparent !important;
  color: rgba(255, 255, 255, 0.6) !important;
}

/* Active language highlight */
.language-switcher span.active {
  color: white;
  font-weight: 700;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* Mobile adjustments for pre-login language switcher */
@media (max-width: 768px) {
  .language-switcher.prelogin-header {
    position: absolute;
    top: 55px;
    right: 5px;
    font-size: 14px;
  }

  .language-switcher.prelogin-fixed {
    top: 15px;
    right: 15px;
    font-size: 14px;
  }

  .language-switcher.prelogin-header span,
  .language-switcher.prelogin-fixed span {
    padding: 3px 6px;
  }
}

/* Notification wrapper */
.notification-wrapper {
  position: relative;
  margin-right: 14px;
  cursor: pointer;
  display: inline-block;
  user-select: none;
  -webkit-user-select: none;
}

/* Notification menu styles */
.notification-menu {
  position: fixed;
  background-color: #ffffff;
  border: 1px solid #6b2d44;
  box-shadow: 0 4px 10px rgba(77, 26, 46, 0.2);
  min-width: 220px;
  max-width: 280px;
  display: none;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s;
  transform: translateY(-8px) scale(0.98);
  z-index: 1000;
  font-family: 'Noto Serif JP', '游明朝', serif;
  padding: 0;
  border-radius: 0;
}

.notification-menu.show {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.notification-item {
  padding: 12px 15px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 0.9em;
  line-height: 1.4;
  color: #4d1a2e;
}

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

.notification-item:hover {
  background-color: #f5e0dc;
}

.notification-item a {
  text-decoration: none;
  color: inherit;
}

.unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #f44336;
  border-radius: 50%;
  margin-left: 6px;
}

@media (max-width: 900px) {
  .notification-menu {
    min-width: 140px;
    max-width: 200px;
    width: auto;
    right: 10px;
    left: auto !important;
  }

  .notification-item {
    padding: 8px 10px;
    font-size: 0.75em;
    line-height: 1.3;
  }

  .notification-item.mobile-hide {
    display: none;
  }
}

.bell-icon {
  font-size: 32px;
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
}

.bell-icon:hover {
  color: #fff;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5)) drop-shadow(0 0 15px rgba(255, 255, 255, 0.3));
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: #c9899e;
  color: white;
  font-size: 0.75em;
  padding: 0;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  text-align: center;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(77, 26, 46, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Login/Signup links for non-logged-in users */
.login-signup-links {
  display: flex;
  align-items: center;
  font-family: 'Noto Serif JP', '游明朝', serif;
  font-weight: bold;
  min-width: 160px;
  justify-content: flex-end;
}

.login-signup-links a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
}

.login-signup-links a:hover {
  color: #fff;
}

.login-signup-links span {
  color: rgba(255, 255, 255, 0.6);
  margin: 0 8px;
}

/* Mobile responsive styles */
@media (max-width: 900px) {
  header {
    height: 60px;
    padding: 0 15px;
  }

  .logo-wrapper a {
    height: 60px;
    font-size: 1.8em;
  }

  header img {
    height: 60px;
  }

  /* Hamburger button on mobile */
  .hamburger-btn {
    margin-right: 10px;
    padding: 8px;
  }

  .hamburger-btn span {
    width: 20px;
  }

  .profile-container {
    gap: 12px;
  }

  .profile-info {
    flex-direction: row;
    gap: 8px;
  }

  .profile-circle svg {
    width: 24px;
    height: 24px;
  }

  .profile-name {
    display: none !important;
  }

  .notification-wrapper {
    margin-right: 0;
  }

  .bell-icon {
    font-size: 26px;
  }

  /* Hide header language switcher on mobile - use sidebar instead */
  /* Only hide the box-style switcher, not the pre-login JP|EN style */
  .language-switcher:not(.prelogin-header):not(.prelogin-fixed) {
    display: none !important;
  }

  .notification-badge {
    font-size: 0.7em;
    width: 18px;
    height: 18px;
  }

  .logout-menu {
    min-width: 110px;
    right: 10px;
    left: auto !important;
  }

  .logout-menu a, .logout-link-button {
    font-size: 0.8em;
    padding: 8px 10px;
  }

  .login-signup-links {
    font-size: 0.75em;
  }
}

/* Simple language content rules */
body.lang-jp .lang-en:not(.language-switcher .lang-en) {
  display: none !important;
}

body.lang-en .lang-jp:not(.language-switcher .lang-jp) {
  display: none !important;
}

/* Replace logo image with "Concerota" text */
.logo-wrapper img {
  display: none !important;
}

.logo-wrapper a {
  font-family: 'Bodoni 72 Smallcaps', 'Bodoni 72', 'Bodoni MT', 'Bodoni', 'Playfair Display SC', 'Playfair Display', serif;
  font-size: 2.2em;
  font-weight: 400;
  font-variant: small-caps;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.15em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-left: 15px;
  margin-top: 0;
}

.logo-wrapper a::before {
  content: 'Concerota';
}

.logo-wrapper a:hover {
  text-shadow: 0 2px 12px rgba(255, 255, 255, 0.3);
}

@media (max-width: 900px) {
  .logo-wrapper a {
    font-size: 1.5em;
  }
}
