/* ===================================================
   DATA HUB ION CITY - 16 MỤC 2 CẤP DIRECTORY SYSTEM
   Theme: ION CITY Mint Spicy (#70892E) • Mallard Green (#203E17) • Bright Cream (#FFFED9)
   Typography: Plus Jakarta Sans & Manrope (Clean Geometric Sans)
   Strict Scale: 3 Tokens Only (--fs-lg, --fs-md, --fs-sm)
   =================================================== */

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

:root {
  /* ===================================================
     STRICT TYPOGRAPHY SYSTEM (3 CẤP ĐỘ RÕ RÀNG)
     =================================================== */
  --fs-lg: 15px;   /* Level 1: Tiêu đề 16 Thư mục Mẹ & Brand Title */
  --fs-md: 13.5px; /* Level 2: Tên tài liệu con, Nút bấm, Ô tìm kiếm */
  --fs-sm: 12px;   /* Level 3: Badge số lượng, Pill định dạng, Subtext */
  
  --lh-lg: 1.4;
  --lh-md: 1.5;
  --lh-sm: 1.4;

  /* Font Family - Ultra Legible Modern Sans */
  --font-main: 'Plus Jakarta Sans', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Palette ION CITY Chuẩn Brand Guideline */
  --mint-spicy: #70892E;            /* Màu chủ đạo chính */
  --mint-spicy-light: #8BA838;
  --mallard-green: #203E17;          /* Màu xanh Mallard chuẩn nhận diện */
  --mallard-green-deep: #12240D;
  --mallard-green-darkest: #0A1608;

  --bright-cream: #FFFED9;           /* Màu kem sáng kim loại */
  --bright-cream-bright: #FFFFF0;
  --bright-cream-soft: rgba(255, 254, 217, 0.85);

  --glass-border: rgba(255, 254, 217, 0.22);
  --glass-border-hover: rgba(255, 254, 217, 0.6);

  --glass-surface: rgba(24, 48, 18, 0.78);
  --glass-surface-elevated: rgba(32, 62, 23, 0.92);
  --glass-blur: blur(16px) saturate(180%);

  --text-white: #FFFFFF;
  --text-cream: #FFFED9;
  --text-muted: #A8C896;
  --text-soft: #EEF6E8;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-glass: 0 8px 24px rgba(0, 20, 10, 0.35), inset 0 1px 0 rgba(255, 254, 217, 0.2);
  --shadow-glass-hover: 0 14px 40px rgba(0, 15, 8, 0.5), 0 0 16px rgba(255, 254, 217, 0.15);
  --shadow-mint: 0 4px 15px rgba(112, 137, 46, 0.35);

  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Strict Mobile Scaling */
@media (max-width: 900px) {
  :root {
    --fs-lg: 14px;
    --fs-md: 13px;
    --fs-sm: 11.5px;
  }
}

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

body {
  font-family: var(--font-main);
  font-size: var(--fs-md);
  line-height: var(--lh-md);
  background-color: #162C11;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(112, 137, 46, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(255, 254, 217, 0.08) 0%, transparent 45%),
    linear-gradient(180deg, #0D1C0B 0%, #1A3513 35%, #0F200D 100%);
  background-attachment: fixed;
  color: var(--text-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  position: relative;
}

/* Subtle Architectural Grid Pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(rgba(255, 254, 217, 0.06) 1px, transparent 1px),
    linear-gradient(to right, rgba(112, 137, 46, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(112, 137, 46, 0.04) 1px, transparent 1px);
  background-size: 24px 24px, 48px 48px, 48px 48px;
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3, h4, .brand-text h1, .folder-title-text, .footer-logo-title {
  font-family: var(--font-main);
  font-weight: 800;
  letter-spacing: -0.015em;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
  font-size: var(--fs-md);
  cursor: pointer;
  border: none;
  background: none;
  transition: var(--transition);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--mallard-green-darkest);
}
::-webkit-scrollbar-thumb {
  background: var(--mint-spicy);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--bright-cream);
}

/* ===================================================
   HEADER (TINH GỌN • DATA HUB ION CITY)
   =================================================== */
.tuta-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 22, 8, 0.94);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-link {
  display: flex;
  align-items: center;
}

.brand-logo-img {
  height: 35px;
  width: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.brand-divider {
  width: 1px;
  height: 26px;
  background: var(--glass-border);
  opacity: 0.6;
}

.brand-text {
  display: flex;
  align-items: center;
}

.brand-sub-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--bright-cream);
  text-transform: uppercase;
  background: rgba(112, 137, 46, 0.35);
  border: 1px solid var(--glass-border);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.brand-main-title {
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-white);
  text-transform: uppercase;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-header-sync,
.btn-header-drive {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 13px;
  height: 30px;
  font-size: var(--fs-sm);
  font-weight: 700;
  border-radius: var(--radius-pill);
  transition: var(--transition);
  white-space: nowrap;
}

.btn-header-sync {
  background: rgba(112, 137, 46, 0.25);
  border: 1px solid var(--glass-border);
  color: var(--bright-cream);
}

.btn-header-sync:hover {
  background: rgba(112, 137, 46, 0.45);
  border-color: var(--bright-cream);
  color: var(--text-white);
}

.btn-header-sync.syncing i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.btn-header-drive {
  background: linear-gradient(135deg, var(--mint-spicy) 0%, #8BA838 100%);
  border: 1px solid rgba(255, 254, 217, 0.3);
  color: var(--text-white);
}

.btn-header-drive:hover {
  filter: brightness(1.15);
  box-shadow: 0 4px 12px rgba(112, 137, 46, 0.4);
}

/* ===================================================
   MAIN CONTAINER
   =================================================== */
.datahub-main-container {
  position: relative;
  z-index: 10;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* Search Box */
.search-controls-wrapper {
  margin-bottom: 20px;
}

.search-input-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--glass-surface);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 4px 14px;
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-glass);
  transition: var(--transition);
}

.search-input-box:focus-within {
  border-color: var(--bright-cream);
  box-shadow: 0 0 16px rgba(255, 254, 217, 0.2), var(--shadow-glass);
  background: var(--glass-surface-elevated);
}

.search-icon {
  font-size: var(--fs-md);
  color: var(--bright-cream);
  margin-right: 10px;
}

.mindmap-search-input {
  width: 100%;
  height: 38px;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: var(--fs-md);
  color: var(--text-white);
}

.mindmap-search-input::placeholder {
  color: var(--text-muted);
  font-size: var(--fs-md);
}

.btn-clear-search {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  padding: 4px 8px;
  display: none;
}

.btn-clear-search:hover {
  color: var(--text-white);
}

/* ===================================================
   16 CATEGORIES DIRECTORY (ACCORDION CẤP 1 -> CẤP 2)
   =================================================== */
.royal-directory-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.royal-folder-card {
  background: var(--glass-surface);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-md);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-glass);
  transition: var(--transition);
  overflow: hidden;
}

