/* 
 * layout.css
 * [WARNING] 繧ｵ繧､繝亥・菴薙・蜈ｱ騾夐ｪｨ邨・∩縺ｧ縺吶ゅ・繝ｼ繧ｸ蝗ｺ譛峨・菫ｮ豁｣縺ｮ縺溘ａ縺ｫ縺薙％繧呈嶌縺肴鋤縺医↑縺・〒縺上□縺輔＞縲・
 * 菫ｮ豁｣縺悟ｿ・ｦ√↑蝣ｴ蜷医・ css/pages/ 蜀・・蜷・ヵ繧｡繧､繝ｫ縺ｧ荳頑嶌縺阪＠縺ｦ縺上□縺輔＞縲・
 * 迚ｹ縺ｫ body 縺ｸ縺ｮ overflow: hidden 霑ｽ蜉縺ｯ sticky 繧堤ｴ螢翫☆繧九◆繧∝宍遖√〒縺吶・
 */

/* Navigation */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5%;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.logo a {
  color: inherit;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-1);
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--accent-color);
}

.nav-links a:hover::after {
  width: 100%;
}

/* Active State for Navigation */
.nav-links a.active {
  color: var(--accent-color);
}

.nav-links a.active::after {
  width: 100%;
}

/* Layout Container */
.page-wrapper {
  padding-top: var(--nav-height);
  min-height: 100vh;
  position: relative;
}

/* Base body adjustments for sticky and preventing horizontal overflow */
body {
  overflow-x: hidden;
  width: 100%;
}

/* Background Decoration Base */
.bg-decoration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -1; /* Behind content */
  pointer-events: none; /* Let clicks pass through */
}

.bg-decoration .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
}

.layout-container {
  max-width: 100%;
  margin: 0;
  padding: 1rem 5% 4rem 5%;
  display: grid;
  grid-template-columns: 300px 1fr; /* Two columns only */
  gap: 0; /* Gap is handled by margins for better precision */
  align-items: start;
}

.main-content {
  grid-column: 2;
  min-width: 0;
  max-width: 800px;
  width: 90%; /* Responsive width within the column */
  margin: 0 auto; /* This centers it perfectly in the space to the right of the sidebar */
}

/* Sidebar */
.sidebar {
  grid-column: 1;
  width: 300px;
  position: sticky;
  top: calc(var(--nav-height) + 1rem);
  height: fit-content;
  align-self: start;
  order: -1;
}

.sidebar-widget {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 15px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

.sidebar-widget h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e0f2fe; /* Light pastel blue border */
  color: #555;
}

/* Sidebar Nav List (New) */
.sidebar-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav-list li {
  margin-bottom: 0.5rem;
}

.sidebar-nav-list a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  text-decoration: none;
  color: #475569;
  font-size: 0.9rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.sidebar-nav-list a:hover {
  background: #f8fafc;
  color: var(--accent-color);
  transform: translateX(5px);
}

.sidebar-nav-list a.active,
.sidebar-nav-list li.active-link a {
  background: #f0f7ff;
  color: var(--accent-color);
  font-weight: 700;
  border-left: 4px solid var(--accent-color);
  padding-left: calc(1rem - 4px); /* Adjust padding to keep alignment */
}

/* --- Bottom Navigation (3-Button Layout) --- */
.page-nav-3btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 4rem;
  flex-wrap: wrap;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  background: #fff;
  border: 2px solid #cbd5e1;
  color: #64748b;
  min-width: 140px;
  justify-content: center;
}

.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.nav-btn.list {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

.nav-btn.list:hover {
  background: #e2e8f0;
  color: #334155;
}

.nav-btn.prev i,
.nav-btn.next i {
  font-size: 0.9em;
}

/* Gradient Navigation Button (Next) */
.nav-btn.next {
  background: linear-gradient(135deg, #22d3ee 0%, #34d399 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 6px rgba(52, 211, 153, 0.3);
}

.nav-btn.next:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(52, 211, 153, 0.4);
  filter: brightness(1.05);
  color: #fff; /* Ensure text stays white */
}

/* --- Restored Styles --- */

.sidebar-group-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 1.5rem 0 0.5rem 0.5rem;
}

.sidebar-group-label:first-child {
  margin-top: 0;
}

.sidebar-nav-list i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  color: var(--accent-color);
}

/* Sidebar Advice Text (Updated to match sample design) */
.sidebar-advice {
  border: 2px solid #fcd34d; /* Yellow border */
  border-radius: 12px;
  padding: 1.5rem;
  background: #ffffff;
}

/* Compact Widget variant for Advice to reduce internal spacing */
.sidebar-widget.compact {
  padding: 0.8rem; /* Reduced from 1.5rem */
}

.sidebar-advice .header {
  font-weight: 700;
  color: #d97706; /* Orange text */
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px dashed #fcd34d; /* Dashed separator */
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  white-space: normal;
}

.sidebar-advice .header i {
  color: #d97706; /* Orange Icon */
}

.sidebar-advice p {
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.8;
}

/* Footer (Extracted from Genki Block as it is layout) */
/* Footer (Extracted from Genki Block as it is layout) */
/* .site-footer removed as per user request to keep inline styles */
/* Re-added for genki_methods.html refactor */
.site-footer {
  text-align: center;
  padding: 4rem 2rem;
  width: 100%;
  color: #64748b;
  margin-top: 2rem;
}

/* Common Components */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  background: var(--gradient-1);
  color: #fff;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(56, 189, 248, 0.3);
}

