@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #007aff; /* Apple Blue */
    --sidebar-bg: rgba(15, 23, 42, 0.35); /* Kính mờ tối cho Sidebar */
    --glass-light: rgba(255, 255, 255, 0.15); /* Kính mờ sáng */
    --glass-border: rgba(255, 255, 255, 0.5); /* Viền kính phản quang */
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05); /* Bóng đổ mềm */
    
    --text-main: #1d1d1f; /* Màu chữ chuẩn Apple */
    --text-muted: #86868b;
    --border-color: rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    /* Nền Mesh Gradient chuẩn macOS/iOS */
	 background: url('../images/bg-1.jpg');
    /* background-color: #f5f5f7;
   background-image: 
        radial-gradient(at 0% 0%, rgba(224, 231, 255, 0.8) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(254, 226, 226, 0.8) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(219, 234, 254, 0.8) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(243, 232, 255, 0.8) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(255, 255, 255, 0.8) 0px, transparent 50%); */
    background-attachment: fixed;
	    background-size: cover;
    color: var(--text-main);
    font-size: 14px;
}

.layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* SIDEBAR - TẤM KÍNH TỐI MÀU */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 10;
	
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-style: italic;
    font-size: 20px;
}

.logo h2 { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.logo p { font-size: 10px; color: #94a3b8; letter-spacing: 1px; }

.menu-title {
    margin: 24px 0 12px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.menu {
    width: 100%;
    background: transparent;
    border: none;
    color: #cbd5e1;
    padding: 12px 16px;
    text-align: left;
    border-radius: 12px;
    margin-bottom: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.menu i { width: 18px; text-align: center; font-size: 16px; opacity: 0.8; }

.menu:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.menu.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.menu.active i { opacity: 1; }

.ai-box {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.ai-title { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.ai-title i { color: #a78bfa; }
.ai-box p { font-size: 12px; color: #94a3b8; margin-top: 6px; margin-bottom: 16px; }

.ai-box button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    font-weight: 500;
    cursor: pointer;
}

/* MAIN CONTENT */
.content {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.topbar h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.topbar p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.search-container {
    display: flex;
    align-items: center;
    background: var(--glass-light);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 10px 16px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    width: 400px;
    gap: 12px;
}

.search-container input {
    background: transparent;
    border: none;
    outline: none;
    flex: 1;
    font-size: 14px;
}

.search-hint {
    background: rgba(0,0,0,0.05);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.user-profile { display: flex; align-items: center; gap: 16px; }
.user-profile i { font-size: 18px; color: var(--text-muted); cursor: pointer; }

.avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info strong { display: block; font-size: 14px; }
.user-info span { font-size: 12px; color: var(--text-muted); }

/* HERO & STATS - HIỆU ỨNG KÍNH MỜ SÁNG */
.hero {
    background: linear-gradient(120deg, rgba(255,255,255,0.7), rgba(255,255,255,0.4));
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 24px;
    padding: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 12px;
    background: white;
    color: var(--primary);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.hero h2 { font-size: 34px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.5px; }

.stats { display: flex; gap: 16px; margin-top: 24px; }

.stats div {
    background: var(--glass-light);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 16px 24px;
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    display: flex; flex-direction: column;
}

.stats .stat-top { color: var(--text-muted); font-size: 12px; margin-bottom: 4px; display: flex; gap: 8px; }
.stats strong { font-size: 24px; font-weight: 700; }

/* MODULES (DANH MỤC) */
.section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-title h3 { font-size: 20px; letter-spacing: -0.5px; }

.module-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.module-card {
    background: var(--glass-light);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 20px;
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.module-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
    background: rgba(255, 255, 255, 0.8);
}

.module-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.bg-blue { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.bg-green { background: linear-gradient(135deg, #34d399, #059669); }
.bg-orange { background: linear-gradient(135deg, #fbbf24, #d97706); }
.bg-purple { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.bg-teal { background: linear-gradient(135deg, #2dd4bf, #0d9488); }
.bg-yellow { background: linear-gradient(135deg, #fde047, #ca8a04); }

.module-card h4 { font-size: 15px; margin-bottom: 4px; }
.module-card p { font-size: 12px; color: var(--text-muted); }

/* DOCUMENTS LIST */
.documents {
    background: var(--glass-light);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 24px 32px;
    box-shadow: var(--glass-shadow);
}

.doc-item {
    display: flex;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.doc-item:last-child { border-bottom: none; padding-bottom: 0; }
.doc-item:first-of-type { padding-top: 8px; }

.doc-icon {
    width: 44px; height: 44px;
    background: #fee2e2; color: #ef4444;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; margin-right: 16px;
}

.doc-info { flex: 1; }
.doc-info strong { font-size: 16px; color: var(--text-main); }
.doc-meta { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); margin-top: 8px; align-items: center; }

.tag { padding: 4px 10px; background: rgba(255,255,255,0.8); border: 1px solid rgba(0,0,0,0.05); border-radius: 6px; font-size: 11px; font-weight: 600; }
.tag.tag-blue { background: #eff6ff; color: #1d4ed8; }

.doc-actions a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    background: rgba(0, 122, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s;
}

.doc-actions a:hover { background: var(--primary); color: white; }

/* CHAT PANEL - TẤM KÍNH TRƯỢT TỪ BÊN PHẢI */
.chat-panel {
    width: 400px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border-left: 1px solid var(--glass-border);
    box-shadow: -10px 0 30px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    z-index: 20;
}

.chat-panel.hidden { display: none; }

.chat-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
}

.chat-header-info { display: flex; align-items: center; gap: 12px; }
.chat-header-icon { font-size: 24px; color: #8b5cf6; }
.chat-header h3 { font-size: 16px; display: flex; align-items: center; gap: 6px; }
.badge-beta { background: rgba(0,0,0,0.05); font-size: 10px; padding: 2px 6px; border-radius: 6px; color: var(--text-muted); }
.chat-header p { font-size: 12px; color: var(--text-muted); }
.chat-header-actions i { color: var(--text-muted); margin-left: 16px; cursor: pointer; font-size: 16px; transition: color 0.2s; }
.chat-header-actions i:hover { color: var(--text-main); }

.chat-body {
    flex: 1; padding: 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 20px;
}

.chat-row { display: flex; gap: 12px; align-items: flex-start; }
.chat-row.user { flex-direction: row-reverse; }

.ai-avatar { color: #8b5cf6; font-size: 20px; margin-top: 4px; }

.msg {
    padding: 14px 18px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 14px;
    max-width: 85%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.msg.ai {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--glass-border);
    border-top-left-radius: 4px;
}

.msg.user {
    background: var(--primary);
    color: white;
    border-top-right-radius: 4px;
}

.msg.user .msg-time { color: rgba(255,255,255,0.7); }
.msg-time { font-size: 11px; color: #94a3b8; margin-top: 8px; display: block; text-align: right; }

.chat-input { padding: 20px; border-top: 1px solid var(--border-color); background: rgba(255,255,255,0.3); }

.input-wrapper {
    display: flex; align-items: flex-end;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 8px 10px 8px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.input-wrapper textarea {
    flex: 1; border: none; outline: none; font-size: 14px; resize: none; background: transparent; line-height: 1.5; max-height: 120px; overflow-y: auto; padding-top: 8px;
}

.input-wrapper button {
    width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--primary); color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-left: 10px; margin-bottom: 2px; transition: transform 0.2s;
}

.input-wrapper button:hover { transform: scale(1.05); }

.chat-disclaimer { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 12px; }

/* NÚT CHAT BONG BÓNG */
.floating-chat-btn {
    position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; border-radius: 50%;
    background: var(--glass-light);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    color: var(--primary);
    font-size: 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    cursor: pointer; z-index: 1000; display: none; align-items: center; justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-chat-btn:hover { transform: scale(1.1); background: white; }
.floating-chat-btn.visible { display: flex; animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* PHÂN TRANG (PAGINATION) */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 32px; }

.pagination a {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 12px; border-radius: 10px;
    background: var(--glass-light);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text-main); text-decoration: none; font-size: 14px; font-weight: 500; transition: all 0.2s;
}

.pagination a:hover { border-color: var(--primary); color: var(--primary); background: white; }
.pagination a.active { background: var(--primary); color: white; border-color: var(--primary); }
.pagination a.disabled { opacity: 0.5; pointer-events: none; }

/* TRANG CHI TIẾT (DETAIL PAGE) */
.doc-header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.back-btn { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text-muted); font-weight: 500; padding: 8px 16px; background: var(--glass-light); backdrop-filter: blur(10px); border-radius: 12px; border: 1px solid var(--glass-border); transition: all 0.2s; }
.back-btn:hover { background: white; color: var(--primary); }

.viewer {
    display: flex; height: calc(100vh - 100px);
    background: var(--glass-light);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px; overflow: hidden;
    box-shadow: var(--glass-shadow);
}

.pdf-view { flex: 1; display: flex; flex-direction: column; }

.pdf-toolbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 12px 24px; display: flex; justify-content: space-between; align-items: center;
    font-weight: 500;
}

.pdf-toolbar a {
    background: var(--primary);
    color: white; padding: 8px 16px; border-radius: 8px; text-decoration: none; font-size: 13px;
}

.pdf-content-wrapper { flex: 1; overflow: auto; padding: 0px; display: flex; justify-content: center; }



/* Glass Sidebar Container */
.glass-sidebar {
  --bg-color: rgba(255, 255, 255, 0.25);
  --highlight: rgba(255, 255, 255, 0.75);
  --text: #ffffff;
  
  position: relative;
 
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
  margin: 20px;
  padding:10px;
}

.glass-filter,
.glass-overlay,
.glass-specular {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.glass-filter {
  z-index: 1;
  backdrop-filter: blur(4px);
  filter: url(#glass-distortion) saturate(120%) brightness(1.15);
}

.glass-overlay {
  z-index: 2;
  background: var(--bg-color);
}

.glass-specular {
  z-index: 3;
  box-shadow: inset 1px 1px 1px var(--highlight);
}

.glass-content {
  position: relative;
  z-index: 4;
  color: var(--text);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.sidebar-nav {
  padding: 20px 0;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.3s;
  gap: 12px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
}

.nav-item i {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.nav-item span {
  font-size: 16px;
  opacity: 0.9;
}

/* Dark mode styles */
@media (prefers-color-scheme: dark) {
  .glass-sidebar {
    --bg-color: rgba(0, 0, 0, 0.25);
    --highlight: rgba(255, 255, 255, 0.15);
  }
}