/* ==========================================================================
   MagiMir Support - Light Theme (Tone Trắng + Xanh Dương Nhẹ)
   Author: Tùng Mũ Vàng
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Premium Light Palette (Tone Trắng + Xanh Dương Nhẹ) */
  --bg-dark: #f1f5f9;
  --bg-primary: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-tertiary: #e2e8f0;

  --border-color: #e2e8f0;
  --border-card: #e2e8f0;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;

  --accent-cyan: #0284c7;  /* Soft Ocean Blue */
  --accent-blue: #2563eb;  /* Soft Royal Blue */
  --accent-cyan-glow: rgba(2, 132, 199, 0.12);

  --sidebar-width: 310px;
  --header-height: 64px;

  /* Callout Colors for Light Theme */
  --green-bg: #f0fdf4;
  --green-border: #22c55e;
  --green-text: #166534;

  --amber-bg: #fffbeb;
  --amber-border: #f59e0b;
  --amber-text: #92400e;

  --red-bg: #fef2f2;
  --red-border: #ef4444;
  --red-text: #991b1b;
}

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

html {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-dark);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
}

/* --- Header Navigation Bar (Clean White) --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.2rem;
  cursor: pointer;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb 0%, #0284c7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.logo-text-box {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.logo-subtitle {
  font-size: 0.7rem;
  color: var(--text-subtle);
  font-weight: 600;
}

.header-center {
  flex: 1;
  max-width: 540px;
  margin: 0 2rem;
}

.search-input-box {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-box i {
  position: absolute;
  left: 1rem;
  color: var(--text-subtle);
  font-size: 0.9rem;
}

.search-input-field {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.4rem;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  color: var(--text-main);
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s;
}

.search-input-field:focus {
  background-color: #ffffff;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* --- Main Layout --- */
.layout-container {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  width: 100%;
}

/* --- Left Sidebar (Square Box Menu Buttons like Sample 2) --- */
.sidebar {
  width: var(--sidebar-width);
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  background-color: #f8fafc;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 1.5rem 1rem;
  z-index: 900;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  text-decoration: none;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 600;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sidebar-link span {
  white-space: nowrap;
}

.sidebar-link i {
  font-size: 1.05rem;
  width: 22px;
  text-align: center;
  color: #2563eb;
  transition: all 0.2s ease;
}

.sidebar-link:hover {
  color: #1d4ed8;
  background-color: #f0f6ff;
  border-color: #bfdbfe;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.08);
}

.sidebar-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #1d4ed8;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.sidebar-link.active i {
  color: #ffffff;
}

.sidebar-link.fix-link {
  color: #dc2626;
  border-color: #fecaca;
  background-color: #fff5f5;
}

.sidebar-link.fix-link i {
  color: #dc2626;
}

.sidebar-link.fix-link:hover {
  color: #b91c1c;
  background-color: #fee2e2;
  border-color: #fca5a5;
}

.sidebar-link.fix-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-color: #dc2626;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
}

.sidebar-link.fix-link.active i {
  color: #ffffff;
}

/* --- Main Content Full Width --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2.5rem 3rem 5rem 3rem;
  width: calc(100% - var(--sidebar-width));
  background-color: var(--bg-primary);
}

.doc-section {
  display: none;
  animation: fadeIn 0.3s ease;
  width: 100%;
}

.doc-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Centered Square Cards Grid & Balanced Containers --- */
.page-main-header {
  margin: 0 auto 2rem auto;
  max-width: 1150px;
  width: 100%;
}

.page-main-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.35rem;
}

.page-main-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  max-width: 1150px;
  margin: 0 auto;
  width: 100%;
}

.card-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 1.25rem;
  padding: 1.35rem 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.25s ease;
  min-height: 190px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
}

.card-item:hover {
  background-color: #ffffff;
  border-color: #93c5fd;
  transform: translateY(-3px);
  box-shadow: 0 12px 24px -6px rgba(37, 99, 235, 0.12);
}