/* Sections */
section {
  padding: 0;
  margin-bottom: 5rem;
}

/* Standard Content Typography (Ref: positive_go/answer_within) */
.content-block {
  line-height: 2;
  color: #475569;
  font-size: 1.05rem;
}

.content-block p {
  margin-bottom: 2rem;
}

/* Responsive Layout */


/* --- Visual Centering Fix: Logic based on remaining space --- */
@media (max-width: 1100px) {
  .layout-container {
    grid-template-columns: 1fr;
    padding: 2rem 5%;
    display: flex; /* Switch to flex on mobile for easier order control */
    flex-direction: column;
  }
  .main-content {
    width: 100%;
    max-width: 100%;
    margin: 0 0 3rem 0;
    order: 1; /* Main content first */
  }
  .sidebar {
    width: 100%;
    position: relative; /* Disable sticky on mobile */
    top: 0;
    order: 2; /* Sidebar below main content */
    margin-top: 2rem;
  }
}
/* ==========================================
   NAVIGATION DROPDOWN (Category Bento Box)
   ========================================== */
.nav-category-dropdown {
  position: relative;
  display: inline-block;
}

.nav-category-dropdown.is-active .dropdown-content {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.dropdown-content {
  visibility: hidden;
  position: absolute;
  right: -10px;
  top: 150%;
  /* 🌟 グラスモーフィズムを強化（すりガラスの透明感をアップ） */
  background-color: rgba(255, 255, 255, 0.85); 
  backdrop-filter: blur(25px) saturate(120%);
  min-width: 290px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  border: 1px solid rgba(140, 153, 134, 0.2);
  z-index: 1000;
  opacity: 0;
  transform: translateY(15px) scale(0.98);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dropdown-content::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 20px;
  width: 14px;
  height: 14px;
  /* 背景の透明度に合わせる */
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(25px);
  transform: rotate(45deg);
  border-left: 1px solid rgba(140, 153, 134, 0.2);
  border-top: 1px solid rgba(140, 153, 134, 0.2);
  box-shadow: -2px -2px 10px rgba(0, 0, 0, 0.02);
}

.dropdown-scroll-area {
  max-height: 65vh;
  overflow-y: auto;
  padding: 1.5rem 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}

/* Scrollbar styling for dropdown */
.dropdown-scroll-area::-webkit-scrollbar {
  width: 6px;
}
.dropdown-scroll-area::-webkit-scrollbar-track {
  background: transparent;
}
.dropdown-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(140, 153, 134, 0.3);
  border-radius: 10px;
}

.dropdown-scroll-area a.app-tile {
  color: var(--text-color) !important;
  padding: 0.8rem 0.2rem !important;
  text-decoration: none;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  height: auto;
  min-height: 85px;
  position: relative;
  z-index: 1;
}

/* ホバー時の背景を可愛いすりガラスに */
.dropdown-scroll-area a.app-tile::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  z-index: -1;
  opacity: 0;
  transform: scale(0.85);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dropdown-scroll-area a.app-tile:hover {
  background-color: transparent;
  transform: translateY(-4px); /* ポンッと上にはねる */
}

.dropdown-scroll-area a.app-tile:hover::before {
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.03);
}

.dropdown-scroll-area .app-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white; /* Icon color inside the colorful circle */
  font-size: 1.2rem;
  /* 🌟 変数を使ってグラデーションと光（シャドウ）を生成 🌟 */
  background: var(--app-color);
  background-image: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 100%);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08), inset 0 2px 4px rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.8);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dropdown-scroll-area a.app-tile:hover .app-icon {
  transform: scale(1.15) rotate(8deg);
  /* ホバー時はさらにピカッと光る */
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15), inset 0 2px 6px rgba(255, 255, 255, 0.9);
}

.dropdown-scroll-area .app-name {
  font-size: 0.75rem !important;
  font-family: "Zen Kaku Gothic New", sans-serif;
  letter-spacing: 0.05em;
  text-align: center;
  line-height: 1.2;
  font-weight: 500;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================
   Share Bar Styles
   ========================================= */
.share-bar-container {
    text-align: center;
    margin: 4rem auto 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    max-width: 400px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease-out;
}

.share-bar-container.share-visible {
    opacity: 1;
    transform: translateY(0);
}

.share-bar-title {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: bold;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.share-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(100, 116, 139, 0.08); /* 淡いグレーの背景 */
    color: #64748b; /* 落ち着いたグレーのアイコン色 */
    font-size: 1.2rem;
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s, background 0.3s, color 0.3s;
    border: 1px solid rgba(100, 116, 139, 0.15);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.share-btn:hover {
    transform: translateY(-5px) scale(1.1);
    color: white;
    border-color: transparent;
}

/* 普段は色無し、hover時（マグネットで吸い付いた瞬間）に色付きになる */
.share-x:hover { background: #0f1419; box-shadow: 0 8px 15px rgba(15, 20, 25, 0.3); }
.share-fb:hover { background: #1877f2; box-shadow: 0 8px 15px rgba(24, 119, 242, 0.3); }
.share-line:hover { background: #06c755; box-shadow: 0 8px 15px rgba(6, 199, 85, 0.3); }
.share-copy:hover { background: #64748b; box-shadow: 0 8px 15px rgba(100, 116, 139, 0.3); }

.copy-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(15, 23, 42, 0.9);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: bold;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10000;
}

.copy-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