.royal-folder-card:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-glass-hover);
  background: var(--glass-surface-elevated);
}

.royal-folder-card.open {
  border-color: var(--bright-cream);
  background: var(--glass-surface-elevated);
  box-shadow: 0 10px 30px rgba(0, 15, 8, 0.5), 0 0 14px rgba(255, 254, 217, 0.15);
}

/* Header Thư mục Mẹ (Cấp 1) */
.folder-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  gap: 12px;
}

.folder-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.folder-icon-box {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: linear-gradient(135deg, var(--mint-spicy) 0%, #4D611D 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bright-cream);
  font-size: var(--fs-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.folder-title-text {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-meta-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.folder-count-badge {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--bright-cream);
  background: rgba(112, 137, 46, 0.35);
  border: 1px solid var(--glass-border);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.folder-chevron-icon {
  font-size: var(--fs-sm);
  color: var(--bright-cream);
  transition: transform var(--transition);
}

.royal-folder-card.open .folder-chevron-icon {
  transform: rotate(180deg);
}

/* Thân Thư mục Con (Cấp 2) */
.folder-items-body {
  display: none;
  padding: 0 14px 12px;
  border-top: 1px solid rgba(255, 254, 217, 0.1);
}

.royal-folder-card.open .folder-items-body {
  display: block;
}

.folder-checklist-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

/* Từng Hàng Tài Liệu Con */
.folder-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(10, 26, 12, 0.65);
  border: 1px solid rgba(255, 254, 217, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: var(--fs-md);
  font-weight: 600;
  transition: var(--transition);
  gap: 10px;
}

.folder-link-item:hover {
  background: rgba(112, 137, 46, 0.3);
  border-color: var(--bright-cream);
  color: var(--text-white);
  transform: translateX(3px);
}

.folder-link-item.pending {
  background: rgba(10, 26, 12, 0.4);
  border-color: rgba(245, 158, 11, 0.25);
  cursor: pointer;
}

.folder-link-item.pending:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: #FBBF24;
  transform: none;
}

.item-left-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.item-type-icon {
  font-size: var(--fs-md);
  flex-shrink: 0;
}

.item-type-icon.pdf { color: #EF4444; }
.item-type-icon.image { color: #38BDF8; }
.item-type-icon.video { color: #EC4899; }
.item-type-icon.excel { color: #10B981; }
.item-type-icon.zip { color: #F59E0B; }
.item-type-icon.link { color: var(--bright-cream); }

.item-title-text {
  font-size: var(--fs-md);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-right-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.item-type-pill {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--bright-cream);
  background: rgba(112, 137, 46, 0.3);
  border: 1px solid var(--glass-border);
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.item-open-icon {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  transition: var(--transition);
}

.folder-link-item:hover .item-open-icon {
  color: var(--bright-cream);
  transform: translate(2px, -2px);
}

.item-status-pending {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #FBBF24;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Empty Search State */
.empty-search-state {
  text-align: center;
  padding: 40px 20px;
  background: var(--glass-surface);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-md);
  margin-top: 20px;
}

.empty-icon {
  font-size: 32px;
  color: var(--bright-cream);
  margin-bottom: 10px;
}

.empty-search-state h3 {
  font-size: var(--fs-lg);
  color: var(--bright-cream);
  margin-bottom: 4px;
}

.empty-search-state p {
  font-size: var(--fs-md);
  color: var(--text-muted);
}

/* ===================================================
   TOAST NOTIFICATION (CĂN GIỮA MÀN HÌNH)
   =================================================== */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 120px);
  background: rgba(10, 24, 12, 0.96);
  backdrop-filter: blur(20px);
  border: 1.5px solid var(--bright-cream);
  color: var(--bright-cream);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-md);
  font-weight: 700;
  z-index: 9999;
  opacity: 0;
  max-width: 90vw;
  width: max-content;
  text-align: center;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast-notification.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* ===================================================
   FOOTER (TINH GỌN • ĐỒNG BỘ 100%)
   =================================================== */
.tuta-footer {
  background: rgba(8, 18, 9, 0.96);
  border-top: 1px solid var(--glass-border);
  padding: 24px 20px;
  text-align: center;
}
.footer-container {
  max-width: 1100px;
  margin: 0 auto;
}
.footer-logos-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 10px;
}
.footer-logo-main {
  height: 28px;
  width: auto;
  object-fit: contain;
}
.footer-logo-divider {
  width: 1px;
  height: 20px;
  background: var(--glass-border);
}
.footer-logo-partner {
  height: 26px;
  width: 26px;
  border-radius: 50%;
  object-fit: contain;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.footer-logo-title {
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--bright-cream);
  margin-bottom: 4px;
}
.footer-text {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .header-container {
    padding: 8px 12px;
  }
  
  .brand-logo-img {
    height: 26px;
  }

  .brand-sub-title {
    font-size: 11px;
  }

  .brand-main-title {
    font-size: 13.5px;
  }

  .btn-header-sync,
  .btn-header-drive {
    height: 28px;
    padding: 0 10px;
    font-size: 11.5px;
  }

  .datahub-main-container {
    padding: 16px 12px 40px;
  }

  .folder-header-bar {
    padding: 10px 12px;
  }

  .folder-icon-box {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 13px;
  }
}