.card-item.fix-card {
  border-color: #fca5a5;
  background-color: #fff5f5;
}

.card-item.fix-card:hover {
  border-color: #ef4444;
  box-shadow: 0 12px 24px -6px rgba(239, 68, 68, 0.15);
}

.card-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 0.65rem;
  background-color: #eff6ff;
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin-bottom: 0.85rem;
}

.card-item.fix-card .card-icon-box {
  background-color: #fee2e2;
  color: #dc2626;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.card-item.fix-card .card-title {
  color: #dc2626;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.card-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.card-category-label {
  color: var(--text-subtle);
}

.card-link-action {
  color: var(--accent-blue);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.card-item:hover .card-link-action {
  color: #1d4ed8;
}

/* --- Detail Page View Container Light Mode (Perfectly Centered & Expanded 1150px) --- */
.back-link-bar {
  margin: 0 auto 1.5rem auto;
  max-width: 1150px;
  width: 100%;
}

.back-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.back-link-btn:hover {
  color: var(--accent-blue);
}

.detail-card-container {
  background-color: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 1.25rem;
  padding: 2.5rem 3rem;
  max-width: 1150px;
  margin: 0 auto;
  width: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.detail-tag-pill {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  background-color: #eff6ff;
  color: var(--accent-blue);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
}

.detail-main-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  margin-bottom: 1.5rem;
}

.detail-intro-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 0.75rem;
}

.detail-intro-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

/* --- Callout Boxes Light Mode --- */
.allowed-box {
  background-color: var(--green-bg);
  border: 1px solid var(--green-border);
  border-radius: 0.85rem;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  width: 100%;
}

.allowed-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--green-text);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.prohibited-box {
  background-color: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-radius: 0.85rem;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  width: 100%;
}

.prohibited-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--amber-text);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.box-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: #334155;
  padding-left: 0.5rem;
}

.box-list li {
  position: relative;
  padding-left: 1.25rem;
  line-height: 1.6;
}

.allowed-box .box-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--green-border);
  font-weight: bold;
}

.prohibited-box .box-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--amber-border);
  font-weight: bold;
}

/* Code Blocks Light Theme */
.code-wrapper {
  position: relative;
  margin: 1.25rem 0;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  width: 100%;
}

.code-header {
  background-color: #f1f5f9;
  color: var(--text-subtle);
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
}

.copy-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 0.35rem;
  cursor: pointer;
  font-weight: 600;
}

.copy-btn.copied {
  background-color: #22c55e;
  color: #ffffff;
  border-color: #22c55e;
}

pre code {
  display: block;
  background-color: #0f172a;
  color: #f8fafc;
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  overflow-x: auto;
}

/* Responsive Breakpoints */
@media (max-width: 1300px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
  .mobile-menu-btn { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; width: 100%; padding: 1.75rem 1.25rem 4rem 1.25rem; }
  .cards-grid { grid-template-columns: 1fr; }
  .detail-card-container { padding: 1.5rem; }
}

/* --- Clickable Zoomable Images & Full-size Lightbox --- */
.detail-card-container img,
.prohibited-box img,
.allowed-box img {
  cursor: zoom-in;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.detail-card-container img:hover,
.prohibited-box img:hover,
.allowed-box img:hover {
  transform: scale(1.015);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.image-lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1.5rem;
  box-sizing: border-box;
}

.image-lightbox-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-modal-img {
  max-width: 94vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 0.75rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  cursor: zoom-out;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.image-lightbox-modal.active .lightbox-modal-img {
  transform: scale(1);
}

.lightbox-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.75rem;
  color: #ffffff;
  font-size: 2.5rem;
  font-weight: 300;
  cursor: pointer;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
}

.lightbox-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.lightbox-caption {
  margin-top: 1rem;
  color: #e2e8f0;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  max-width: 800px;
}
