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

*,
*::before,
*::after {
  box-sizing: border-box !important;
}

:root {
  --primary: #4f46e5;
  --bg: #f3f4f6;
  --sidebar-bg: #ffffff;
  --text: #1f2937;

  /* Category Colors */
  --c-housing: #2563eb;
  --bg-housing: #eff6ff;
  --c-travel: #0ea5e9;
  --bg-travel: #e0f2fe;
  --c-id: #7c3aed;
  --bg-id: #f5f3ff;
  --c-tax: #059669;
  --bg-tax: #ecfdf5;
  --c-medical: #dc2626;
  --bg-medical: #fef2f2;
  --c-auto: #d97706;
  --bg-auto: #fffbeb;
  --c-media: #db2777;
  --bg-media: #fce7f3;
  --c-business: #4b5563;
  --bg-business: #f3f4f6;
  --c-education: #0d9488 !important; /* Teal color */
  --bg-education: #f0fdfa !important; /* Light Teal bg */
  --c-other: #6b7280;
  --bg-other: #f9fafb;
}

html,
body {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important; /* ဘေးတိုက် Scroll ကို အသေပိတ်မယ် */
  position: relative;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", "Padauk", sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;

  /* စာလုံးတွေကို ပိုရှင်းလင်းစေမည့် ကုဒ် */
  -webkit-font-smoothing: antialiased;
}

/* Layout */
#appContainer {
  display: flex;
  height: 100vh;
  width: 100% !important;
  overflow-x: hidden !important;
}

/* Auth */
.auth-container {
  height: 100vh;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(
    135deg,
    #4f46e5 0%,
    #06b6d4 100%
  ); /* Indigo to Cyan */
  position: relative;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
  opacity: 0.6;
}
.shape-1 {
  width: 300px;
  height: 300px;
  background: #a855f7; /* Purple */
  top: -50px;
  left: -50px;
  animation: floatShape 8s infinite alternate;
}
.shape-2 {
  width: 250px;
  height: 250px;
  background: #ffc107; /* Yellow */
  bottom: -50px;
  right: -50px;
  animation: floatShape 10s infinite alternate-reverse;
}

@keyframes floatShape {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(30px, 30px);
  }
}

.auth-box {
  position: relative;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9); /* အဖြူရောင် မှန်ကြည် */
  backdrop-filter: blur(20px); /* နောက်ခံဝါးမယ့် Effect */
  padding: 50px 40px;
  border-radius: 30px;
  text-align: center;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.5);
  animation: slideUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.login-icon-wrapper {
  background: #fff;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.2);
}
.login-icon-wrapper i {
  font-size: 2.5rem;
  color: #ffc107; /* Yellow Folder */
  filter: drop-shadow(0 2px 4px rgba(255, 193, 7, 0.4));
  animation: pulseIcon 3s infinite;
}

@keyframes pulseIcon {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.auth-box h1 {
  font-size: 1.1rem;
  color: #6b7280;
  margin: 0 0 5px 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.app-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px; /* Text နဲ့ Pro ကြား ခွာမယ် */
  margin-bottom: 20px;

  font-size: 2rem;
  font-weight: 900;
  color: #1f2937;
  /* margin: 0 0 15px 0; */
}

/* 2. DocKeeper Text Style */
.login-brand-text {
  font-family: "Poppins", sans-serif;
  font-size: 2.2rem; /* စာလုံးကြီးကြီးပြမယ် */
  font-weight: 800;
  display: flex;
  letter-spacing: 1px;
}

/* 3. Individual Letter Colors (Google Colors Style) */
.login-brand-text span:nth-child(1) {
  color: #4285f4;
} /* D - Blue */
.login-brand-text span:nth-child(2) {
  color: #ea4335;
} /* o - Red */
.login-brand-text span:nth-child(3) {
  color: #fbbc05;
} /* c - Yellow */
.login-brand-text span:nth-child(4) {
  color: #34a853;
} /* K - Green */
.login-brand-text span:nth-child(5) {
  color: #4285f4;
} /* e - Blue */
.login-brand-text span:nth-child(6) {
  color: #ea4335;
} /* e - Red */
.login-brand-text span:nth-child(7) {
  color: #9333ea;
} /* p - Purple */
.login-brand-text span:nth-child(8) {
  color: #f97316;
} /* e - Orange */
.login-brand-text span:nth-child(9) {
  color: #34a853;
} /* r - Green */

/* Animation: စာလုံးလေးတွေ ခုန်နေအောင် (Optional) */
.login-brand-text span {
  display: inline-block;
  transition: transform 0.3s;
}
.login-brand-text:hover span {
  animation: bounce 0.6s infinite alternate;
}
@keyframes bounce {
  to {
    transform: translateY(-5px);
  }
}

/* 4. "Pro" Badge Design */
.pro-badge {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.4);
  transform: rotate(-5deg); /* နည်းနည်းစောင်းမယ် */
  position: relative;
  top: -10px; /* အပေါ်နည်းနည်းတင်မယ် */
}

/* --- DARK MODE ADJUSTMENTS --- */
/* Dark Mode မှာ အရောင်တွေကို ပိုလင်းအောင် ပြင်မယ် */
body.dark-mode .login-brand-text span:nth-child(1) {
  color: #60a5fa;
}
body.dark-mode .login-brand-text span:nth-child(2) {
  color: #f87171;
}
body.dark-mode .login-brand-text span:nth-child(4) {
  color: #4ade80;
}
body.dark-mode .login-brand-text span:nth-child(5) {
  color: #60a5fa;
}

/* .app-brand span {
  color: #4f46e5;
} */

.login-desc {
  color: #4b5563;
  margin-bottom: 35px;
  line-height: 1.6;
  font-size: 0.95rem;
}

.btn-google {
  background: #ffffff;
  color: #374151;
  border: 1px solid #e5e7eb;
  padding: 0;
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  height: 56px;
  overflow: hidden;
}

.btn-google:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  background: #f9fafb;
}
.btn-google:active {
  transform: scale(0.98);
}

.google-icon-wrapper {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-right: 1px solid #f3f4f6;
}
.google-icon-wrapper i {
  font-size: 1.5rem;
  background: -webkit-linear-gradient(
    45deg,
    #4285f4,
    #ea4335,
    #fbbc05,
    #34a853
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-google span {
  flex: 1;
  text-align: center;
}

/* 7. Footer */
.login-footer {
  margin-top: 30px;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* --- DARK MODE LOGIN --- */
/* (Browser က Dark Mode ဖြစ်နေရင် Login Screen ကိုပါ အမည်းပြောင်းပေးခြင်း) */
@media (prefers-color-scheme: dark) {
  .auth-box {
    background: rgba(31, 41, 55, 0.9);
    border-color: rgba(75, 85, 99, 0.5);
  }
  .auth-box h1 {
    color: #9ca3af;
  }
  .app-brand {
    color: #ffffff;
  }
  .app-brand span {
    color: #818cf8;
  }
  .login-desc {
    color: #d1d5db;
  }
  .btn-google {
    background: #374151;
    color: #ffffff;
    border-color: #4b5563;
  }
  .btn-google:hover {
    background: #4b5563;
  }
  .google-icon-wrapper {
    background: #374151;
    border-color: #4b5563;
  }
  .login-footer {
    color: #6b7280;
  }
}

.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e5e7eb;
  flex-shrink: 0;
}
.logo {
  padding: 25px;
  font-size: 1.6rem;
  font-weight: 800;
  /* color: var(--primary); */
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- COLORFUL SIDEBAR --- */
.nav-links {
  list-style: none;
  padding: 10px 15px;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

/* Sidebar List Items Styling */
.nav-links li {
  font-family: "Poppins", sans-serif; /* Sidebar အတွက် သီးသန့် */
  font-weight: 500; /* ပုံမှန်ထက် နည်းနည်းပိုထူမယ် */
  letter-spacing: 0.3px; /* စာလုံးတွေကြား နည်းနည်းခွာမယ် */
  font-size: 0.95rem; /* ဆိုဒ်အမှန် */

  display: flex; /* ဒါထည့်လိုက်ရင် အကုန်ညီသွားပါမယ် */
  align-items: center; /* Icon နဲ့ စာသား အလယ်တည့်တည့်ဖြစ်မယ် */

  position: relative;
  padding: 12px 15px;
  margin-bottom: 8px;
  border-radius: 12px;
  font-weight: 600;
  color: #4b5563;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  cursor: pointer !important;
}

/* Icon Alignment Fix */
.nav-links li i {
  font-size: 1.1rem;
  width: 35px; /* Icon နေရာကို အတိအကျ သတ်မှတ်မယ် */
  text-align: center; /* Icon ကို အလယ်ပို့မယ် */
  margin-right: 0; /* Margin မလိုတော့ဘူး (Width နဲ့ ထိန်းထားလို့) */
  flex-shrink: 0; /* Icon ကို မပိန်စေဘူး */
  transition: transform 0.2s;
}

/* Backup & Restore Colors */
#nav-backup i {
  color: #059669;
}
#nav-restore i {
  color: #ea580c;
}

/* Hover Effects */
#nav-backup:hover {
  background: #ecfdf5;
  color: #047857;
}
#nav-restore:hover {
  background: #fff7ed;
  color: #c2410c;
}

/* Hover Effect: Icon moves slightly */
.nav-links li:hover i {
  transform: scale(1.1) rotate(5deg);
}

/* --- INDIVIDUAL CATEGORY COLORS --- */

/* 1. All Documents (Primary Blue) */
#nav-all i {
  color: #4f46e5;
}
#nav-all:hover,
#nav-all.active {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}

/* 2. Housing (Blue) */
#nav-housing i {
  color: #2563eb;
}
#nav-housing:hover,
#nav-housing.active {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

/* 3. Business (Slate Gray) */
/* #nav-business i { color: #475569; } */
#nav-business:hover,
#nav-business.active {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

/* 4. Education (Purple) */
#nav-education i {
  color: #0d9488 !important;
}
#nav-education:hover,
#nav-education.active {
  background: #f0fdfa !important;
  color: #0f766e !important;
  border-color: #ccfbf1 !important;
}

/* 5. Travel (Cyan/Sky) */
#nav-travel i {
  color: #0891b2;
}
#nav-travel:hover,
#nav-travel.active {
  background: #ecfeff;
  color: #0e7490;
  border-color: #a5f3fc;
}

/* 6. ID & Legal (Indigo) */
#nav-id i {
  color: #6366f1;
}
#nav-id:hover,
#nav-id.active {
  background: #e0e7ff;
  color: #4338ca;
  border-color: #c7d2fe;
}

/* 7. Tax (Emerald Green) */
#nav-tax i {
  color: #059669;
}
#nav-tax:hover,
#nav-tax.active {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

/* 8. Medical (Red) */
#nav-medical i {
  color: #dc2626;
}
#nav-medical:hover,
#nav-medical.active {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

/* 9. Auto (Orange/Amber) */
#nav-auto i {
  color: #d97706;
}
#nav-auto:hover,
#nav-auto.active {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

/* 10. Photo/Media (Pink) */
#nav-media i {
  color: #db2777;
}
#nav-media:hover,
#nav-media.active {
  background: #fce7f3;
  color: #be185d;
  border-color: #fbcfe8;
}

/* 11. Others (Gray) */
#nav-other i {
  color: #6b7280;
}
#nav-other:hover,
#nav-other.active {
  background: #f3f4f6;
  color: #374151;
  border-color: #e5e7eb;
}

/* --- DARK MODE ADJUSTMENTS --- */
/* Dark mode မှာ အရောင်တွေ အရမ်းမမှောင်သွားအောင် Icon တွေကို ပြန်လင်းပေးမယ် */

body.dark-mode .nav-links li:hover,
body.dark-mode .nav-links li.active {
  background: #374151 !important; /* Unified dark background for active */
  border-color: #4b5563 !important;
}

/* Icon Brightness in Dark Mode */
body.dark-mode #nav-housing i {
  color: #60a5fa;
}
body.dark-mode #nav-medical i {
  color: #f87171;
}
body.dark-mode #nav-tax i {
  color: #34d399;
}
body.dark-mode #nav-education i {
  color: #2dd4bf !important; /* Lighter Teal for Dark Mode */
}
body.dark-mode .header-icon-education {
  color: #2dd4bf !important;
}
body.dark-mode .folder-card.education .folder-icon {
  color: #2dd4bf !important;
}
body.dark-mode #nav-media i {
  color: #f472b6;
}
body.dark-mode #nav-auto i {
  color: #fbbf24;
}
/* Text Color in Dark Mode */
body.dark-mode .nav-links li {
  color: #9ca3af;
}
body.dark-mode .nav-links li:hover,
body.dark-mode .nav-links li.active {
  color: #ffffff !important;
}

/* Active & Color States */
/* All Files */
#nav-all.active {
  background: #eef2ff;
  color: var(--primary);
}
/* Categories */
#nav-housing.active,
#nav-housing:hover {
  background: var(--bg-housing);
  color: var(--c-housing);
}
#nav-travel.active,
#nav-travel:hover {
  background: var(--bg-travel);
  color: var(--c-travel);
}
#nav-id.active,
#nav-id:hover {
  background: var(--bg-id);
  color: var(--c-id);
}
#nav-tax.active,
#nav-tax:hover {
  background: var(--bg-tax);
  color: var(--c-tax);
}
#nav-medical.active,
#nav-medical:hover {
  background: var(--bg-medical);
  color: var(--c-medical);
}
#nav-auto.active,
#nav-auto:hover {
  background: var(--bg-auto);
  color: var(--c-auto);
}
#nav-media.active,
#nav-media:hover {
  background: var(--bg-media);
  color: var(--c-media);
}
#nav-business.active,
#nav-business:hover {
  background: var(--bg-business);
  color: var(--c-business);
}
#nav-education.active,
#nav-education:hover {
  background: var(--bg-education);
  color: var(--c-education);
}

/* User Profile */
.user-profile {
  padding: 20px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 12px;
  /* background: #f9fafb; */
}
/* --- USER PHOTO LOGOUT ACTION --- */
#userPhoto {
  width: 45px; /* အကျယ် */
  height: 45px; /* အမြင့် */
  border-radius: 50% !important; /* *** ဒါက အဝိုင်းဖြစ်စေတဲ့ ကုဒ်ပါ *** */
  object-fit: cover; /* ပုံ မပိန်မပု ဖြစ်အောင် */

  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Mouse တင်ရင် (Hover) */
#userPhoto:hover {
  transform: scale(1.1);
  border-color: #ef4444; /* Logout အရောင် (အနီ) */
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}
.user-info {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Content */
.main-content {
  width: 100% !important;
  max-width: 100vw !important; /* Viewport ထက် မကျော်စေရ */
  overflow-x: hidden !important;
  flex: 1;
  padding: 30px;
  /* overflow-y: auto; */
  background: #f8fafc;
  transition: background-color 0.3s ease;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  margin-bottom: 30px;
}
.header-left {
  border-radius: 15px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  gap: 15px;
}
#pageTitle {
  font-size: 2.5rem; /* Icon ကို ကြီးကြီးပြမယ် */
  margin: 0;
  line-height: 1;
  display: inline-block;
  padding: 10px;
  background: transparent !important; /* နောက်ခံအဖြူ မလိုတော့ဘူး */
}

/* 2. Specific Category Colors (Sidebar အရောင်တွေနဲ့ တူအောင်) */

.header-icon-all {
  color: #4f46e5;
} /* Primary Blue */

.header-icon-housing {
  color: #2563eb;
} /* Blue */

.header-icon-business {
  color: #475569;
} /* Slate */

.header-icon-education {
  color: #0d9488 !important;
} /* Purple */

.header-icon-travel {
  color: #0891b2;
} /* Cyan */

.header-icon-id {
  color: #6366f1;
} /* Indigo */

.header-icon-tax {
  color: #059669;
} /* Emerald */

.header-icon-medical {
  color: #dc2626;
} /* Red */

.header-icon-auto {
  color: #d97706;
} /* Amber */

.header-icon-media {
  color: #db2777;
} /* Pink */

.header-icon-other {
  color: #6b7280;
} /* Gray */

.header-icon-favorites {
  color: #f59e0b; /* Gold */
  filter: drop-shadow(0 2px 4px rgba(245, 158, 11, 0.3)); /* Glow Effect */
}

/* --- DARK MODE ADJUSTMENT --- */
/* Dark mode မှာ အရောင်တွေကို နည်းနည်း ပိုလင်းစေမယ် */
body.dark-mode .header-icon-business {
  color: #94a3b8;
}
body.dark-mode .header-icon-other {
  color: #9ca3af;
}

/* Search */
.search-container {
  flex: 1;
  margin: 0 30px;
  position: relative;
  max-width: 500px;
}
.search-container input {
  width: 100%;
  padding: 12px 20px 12px 45px;
  border: 2px solid transparent;
  border-radius: 15px;
  background: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  font-size: 0.95rem;
  transition: all 0.2s;
}
.search-container input:focus {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.15);
  outline: none;
}
.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
}

.btn-add {
  margin-left: 20px;
  background: var(--primary);
  color: white;
  border: none;
  padding: 13px 25px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-add:hover {
  transform: translateY(-2px);
}
/* =========================================
   BEAUTIFUL MAIN CONTENT DESIGN (RE-VAMP)
   ========================================= */

/* Grid */
.grid-container {
  width: 100% !important;
  margin: 0 !important; /* Margin ကြောင့် တွန်းမထွက်အောင် */
  padding-right: 0 !important; /* လိုအပ်ရင် ညှိနိုင်သည် */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 25px;
  padding-bottom: 50px;
}

/* --- COLORFUL FOLDER CARD --- */
.folder-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
  transition: all 0.2s;
  border: 1px solid #e5e7eb !important; /* ဘောင်ကို 1px ပါးပါးလေးပဲထားမယ် */
  height: 160px;
  position: relative;
  overflow: hidden;
}

.folder-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.folder-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px !important; /* အပေါ်ဘားကို 4px ထိ လျှော့မယ် (မူရင်း 6px) */
  background: #ddd; /* Default */
}

/* Category Specific Folder Styles */
.folder-card.housing::before {
  background: var(--c-housing);
}
.folder-card.housing .folder-icon {
  color: var(--c-housing);
}
.folder-card.housing {
  background: linear-gradient(180deg, #fff 0%, var(--bg-housing) 100%);
}

.folder-card.travel::before {
  background: var(--c-travel);
}
.folder-card.travel .folder-icon {
  color: var(--c-travel);
}
.folder-card.travel {
  background: linear-gradient(180deg, #fff 0%, var(--bg-travel) 100%);
}

.folder-card.id::before {
  background: var(--c-id);
}
.folder-card.id .folder-icon {
  color: var(--c-id);
}
.folder-card.id {
  background: linear-gradient(180deg, #fff 0%, var(--bg-id) 100%);
}

.folder-card.tax::before {
  background: var(--c-tax);
}
.folder-card.tax .folder-icon {
  color: var(--c-tax);
}
.folder-card.tax {
  background: linear-gradient(180deg, #fff 0%, var(--bg-tax) 100%);
}

.folder-card.medical::before {
  background: var(--c-medical);
}
.folder-card.medical .folder-icon {
  color: var(--c-medical);
}
.folder-card.medical {
  background: linear-gradient(180deg, #fff 0%, var(--bg-medical) 100%);
}

.folder-card.auto::before {
  background: var(--c-auto);
}
.folder-card.auto .folder-icon {
  color: var(--c-auto);
}
.folder-card.auto {
  background: linear-gradient(180deg, #fff 0%, var(--bg-auto) 100%);
}

.folder-card.media::before {
  background: var(--c-media);
}
.folder-card.media .folder-icon {
  color: var(--c-media);
}
.folder-card.media {
  background: linear-gradient(180deg, #fff 0%, var(--bg-media) 100%);
}

.folder-card.education::before {
  background: #0d9488 !important;
}
.folder-card.education .folder-icon {
  color: #0d9488 !important;
}
.folder-card.education {
  background: linear-gradient(180deg, #fff 0%, #f0fdfa 100%) !important;
}

.folder-card.business::before {
  background: var(--c-business);
}
.folder-card.business .folder-icon {
  color: var(--c-business);
}
.folder-card.business {
  background: linear-gradient(180deg, #fff 0%, var(--bg-business) 100%);
}

.folder-icon {
  font-size: 3.5rem;
  margin-bottom: 15px;
  transition: transform 0.2s;
}
.folder-card:hover .folder-icon {
  transform: scale(1.1);
}
.folder-name {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  letter-spacing: 0.5px;

  font-size: 1rem;
  text-align: center;
  color: #374151;

  white-space: nowrap !important; /* စာကြောင်းမကျိုးစေရ */
  overflow: hidden !important; /* ကျော်သွားရင် ဖျောက်မယ် */
  text-overflow: ellipsis !important; /* ... ပြမယ် */
  max-width: 100% !important; /* မိခင်ကတ်ထက် မကျယ်စေရ */
  display: block !important; /* Block မှ width အလုပ်လုပ်မယ် */
  padding: 0 5px !important; /* ဘေးမကပ်အောင် */
}

/* Login Page က ခေါင်းစဉ်တွေ */
.app-brand,
h1 {
  font-family: "Poppins", sans-serif;
  letter-spacing: -0.5px; /* ခေါင်းစဉ်မို့ နည်းနည်းကပ်မယ် */
}
.folder-count {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 5px;
  background: rgba(255, 255, 255, 0.6);
  padding: 2px 8px;
  border-radius: 10px;
}

/* --- FILE CARD --- */
.file-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  position: relative;
  
  /* IMPORTANT: 'all' မသုံးရ။ လိုအပ်တာပဲ transition လုပ်မယ် */
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  
  /* GPU Acceleration to stop shaking */
  transform: translateZ(0); 
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.action-btn i {
    transition: color 0.2s ease, transform 0.1s ease;
}

.file-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.preview-box {
  height: 150px;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #cbd5e1;
  position: relative;
}
.preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.file-card:hover .preview-box img {
  transform: scale(1.05);
}

.card-info {
  padding: 15px;
}
.card-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1f2937;
}
.card-meta {
  font-size: 0.75rem;
  color: #9ca3af;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cat-badge {
  text-transform: uppercase;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

/* Badge Colors */
.badge-housing {
  background: var(--bg-housing);
  color: var(--c-housing);
}
.badge-medical {
  background: var(--bg-medical);
  color: var(--c-medical);
}
.badge-tax {
  background: var(--bg-tax);
  color: var(--c-tax);
}
/* Add others as needed, default fallback */
.badge-other {
  background: #f3f4f6;
  color: #6b7280;
}

.card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.2s;
}
.file-card:hover .card-actions {
  opacity: 1;
} /* Show on hover */
.action-btn {
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: 0.2s;
  color: #555;
  transform: translateZ(0); /* Button ကို သီးသန့် Layer ခွဲမယ် */
    will-change: transform;
}

/* Star Icon Specific */
.action-btn .fa-star {
    transition: color 0.2s ease; /* အရောင်ပြောင်းတာပဲ animate လုပ်မယ် */
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4); /* အနောက်ဘက်ကို မှန်ကြည်ရောင် */
  backdrop-filter: blur(5px); /* နောက်ခံကို ဝါးသွားစေမည် */
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

/* Modal Box Content */
.modal-box {
  background: #ffffff;
  padding: 0; /* Header/Footer ခွဲမည့်အတွက် padding 0 ထားသည် */
  border-radius: 24px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  transform: scale(0.9);
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Header (Title & Close Button) */
.modal-header {
  padding: 20px 25px;
  background: white;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #1f2937;
  font-weight: 800;
}
.btn-close-icon {
  background: #f3f4f6;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-close-icon:hover {
  background: #ffdede;
  color: #ef4444;
  transform: rotate(90deg);
}

/* Body (Inputs) */
.modal-body {
  padding: 25px;
  background: #fff;
}

/* Footer (Action Buttons) */
.modal-footer {
  padding: 20px 25px;
  background: #f9fafb;
  border-top: 1px solid #f3f4f6;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #4b5563;
}
.form-group input[type="text"],
.form-group select {
  width: 100%;
  padding: 14px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  font-size: 0.95rem;
  color: #1f2937;
  transition: all 0.2s;
  box-sizing: border-box; /* Important fix */
}
.form-group input[type="text"]:focus,
.form-group select:focus {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
  outline: none;
}

/* File Input Styling (New) */
.file-upload-wrapper {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  background: #f8fafc;
  transition: border-color 0.2s;
  cursor: pointer;
}
.file-upload-wrapper:hover {
  border-color: var(--primary);
  background: #eff6ff;
}
.file-upload-wrapper input[type="file"] {
  width: 100%;
  cursor: pointer;
}

/* Buttons */
.btn-modal-save {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  transition: transform 0.2s;
}
.btn-modal-save:hover {
  transform: translateY(-2px);
  background: #4338ca;
}
.btn-modal-cancel {
  background: white;
  color: #6b7280;
  border: 1px solid #e5e7eb;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-modal-cancel:hover {
  background: #f3f4f6;
  color: #374151;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes modalPop {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* 1. Footer Logout Button (Desktop) */
.logout-text-btn {
  color: #ff6b6b;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px; /* Icon နဲ့ စာသားကြား အကွာအဝေး */
  margin-top: 2px;
  transition: color 0.2s;
  font-weight: 600;
}
.logout-text-btn:hover {
  color: #d32f2f;
  text-decoration: underline;
}

/* 2. Mobile Logout Item (Default Hidden on Desktop) */
.mobile-logout-item {
  /* 1. Spacing & Positioning */
  margin-top: 30px !important; /* အပေါ်က List တွေနဲ့ ခွာမယ် */
  margin-bottom: 20px !important; /* အောက်ဆုံးအနားသတ် */

  /* 2. Colors (Soft Red Theme) */
  background: linear-gradient(135deg, #fff5f5 0%, #fee2e2 100%) !important;
  color: #ef4444 !important; /* Bright Red Text */
  border: 1px solid #fecaca !important; /* Soft Red Border */

  /* 3. Shape & Text */
  border-radius: 15px !important;
  font-weight: 700 !important;
  text-align: center; /* စာကို အလယ်ပို့မယ် */
  justify-content: center; /* Flexbox center */
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.15); /* အနီရောင်အရိပ် */

  /* 4. Animation */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  cursor: pointer !important;
}

/* Icon Styling */
.mobile-logout-item i {
  color: #dc2626 !important; /* Darker Red Icon */
  margin-right: 10px;
  font-size: 1.2rem;
}

/* --- HOVER EFFECT (Mouse တင်လိုက်ရင်) --- */
.mobile-logout-item:hover,
.mobile-logout-item:active {
  background: linear-gradient(
    135deg,
    #ef4444 0%,
    #dc2626 100%
  ) !important; /* Solid Red Gradient */
  color: #ffffff !important; /* စာလုံး အဖြူပြောင်းမယ် */
  border-color: #b91c1c !important;
  transform: translateY(-3px); /* နည်းနည်းကြွတက်မယ် */
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.4); /* အရိပ်ပိုထူမယ် */
}

/* Hover လုပ်ရင် Icon အရောင်ပါ အဖြူပြောင်းမယ် */
.mobile-logout-item:hover i,
.mobile-logout-item:active i {
  color: #ffffff !important;
}

/* --- DARK MODE ADJUSTMENT --- */
body.dark-mode .mobile-logout-item {
  background: linear-gradient(
    135deg,
    #2c1010 0%,
    #450a0a 100%
  ) !important; /* Dark Red Bg */
  border-color: #7f1d1d !important;
  color: #fca5a5 !important; /* Light Red Text */
}

body.dark-mode .mobile-logout-item i {
  color: #f87171 !important;
}

/* Dark Mode Hover */
body.dark-mode .mobile-logout-item:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%) !important;
  color: white !important;
}

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #ddd;
    overflow-x: auto;
    padding-bottom: 0;
  }
  .nav-links {
    display: flex;
    padding: 10px;
    gap: 10px;
  }
  .nav-links li {
    white-space: nowrap;
    margin: 0;
    padding: 8px 12px;
    background: white;
    border: 1px solid #eee;
  }
  .user-profile {
    display: none;
  }
  .main-content {
    padding: 15px;
  }
  .file-card .card-actions {
    opacity: 1;
  } /* Always show actions on mobile */
  .hide-on-mobile {
    display: none;
  }
  /* ဖုန်းမှာ Menu ထဲက Logout ကို ပြန်ဖော်မယ် */
  .mobile-logout-item {
    display: flex !important;
    color: #ff6b6b !important;
    background: #fff5f5;
    border: 1px solid #ffcdd2;
  }

  /* Logo အောက်က വര ပြန်ထည့်မယ် */
  .logo {
    border-bottom: 1px solid #eee;
  }
  .grid-container.list-view .card-meta {
    display: none; /* ဖုန်းနဲ့ကြည့်ရင် Date နဲ့ Category ဖျောက်မယ် (နေရာမဆံ့လို့) */
  }
  .grid-container.list-view .folder-count {
    display: none;
  }
  .grid-container.list-view .card-title {
    font-size: 0.9rem;
  }
  .grid-container.list-view .card-actions {
    padding-left: 10px;
    gap: 5px;
  }
}

/* --- MOBILE VIEW FIXES (UNIFORM BUTTONS) --- */

@media (max-width: 768px) {
  /* 1. Reset Margins & Borders for Special Items */
  /* အထူးခလုတ်တွေရဲ့ အပေါ်ကွာဟချက်တွေကို ဖျက်မယ် */
  #nav-help,
  #nav-backup,
  #nav-restore,
  #nav-pin,
  #nav-other,
  .sidebar-logout-btn {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-top: none !important;
    padding-top: 10px !important; /* ပုံမှန် Padding အတိုင်း ပြန်ထားမယ် */
    padding-bottom: 10px !important;

    /* အခြားခလုတ်တွေနဲ့ တူအောင် Border ပြန်ထည့်မယ် */
    border: 1px solid #e5e7eb !important;
    background: white;
  }

  /* 2. Logout Button Specific Fix */
  /* Logout ခလုတ်ကို အရမ်းကြီးမနေအောင် ကျန်တာတွေနဲ့ ညှိမယ် */
  .sidebar-logout-btn {
    background: #fff5f5 !important; /* အနီနုရောင် ပြန်ထားမယ် */
    color: #ef4444 !important;
    border-color: #fecaca !important;
    width: auto !important; /* အကျယ်ကို Auto ပြန်ထားမယ် */
    display: flex !important;
    align-items: center;
    white-space: nowrap; /* စာကြောင်းမကျိုးအောင် */
  }

  /* 3. Ensure all items are aligned properly in the scrollable list */
  .nav-links {
    display: flex;
    flex-direction: row; /* ဘေးတိုက်စီမယ် */
    align-items: center; /* အလယ်တည့်တည့် */
    gap: 10px;
    overflow-x: auto; /* ဘေးကို Scroll ဆွဲလို့ရမယ် */
    padding: 15px;
    scroll-behavior: smooth;
    /* Scrollbar ပျောက်အောင် (Optional) */
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  /* 4. Individual List Item Sizing */
  .nav-links li {
    flex: 0 0 auto; /* မကျုံ့သွားအောင် */
    min-width: max-content; /* စာသားဆံ့အောင် */
    height: 45px; /* အမြင့် ညှိမယ် */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
  }
}

/* --- BEAUTIFUL BACK BUTTON --- */
.btn-back {
  display: inline-flex; /* Icon နဲ့ စာသား တစ်တန်းတည်းနေအောင် */
  align-items: center;
  gap: 8px; /* Icon နဲ့ စာသားကြား အကွာအဝေး */

  background-color: white;
  color: #4b5563; /* စာလုံးအရောင် (မီးခိုးရင့်) */
  border: 1px solid #e5e7eb; /* ဘောင်ပါးပါးလေး */

  padding: 10px 20px; /* အတွင်းဘက် အကွာအဝေး */
  border-radius: 30px; /* လုံးဝန်းသော ပုံစံ (Pill Shape) */

  font-size: 0.95rem;
  font-weight: 700; /* စာလုံးအထူ */
  cursor: pointer;

  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); /* အရိပ်ပါးပါးလေး */
  transition: all 0.2s ease; /* ချောမွေ့သော အပြောင်းအလဲ */
}

/* Mouse တင်လိုက်ရင် ဖြစ်မည့်ပုံစံ */
.btn-back:hover {
  background-color: #eef2ff; /* နောက်ခံ အပြာနုရောင် */
  color: var(--primary); /* စာလုံး အပြာရောင် */
  border-color: var(--primary); /* ဘောင် အပြာရောင် */
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.15); /* အရိပ်ပိုထင်ရှားမယ် */
  transform: translateX(
    -4px
  ); /* ဘယ်ဘက်ကို နည်းနည်းရွေ့သွားမယ် (Back သွားမယ့်သဘော) */
}

/* နှိပ်လိုက်ရင် ဖြစ်မည့်ပုံစံ */
.btn-back:active {
  transform: translateX(-2px) scale(0.98); /* နည်းနည်းကျုံ့သွားမယ် */
}

/* Icon လေးကို နည်းနည်းကြီးမယ် */
.btn-back i {
  font-size: 1.1rem;
}

/* --- APP FOOTER --- */
.app-footer {
  text-align: center;
  padding: 20px;
  color: #9ca3af; /* မီးခိုးရောင်ဖျော့ဖျော့ */
  font-size: 0.85rem;
  margin-top: 30px;
  border-top: 1px solid #e5e7eb; /* အပေါ်မှာ မျဉ်းပါးပါးလေး */
  width: 100%;
  font-weight: 500;
}

/* --- VIEW TOGGLES --- */
.view-btn {
  background: white;
  border: 1px solid #e5e7eb;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s;
}
.view-btn.active {
  background: #e0e7ff;
  color: var(--primary);
  border-color: var(--primary);
}

/* --- LIST VIEW STYLES --- */
/* Grid Container ကို List ပုံစံပြောင်းမည့် Class */
.grid-container.list-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.grid-container.list-view .folder-card {
  display: flex;
  flex-direction: row; /* ဘေးတိုက်စီမယ် */
  align-items: center;
  justify-content: flex-start; /* ဘယ်ဘက်ကပ်မယ် */

  height: 70px; /* အမြင့်လျှော့မယ် */
  width: 100%;
  padding: 0 20px;
  margin-bottom: 5px;
  box-sizing: border-box;
}

/* Folder အရောင်လိုင်း (အပေါ်ကနေ ဘယ်ဘက်ပြောင်းမယ်) */
.grid-container.list-view .folder-card::before {
  width: 4px !important; /* ဘေးဘားကို 4px ထိ လျှော့မယ် */
  height: 100% !important;
  top: 0 !important;
  left: 0;
}

/* Folder Icon (သေးလိုက်မယ်) */
.grid-container.list-view .folder-icon {
  font-size: 1.8rem;
  margin-bottom: 0; /* အောက် margin ဖြုတ် */
  margin-right: 20px; /* ညာဘက် margin ထည့် */
  transform: none !important; /* Scale effect ဖြုတ် */
}

/* Folder Name */
.grid-container.list-view .folder-name {
  font-size: 1rem;
  flex: 1; /* ကျန်တဲ့နေရာယူမယ် */
  text-align: left;
}

/* Folder Count */
.grid-container.list-view .folder-count {
  margin-top: 0;
  margin-left: auto; /* ညာဘက်အစွန်ဆုံးပို့မယ် */
}

/* List View ထဲက Card ဒီဇိုင်း */
.grid-container.list-view .file-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  min-height: 70px;
  height: auto;
  width: 100%;
  position: relative; /* Checkbox & Buttons နေရာချဖို့ */

  /* Spacing */
  box-sizing: border-box;
  padding-left: 40px !important; /* ဘယ်ဘက်: Checkbox အတွက် နေရာချန် */
  padding-right: 210px !important; /* ညာဘက်: ခလုတ် ၆ လုံးအတွက် နေရာချန် */
  padding-top: 10px;
  padding-bottom: 10px;
}

.grid-container.list-view .card-checkbox {
  position: absolute !important; /* နေရာအသေ */
  top: 8px !important; /* အပေါ်ကပ် */
  left: 8px !important; /* ဘယ်ကပ် */

  width: 20px !important; /* ဆိုဒ်အသေး */
  height: 20px !important;
  min-width: 20px !important;

  margin: 0 !important;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #94a3b8;
  z-index: 20;
}

/* Select လုပ်ထားရင် */
.grid-container.list-view .file-card.selected .card-checkbox {
  background: #4f46e5;
  border-color: #4f46e5;
}

/* 3. Clickable Content Wrapper (Preview + Info) */
/* Action Button မပါတဲ့ အပိုင်းကို နေရာအပြည့်ယူခိုင်းမယ် */
.grid-container.list-view .file-card > div[onclick] {
  display: flex;
  align-items: center;
  flex: 1; /* ကျန်တဲ့နေရာအကုန်ယူ */
  min-width: 0; /* Text Overflow ပြဿနာဖြေရှင်းရန် */
  margin-right: 20px;
  order: 1; /* ဘယ်ဘက်မှာနေမယ် */
}

/* 4. Preview Image (Icon) - Small & Left */
.grid-container.list-view .preview-box {
  position: static !important; /* ခလုတ်တွေ အပြင်ထွက်ဖို့ */
  margin-right: 15px;
  width: 45px;
  height: 45px;
  flex-shrink: 0;
}

.grid-container.list-view .actions-top-right,
.grid-container.list-view .actions-bottom-right {
  position: absolute !important; /* နေရာအသေယူမယ် */
  top: 50% !important; /* အပေါ်အောက် အလယ်တည့်တည့် */
  transform: translateY(-50%) !important;
  display: flex !important;
  gap: 5px !important; /* ခလုတ်ကြား အကွာအဝေး */
  z-index: 10;

  /* Grid View က Position တွေကို Reset လုပ်မယ် */
  bottom: auto !important;
  left: auto !important;
}
.grid-container.list-view .actions-bottom-right {
  top: 50% !important;
  transform: translateY(-50%) !important;
  right: 110px !important; /* Group 1 ဘေးမှာ */
}

.grid-container.list-view .actions-top-right {
  top: 50% !important;
  transform: translateY(-50%) !important;
  right: 10px !important; /* ညာဘက်အစွန်ဆုံး */
}

/* 5. Info Area (Title | Date | Category) */
.grid-container.list-view .card-info {
  display: flex;
  flex-direction: row; /* စာတွေကို ဘေးတိုက်စီမယ် */
  align-items: center;
  width: 100%;
  padding: 0;
}

/* 5a. Title Column (အကျယ်ဆုံးနေရာယူမယ်) */
.grid-container.list-view .card-title {
  flex: 2; /* နေရာ ၂ ဆယူမယ် */
  font-size: 0.95rem;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  text-align: left;
}

/* 5b. Meta Wrapper (Category + Date) */
.grid-container.list-view .card-meta {
  flex: 1.5; /* နေရာ ၁.၅ ဆယူမယ် */
  display: flex;
  justify-content: flex-end; /* ညာဘက်ကပ် */
  align-items: center;
  gap: 20px; /* Category နဲ့ Date ကြားအကွာအဝေး */
}

/* 5c. Date Styling */
.grid-container.list-view .card-meta span:first-child {
  font-size: 0.85rem;
  color: #6b7280;
  min-width: 80px; /* နေ့စွဲအတွက် နေရာသေချာပေးမယ် */
}

/* 5d. Category Badge Styling */
.grid-container.list-view .cat-badge {
  min-width: 80px;
  text-align: center;
}

/* 6. Action Buttons (Far Right) */
.grid-container.list-view .card-actions {
  position: static; /* မူလ Absolute ကိုဖျက် */
  opacity: 1; /* အမြဲပေါ်နေမယ် */
  display: flex;
  gap: 8px;
  background: none;
  order: 2; /* ညာဘက်အစွန်ဆုံးမှာနေမယ် */
  flex-shrink: 0; /* Button တွေ မပိန်သွားအောင် */
  padding-left: 15px;
  border-left: 1px solid #eee; /* ခလုတ်တွေမတိုင်ခင် မျဉ်းလေးတားမယ် */
}

/* Dark Mode border fix */
body.dark-mode .grid-container.list-view .card-actions {
  border-left-color: #374151;
}

/* List View တွင် ခလုတ်များ နောက်ခံအရောင် ဖျော့ဖျော့ထည့်မယ် */
.grid-container.list-view .action-btn {
  width: 26px !important;
  height: 26px !important;
  font-size: 11px !important;
  border-radius: 4px;
  background: #f1f5f9; /* မီးခိုးနုရောင် */
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* .grid-container.list-view .action-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
} */
.grid-container.list-view .action-btn:hover {
  background: #4f46e5;
  color: white;
  border-color: #4f46e5;
}

/* --- PIN PAD STYLES --- */
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  max-width: 250px;
  margin: 0 auto;
}
.pin-pad button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  font-size: 1.2rem;
  font-weight: bold;
  color: #374151;
  cursor: pointer;
  transition: transform 0.1s;
}
.pin-pad button:active {
  transform: scale(0.9);
  background: #e5e7eb;
}

/* --- DARK MODE STYLES --- */
body.dark-mode {
  color: #e5e7eb; /* Main body text white */
  --bg: #111827; /* နောက်ခံ အမည်း */
  --sidebar-bg: #0f564d; /* Sidebar အမည်း */
  --text: #f3f4f6; /* စာလုံး အဖြူ */
}

body.dark-mode .card-title {
  color: #9ca3af !important; /* File Name */
}

body.dark-mode .folder-name {
  color: #e5e7eb !important; /* Folder Name */
}

body.dark-mode .price,
body.dark-mode label,
body.dark-mode h3 {
  color: #e5e7eb !important; /* Modal Headers & Labels */
}

/* Dark Mode တွင် Card များနှင့် Input များကို အရောင်ပြောင်းခြင်း */
body.dark-mode .file-card,
body.dark-mode .folder-card,
body.dark-mode .modal-box,
body.dark-mode .header-left, /* Header လိုရင် */
body.dark-mode input,
body.dark-mode select {
  /* background-color: #ebebeb !important;  */
  /* မီးခိုးရင့် */
  color: #fff !important;
  border-color: #4b5563 !important;
}

/* Dark Mode တွင် Folder Icon အရောင်များကို ချိန်ညှိခြင်း */
body.dark-mode .folder-count {
  background: rgba(0, 0, 0, 0.5);
  color: #ccc;
}

/* Sidebar စာလုံးအရောင်များ */
body.dark-mode .nav-links li {
  color: #9ca3af;
}
body.dark-mode .nav-links li:hover,
body.dark-mode .nav-links li.active {
  color: #ffffff;
  background: #374151;
}

/* PIN Setup Button Styling */
.pin-setup-item {
  color: #4f46e5; /* Default Light Mode Color */
  margin-top: 20px;
  border-top: 1px solid #eee;
  padding-top: 15px;
  position: relative; /* For Tooltip */
}

/* Dark Mode တွင် PIN ခလုတ်ကို အရောင်လင်းလင်း ပြောင်းမယ် */
body.dark-mode .pin-setup-item {
  color: #818cf8; /* Lighter Blue */
  border-top-color: #374151;
}
body.dark-mode .pin-setup-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* --- TOOLTIP DESIGN (Hover စာသား) --- */
.pin-setup-item::after {
  content: attr(data-tooltip); /* HTML data-tooltip ထဲကစာကို ယူပြမယ် */
  position: absolute;
  bottom: 100%; /* ခလုတ်ရဲ့ အပေါ်မှာ ပြမယ် */
  left: 50%;
  transform: translateX(-50%);

  background: #111827;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  z-index: 100;
}

/* Hover လုပ်ရင် Tooltip ပေါ်မယ် */
.pin-setup-item:hover::after {
  opacity: 1;
  visibility: visible;
  bottom: 120%; /* နည်းနည်း အပေါ်တက်သွားမယ် */
}

/* --- HELP MODAL DESIGN --- */

/* 1. Modal Size Adjustment */
.help-modal-box {
  max-width: 500px; /* အနည်းငယ် ပိုကျယ်မယ် */
  max-height: 85vh; /* မျက်နှာပြင်အမြင့် 85% ထက် မကျော်စေရ */
  display: flex;
  flex-direction: column;
}

/* 2. Scrollable Area */
.help-content {
  overflow-y: auto; /* အဆင့်တွေများရင် Scroll ဆွဲလို့ရမယ် */
  padding: 20px 25px;
  background: #f8fafc; /* အဖြူနုရောင် နောက်ခံ */
}

/* 3. Step Item Card */
.help-step {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  background: white;
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 15px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s;
}
.help-step:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* 4. Icons */
.step-icon {
  width: 40px;
  height: 40px;
  background: #eef2ff;
  color: #4f46e5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* 5. Text Styling */
.step-info h4 {
  margin: 0 0 5px 0;
  color: #1f2937;
  font-size: 1rem;
  font-weight: 700;
}
.step-info p {
  margin: 0;
  color: #4b5563;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* --- DARK MODE FIXES FOR HELP MODAL --- */
body.dark-mode .help-content {
  background: #111827; /* Dark Background */
}
body.dark-mode .help-step {
  background-color: #1f2937 !important; /* Dark Grey */
  border: 1px solid #374151 !important;
  box-shadow: none !important;
  border-color: #374151;
}
body.dark-mode .step-info h4 {
  color: #f3f4f6 !important; /* White Title */
}
body.dark-mode .step-info p,
body.dark-mode .step-info strong {
  color: #d1d5db !important; /* စာသား မီးခိုးဖျော့ */
}
/* Icons Background in Dark Mode */
body.dark-mode .step-icon {
  background-color: #374151 !important;
  color: #818cf8 !important; /* Icon Light Blue */
}

/* Install Guide က အစိမ်းရောင် Inline Style ပါနေလို့ Dark Mode မှာ သီးသန့်ပြင်ရပါမယ် */
body.dark-mode .help-step[style*="background: #f0fdf4"] {
  background-color: #064e3b !important; /* Dark Green Background */
  border-color: #059669 !important;
}

body.dark-mode .help-step[style*="background: #f0fdf4"] .step-icon {
  background-color: #065f46 !important;
  color: #34d399 !important;
}

body.dark-mode .help-step[style*="background: #f0fdf4"] h4,
body.dark-mode .help-step[style*="background: #f0fdf4"] p,
body.dark-mode .help-step[style*="background: #f0fdf4"] strong {
  color: #ecfdf5 !important; /* Light Green Text */
}

/* --- FIX USER GUIDE TITLE VISIBILITY --- */

/* 1. Light Mode (ပုံမှန်အချိန်) အတွက် */
#helpModal .modal-header h3 {
  color: #000000 !important; /* အမည်းရောင် အနက်ဆုံးထားမယ် */
  font-weight: 900 !important; /* စာလုံး အထူဆုံးထားမယ် */
  opacity: 1 !important; /* မှိန်နေတာတွေ ဖျောက်မယ် */
  letter-spacing: 0.5px;
}

/* 2. Dark Mode (အမှောင်စနစ်) အတွက် */
body.dark-mode #helpModal .modal-header h3 {
  color: var(--primary) !important; /* အဖြူရောင် အဖွေးဆုံးထားမယ် */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); /* စာလုံးနောက်မှာ အရိပ်မည်းမည်းထည့်မယ် */
}

/* 3. Icon အရောင်ပါ ထင်းအောင် ပြင်မယ် */
body.dark-mode #helpModal .modal-header i {
  color: #818cf8 !important; /* Icon ကို အပြာနုရောင် ပြောင်းမယ် */
}

/* --- LOGO ICON YELLOW --- */
.logo i {
  color: #f1b607 !important; /* တောက်ပသော အဝါရောင် */
  margin-right: 8px; /* စာနဲ့ Icon ကြား ခွာမယ် */
  font-size: 1.8rem; /* Icon ကို နည်းနည်းကြီးမယ် */

  /* လှအောင် အရိပ်လေးပါ ထည့်မယ် */
  filter: drop-shadow(0 2px 4px rgba(255, 193, 7, 0.3));
}

/* 3. Logo Text Styling */
.logo-text {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 1px;
  display: flex; /* စာလုံးတွေကပ်နေအောင် */
}

/* 4. အရောင်များကို တစ်လုံးစီ သတ်မှတ်ခြင်း (Cycle Colors) */

/* D - Blue (ယုံကြည်မှု) */
.logo-text span:nth-child(1) {
  color: #4285f4;
}

/* o - Red (ထင်ရှားမှု) */
.logo-text span:nth-child(2) {
  color: #ea4335;
}

/* c - Yellow/Orange (Folder နဲ့လိုက်ဖက်အောင်) */
.logo-text span:nth-child(3) {
  color: #fbbc05;
}

/* K - Green (လုံခြုံမှု) */
.logo-text span:nth-child(4) {
  color: #34a853;
}

/* e - Blue */
.logo-text span:nth-child(5) {
  color: #4285f4;
}

/* e - Red */
.logo-text span:nth-child(6) {
  color: #ea4335;
}

/* p - Purple (တီထွင်ဖန်တီးမှု) */
.logo-text span:nth-child(7) {
  color: #9333ea;
}

/* e - Orange */
.logo-text span:nth-child(8) {
  color: #f97316;
}

/* r - Green */
.logo-text span:nth-child(9) {
  color: #34a853;
}

/* --- DARK MODE ADJUSTMENT --- */
/* Dark Mode မှာ အရောင်တွေကို ပိုလင်းအောင် ပြင်မယ် */
body.dark-mode .logo-text span:nth-child(1) {
  color: #60a5fa;
} /* Lighter Blue */
body.dark-mode .logo-text span:nth-child(2) {
  color: #f87171;
} /* Lighter Red */
body.dark-mode .logo-text span:nth-child(4) {
  color: #4ade80;
} /* Lighter Green */
/* ကျန်တာတွေက Dark Mode မှာလည်း ထင်းပါတယ် */

/* --- CURSOR FIX (HAND POINTER) --- */
/* Sidebar ထဲက li အားလုံးကို Mouse တင်ရင် လက်ပုံစံပေါ်စေမည် */
.nav-links li,
.pin-setup-item,
#nav-help {
  cursor: pointer !important; /* Force Hand Pointer */
}

/* --- SPECIFIC ITEM COLORS --- */

/* 1. Other (Gray/Slate) */
#nav-other i {
  color: #64748b;
}
#nav-other:hover,
#nav-other.active {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

/* 2. How to Use (Amber/Orange - အကူအညီလိုသော အရောင်) */
#nav-help i {
  color: #f59e0b;
}
#nav-help:hover {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

/* 3. Set App PIN (Teal/Green - လုံခြုံရေးအရောင်) */
/* Class name .pin-setup-item ကို သုံးထားပါတယ် */
.pin-setup-item i {
  color: #0d9488;
}
.pin-setup-item:hover {
  background: #f0fdfa; /* Teal Light */
  color: #0f766e;
  border-color: #ccfbf1;
}

/* --- DARK MODE ADJUSTMENTS FOR NEW ITEMS --- */
body.dark-mode #nav-help i {
  color: #fbbf24;
}
body.dark-mode .pin-setup-item i {
  color: #2dd4bf;
}
body.dark-mode #nav-other i {
  color: #94a3b8;
}

body.dark-mode #nav-help:hover,
body.dark-mode .pin-setup-item:hover,
body.dark-mode #nav-other:hover {
  background: #374151;
  color: #fff;
  border-color: #4b5563;
}

#nav-backup i {
  color: #10b981;
}
#nav-backup:hover {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
body.dark-mode #nav-backup i {
  color: #34d399;
}

/* Restore Button Color (Orange) */
#nav-restore i {
  color: #f97316;
}

#nav-restore:hover {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

body.dark-mode #nav-restore i {
  color: #fb923c;
}
body.dark-mode #nav-restore:hover {
  background: #374151;
  color: #fff;
}

.sidebar-logout-btn {
  /* အရင်ဒီဇိုင်းအတိုင်း */
  margin-top: 30px !important;
  margin-bottom: 20px !important;
  background: linear-gradient(135deg, #fff5f5 0%, #fee2e2 100%) !important;
  color: #ef4444 !important;
  border: 1px solid #fecaca !important;
  border-radius: 15px !important;
  font-weight: 700 !important;
  text-align: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  cursor: pointer !important;

  /* Desktop မှာပါ ပေါ်အောင် display flex လုပ်မယ် */
  display: flex !important;
  padding: 12px !important;
}

.sidebar-logout-btn i {
  color: #dc2626 !important;
  margin-right: 10px;
  font-size: 1.2rem;
}

/* Hover Effect */
.sidebar-logout-btn:hover {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: #ffffff !important;
  border-color: #b91c1c !important;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.4);
}

.sidebar-logout-btn:hover i {
  color: #ffffff !important;
}

/* Dark Mode */
body.dark-mode .sidebar-logout-btn {
  background: linear-gradient(135deg, #2c1010 0%, #450a0a 100%) !important;
  border-color: #7f1d1d !important;
  color: #fca5a5 !important;
}
body.dark-mode .sidebar-logout-btn:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%) !important;
}

/* --- SIDEBAR YEAR TEXT DESIGN --- */
.sidebar-year-text {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem; /* စာလုံးဆိုဒ် နည်းနည်းကြီးမယ် */
  font-weight: 800; /* စာလုံးအထူကြီး လုပ်မယ် */

  /* Premium Gradient Color */
  background: linear-gradient(
    to right,
    #4f46e5,
    #9333ea
  ); /* အပြာရင့် မှ ခရမ်းရောင် */
  -webkit-background-clip: text; /* စာလုံးထဲမှာပဲ အရောင်ဝင်မယ် */
  -webkit-text-fill-color: transparent; /* စာလုံးအရောင်ဖျောက်ပြီး Gradient ပြမယ် */

  letter-spacing: 0.5px;
  cursor: default;
}

/* Dark Mode မှာ ပိုလင်းအောင် ပြင်မယ် */
body.dark-mode .sidebar-year-text {
  background: linear-gradient(
    to right,
    #818cf8,
    #c084fc
  ); /* အပြာနု မှ ခရမ်းနု */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* =========================================
   LIGHT MODE CARD DESIGN
   ========================================= */

/* Hover Effect (ကြွတက်လာမယ်) */
.file-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: #c7d2fe; /* Hover ရင် ဘောင်အပြာနုလေးဖြစ်မယ် */
}

/* Preview Image Area */
.preview-box {
  background: #f9fafb;
  border-bottom: 1px solid #f3f4f6;
  height: 140px; /* Grid အမြင့် */
}

/* Text Styling */
.card-title {
  color: #1f2937; /* Dark Grey Text */
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}
.card-meta span {
  color: #9ca3af; /* Light Grey Date */
  font-size: 0.75rem;
}

/* =========================================
   DARK MODE OVERHAUL (အမှောင်စနစ် ပြင်ဆင်ခြင်း)
   ========================================= */

/* 1. Main Background Dark */
body.dark-mode .main-content {
  background-color: #0f172a !important; /* Deep Navy Blue */
}

/* 2. File Card Dark */
body.dark-mode .file-card {
  background-color: #1e293b !important; /* Slate Dark */
  border-color: #334155 !important; /* Lighter Border */
  box-shadow: none !important; /* Dark mode မှာ Shadow မလို */
}

body.dark-mode .file-card:hover {
  background-color: #334155 !important; /* Hover ရင် နည်းနည်းလင်းမယ် */
  border-color: #64748b !important;
}

/* 3. Folder Card Dark */
body.dark-mode .folder-card {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}
body.dark-mode .folder-card:hover {
  background-color: #334155 !important;
}

/* 4. Text Visibility in Dark Mode */
body.dark-mode .card-title {
  color: #f1f5f9 !important; /* အဖြူရောင်နီးပါး */
}
body.dark-mode .card-meta span {
  color: #94a3b8 !important; /* Blue-ish Grey */
}
body.dark-mode .folder-name {
  color: #e2e8f0 !important;
}
body.dark-mode .folder-count {
  background: #0f172a !important;
  color: #cbd5e1 !important;
}

/* 5. Preview Box Dark */
body.dark-mode .preview-box {
  background-color: #0f172a !important; /* Card ထက် နည်းနည်းပိုမှောင်မယ် */
  border-bottom: 1px solid #334155 !important;
}

/* 6. List View Specific Dark Mode */
body.dark-mode .grid-container.list-view .file-card,
body.dark-mode .grid-container.list-view .folder-card {
  background-color: #1e293b !important;
  border-bottom: 1px solid #334155 !important;
}
body.dark-mode .grid-container.list-view .file-card:hover {
  background-color: #334155 !important;
}

/* 7. Action Buttons (Download/Edit) Dark Mode */
body.dark-mode .action-btn {
  background-color: #334155 !important;
  color: #e2e8f0 !important;
  border: 1px solid #475569 !important;
}
body.dark-mode .action-btn:hover {
  background-color: #4f46e5 !important; /* Primary Color on Hover */
  color: white !important;
  border-color: #4f46e5 !important;
}

/* --- PLANS & POLICY MODAL DESIGN --- */

/* Pricing Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 25px;
}

.pricing-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  position: relative;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Lifetime Plan Highlight */
.pricing-card.lifetime {
  border: 2px solid #d97706; /* Gold Border */
  background: #fffbeb;
}
.badge-best {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #d97706;
  color: white;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
}

.plan-name {
  font-size: 0.9rem;
  color: #6b7280;
  font-weight: 600;
}
.plan-price {
  font-size: 1.8rem;
  font-weight: 800;
  color: #1f2937;
  margin: 10px 0;
}
.plan-desc {
  font-size: 0.8rem;
  color: #4b5563;
}

/* Contact Button */
.contact-section {
  text-align: center;
  background: #f3f4f6;
  padding: 20px;
  border-radius: 12px;
}
.contact-section p {
  margin-top: 0;
  font-size: 0.9rem;
  color: #4b5563;
}
.btn-contact-admin {
  display: inline-block;
  background: #2563eb;
  color: white;
  text-decoration: none;
  padding: 12px 25px;
  border-radius: 30px;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
  transition: transform 0.2s;
}
.btn-contact-admin:hover {
  transform: translateY(-2px);
  background: #1d4ed8;
}

/* Policy Section */
.policy-section h4 {
  margin-top: 0;
  color: #374151;
  font-size: 1rem;
  margin-bottom: 10px;
}
.policy-text {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  padding: 15px;
  border-radius: 8px;
  max-height: 150px; /* Scrollable if too long */
  overflow-y: auto;
  font-size: 0.85rem;
  color: #4b5563;
  line-height: 1.6;
}
.policy-text p {
  margin-bottom: 10px;
}
.policy-text p:last-child {
  margin-bottom: 0;
}

/* --- DARK MODE FOR PLANS --- */
body.dark-mode .pricing-card {
  background: #1f2937;
  border-color: #374151;
}
body.dark-mode .pricing-card.lifetime {
  background: #312e81; /* Dark Indigo */
  border-color: #fbbf24;
}
body.dark-mode .plan-price {
  color: #f3f4f6;
}
body.dark-mode .plan-name,
body.dark-mode .plan-desc {
  color: #9ca3af;
}
body.dark-mode .contact-section {
  background: #1f2937;
}
body.dark-mode .contact-section p {
  color: #d1d5db;
}
body.dark-mode .policy-text {
  background: #1f2937;
  border-color: #374151;
  color: #d1d5db;
}
body.dark-mode .policy-section h4 {
  color: #f3f4f6;
}

/* --- ANNOUNCEMENT BANNER --- */
.announcement-box {
  background: linear-gradient(90deg, #ff7e5f, #feb47b); /* Sunset Orange */
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 15px rgba(255, 126, 95, 0.3);
  animation: slideDown 0.5s ease;
}

.announce-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.95rem;
}

.close-announce {
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.close-announce:hover {
  opacity: 1;
}

@keyframes slideDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* --- LOCKED SCREEN DESIGN --- */
.locked-box {
  text-align: center;
  border-top: 5px solid #ef4444; /* Red Top Border */
}

.lock-icon-wrapper {
  width: 80px;
  height: 80px;
  background: #fef2f2;
  color: #ef4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 2.5rem;
}

.lock-msg {
  color: #4b5563;
  margin-bottom: 30px;
  font-size: 1rem;
  line-height: 1.6;
}

.locked-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

/* Outline Buttons */
.btn-primary-outline {
  background: white;
  border: 2px solid #4f46e5;
  color: #4f46e5;
  padding: 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary-outline:hover {
  background: #eef2ff;
}

.btn-secondary-outline {
  background: white;
  border: 2px solid #f59e0b;
  color: #d97706;
  padding: 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary-outline:hover {
  background: #fffbeb;
}

.btn-danger-outline {
  background: white;
  border: 2px solid #ef4444;
  color: #ef4444;
  padding: 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-danger-outline:hover {
  background: #fef2f2;
}

/* Dark Mode Fixes */
body.dark-mode .locked-box {
  background: #1f2937;
  border-color: #ef4444;
}
body.dark-mode .lock-msg {
  color: #d1d5db;
}
body.dark-mode .lock-icon-wrapper {
  background: #450a0a;
}
body.dark-mode .btn-primary-outline {
  background: transparent;
  border-color: #818cf8;
  color: #818cf8;
}
body.dark-mode .btn-secondary-outline {
  background: transparent;
  border-color: #fbbf24;
  color: #fbbf24;
}
body.dark-mode .btn-danger-outline {
  background: transparent;
  border-color: #f87171;
  color: #f87171;
}

/* --- PREMIUM LOCK OVERLAY --- */
.premium-lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.4); /* အဖြူရောင်ဖျော့ဖျော့ */
  backdrop-filter: blur(8px); /* အနောက်ကို ဝါးသွားစေမည် */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  border-radius: 16px;
}

.lock-message-box {
  background: white;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 300px;
  border-top: 5px solid #d97706; /* Gold Color */
}

.lock-message-box h3 {
  color: #1f2937;
  margin: 10px 0;
}

.lock-message-box p {
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.btn-unlock {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.3);
  transition: transform 0.2s;
}
.btn-unlock:hover {
  transform: scale(1.05);
}

/* Dark Mode Support */
body.dark-mode .premium-lock-overlay {
  background: rgba(15, 23, 42, 0.6);
}
body.dark-mode .lock-message-box {
  background: #1f2937;
  border-color: #fbbf24;
}
body.dark-mode .lock-message-box h3 {
  color: white;
}
body.dark-mode .lock-message-box p {
  color: #d1d5db;
}

/* --- FIX: PREMIUM ACCESS HEADER IN DARK MODE --- */

/* 1. Header Text (Premium Access) */
body.dark-mode #planModal .modal-header h3 {
  color: #ffffff !important; /* အဖြူရောင် စစ်စစ် */
  opacity: 1 !important; /* လုံးဝ မမှိန်စေရ */
  font-weight: 900 !important; /* စာလုံးအထူကြီး */

  /* စာလုံးဘေးနားမှာ အမည်းရောင် အရိပ်ထည့်မယ် (ဒါမှ နောက်ခံနဲ့ မရောတော့မှာ) */
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9) !important;
}

/* 2. Crown Icon (သရဖူပုံ) */
body.dark-mode #planModal .modal-header i {
  color: #fbbf24 !important; /* တောက်ပသော ရွှေအဝါရောင် */
  filter: drop-shadow(
    0 2px 4px rgba(0, 0, 0, 0.8)
  ); /* Icon မှာလည်း အရိပ်ထည့်မယ် */
}

/* 3. Modal Background (Contrast ကောင်းအောင်) */
body.dark-mode #planModal .modal-box {
  background-color: #1f2937; /* Dark Slate Grey */
  border: 1px solid #374151; /* ဘောင်ပါးပါးလေး */
}

/* 4. Header Background */
body.dark-mode #planModal .modal-header {
  background-color: #111827; /* Body ထက် နည်းနည်းပိုမှောင်တဲ့ အရောင် */
  border-bottom: 1px solid #374151;
}

/* --- DARK MODE CLOSE BUTTON FIX --- */

/* 1. ခလုတ်၏ နောက်ခံနှင့် ဘောင် */
body.dark-mode .btn-close-icon {
  background-color: #374151 !important; /* နောက်ခံကို မီးခိုးရင့်ရောင် ပြောင်းမယ် */
  color: #ffffff !important; /* Icon ကို အဖြူရောင် ပြောင်းမယ် */
  border: 1px solid #4b5563 !important; /* ဘောင်ပါးပါးလေး ထည့်မယ် */
  opacity: 1 !important; /* လုံးဝ မမှိန်စေရ */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); /* အရိပ်လေး ထည့်မယ် */
}

/* 2. Icon (X) ကို အဖြူရောင် တောက်တောက် လုပ်မယ် */
body.dark-mode .btn-close-icon i {
  color: #ffffff !important;
  font-weight: bold;
}

/* 3. Mouse တင်လိုက်ရင် (Hover) အနီရောင် ဖြစ်မယ် */
body.dark-mode .btn-close-icon:hover {
  background-color: #ef4444 !important; /* အနီရောင် */
  border-color: #ef4444 !important;
  color: #ffffff !important;
  transform: rotate(90deg); /* လှည့်တဲ့ Effect လေး ပြန်ထည့်မယ် */
}

/* --- SORT DROPDOWN --- */
#sortSelect {
  padding: 10px 15px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #4b5563;
  font-family: "Poppins", sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}
#sortSelect:hover {
  border-color: #4f46e5;
}

/* Dark Mode Sort */
body.dark-mode #sortSelect {
  background: #1f2937;
  border-color: #374151;
  color: #e5e7eb;
}

/* --- DRAG & DROP OVERLAY --- */
.drag-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(79, 70, 229, 0.9); /* Indigo Transparent */
  z-index: 3000; /* Modal ထက်မြင့်ရမယ် */
  display: none; /* ပုံမှန်ချိန် ဖျောက်ထားမယ် */
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.drag-content {
  text-align: center;
  color: white;
  pointer-events: none; /* Mouse မစားအောင် */
  animation: pulse 1.5s infinite;
}

.drag-content i {
  margin-bottom: 20px;
}

.drag-active {
  display: flex !important;
}

/* --- FAVORITES SIDEBAR HOVER --- */
#nav-fav i {
  color: #f59e0b;
}
#nav-fav:hover,
#nav-fav.active {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}
body.dark-mode #nav-fav:hover,
body.dark-mode #nav-fav.active {
  background: #374151;
  color: #fbbf24;
  border-color: #4b5563;
}

/* --- DISABLE TEXT SELECTION --- */
body {
  -webkit-user-select: none; /* Safari */
  -ms-user-select: none; /* IE 10 and IE 11 */
  user-select: none; /* Standard syntax */
}

/* Input box တွေထဲမှာတော့ စာရိုက်လို့ရအောင် ပြန်ဖွင့်ပေးရမယ် */
input,
textarea {
  -webkit-user-select: text;
  user-select: text;
}

/* --- DARK MODE FIXES (MODALS & TEXT) --- */
/* 1. Modal Inputs & Selects */
body.dark-mode input[type="text"],
body.dark-mode select,
body.dark-mode textarea {
  background-color: #374151 !important;
  color: #ffffff !important;
  border-color: #4b5563 !important;
}

/* 2. Premium Active Section */
body.dark-mode #premiumActiveSection {
  background-color: #064e3b !important; /* Dark Green */
  border-color: #059669 !important;
}
body.dark-mode #premiumActiveSection h3,
body.dark-mode #premiumActiveSection p,
body.dark-mode #premiumActiveSection i {
  color: #d1fae5 !important; /* Light Green Text */
}

/* 3. Sort Dropdown Text */
body.dark-mode #sortSelect option {
  background-color: #1f2937;
  color: white;
}

body.dark-mode .modal-box,
body.dark-mode .modal-body,
body.dark-mode .modal-header,
body.dark-mode .modal-footer {
  background-color: #1f2937 !important; /* Modal Background Dark */
  color: #e5e7eb !important; /* Text Color Light */
  border-color: #374151 !important;
}

/* Input Box များနှင့် Select Box များ */
body.dark-mode input[type="text"],
body.dark-mode input[type="date"],
body.dark-mode select,
body.dark-mode textarea {
  background-color: #374151 !important; /* Input Background Dark Grey */
  color: #ffffff !important; /* စာလုံးအဖြူ */
  border: 1px solid #4b5563 !important;
}

body.dark-mode input::placeholder {
  color: #9ca3af !important; /* Placeholder မီးခိုးရောင် */
}

body.dark-mode label {
  color: #d1d5db !important; /* Label စာလုံးအဖြူ */
}

/* Checkbox ကို နှိပ်လိုက်ရင် (Checked ဖြစ်ရင်) အလုံးလေး ရွေ့မယ် */
#darkModeToggle:checked + div #toggleCircle {
  transform: translateX(18px); /* ညာဘက်ကို ရွေ့မယ် */
  background-color: #fff;
}

/* ခလုတ်နောက်ခံ အရောင်ပြောင်းမယ် */
#darkModeToggle:checked + div {
  background-color: #4f46e5 !important; /* Active Color (Blue) */
}

/* Desktop တွင် လုံးဝ မပေါ်စေရန် !important သုံးပါမည် */
.header-logout-icon {
  display: none !important;
}

/* --- MOBILE UI REVAMP (COMPACT & CLEAN) --- */
@media (max-width: 768px) {
  /* 1. Header Changes (Logo Left, Logout Right) */
  nav {
    display: flex;
    justify-content: space-between; /* ဘယ်ညာခွဲမယ် */
    align-items: center;
    padding: 10px 15px;
  }

  /* Logout Icon in Header */
  .header-logout-icon {
    display: block !important;
    font-size: 1.4rem;
    color: #ef4444;
    cursor: pointer;
  }

  /* Sidebar Logout Button (List ထဲကဟာကို ဖျောက်မယ်) */
  .sidebar-logout-btn {
    display: none !important;
  }

  /* 2. Transparent Nav Links (Cleaner Look) */
  .nav-links {
    background: transparent !important; /* နောက်ခံဖျောက် */
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px 15px;
    border-bottom: 1px solid #e5e7eb;
  }

  .nav-links li {
    background: transparent !important; /* ခလုတ်နောက်ခံ ဖျောက် */
    border: none !important;
    padding: 5px 0 !important;
    margin: 0 !important;
    color: #6b7280;
    font-size: 0.9rem;
    flex-direction: column; /* Icon အပေါ် စာ အောက် */
    gap: 5px;
  }

  /* Active State for Mobile */
  .nav-links li.active,
  .nav-links li:hover {
    color: var(--primary) !important;
    background: transparent !important;
    font-weight: 700;
    border-bottom: 2px solid var(--primary) !important; /* အောက်မျဉ်းတားမယ် */
    border-radius: 0;
  }

  /* Toggle Switch Alignment in Mobile */
  .dark-mode-item label {
    flex-direction: column;
    gap: 5px;
    margin: 0;
  }

  /* 3. Compact Grid View (Smaller Cards) */
  .grid-container {
    grid-template-columns: repeat(2, 1fr); /* ၂ တိုင်ခွဲမယ် */
    gap: 10px; /* ကြားအကွာအဝေး လျှော့မယ် */
    padding: 10px;
  }

  .file-card {
    border-radius: 12px;
  }

  .preview-box {
    height: 100px; /* ပုံအမြင့်လျှော့မယ် */
  }
  .preview-box i {
    font-size: 2rem; /* Icon သေးမယ် */
  }
  .preview-box img {
    height: 100%;
  }

  .card-info {
    padding: 10px;
  }

  .card-title {
    font-size: 0.8rem; /* စာလုံးသေးမယ် */
  }

  .card-meta span {
    font-size: 0.65rem;
  }

  /* List View Mobile Tweaks */

  .grid-container.list-view .preview-box {
    width: 35px;
    height: 35px;
    margin-right: 10px;
  }
  /* List Item တွေရဲ့ Border တွေ၊ Margin တွေကို ဖယ်ရှားမယ် */
  #nav-help,
  #nav-backup,
  #nav-restore,
  #nav-pin,
  #nav-other,
  .dark-mode-item,
  .divider-item {
    border: none !important; /* မျဉ်းကြောင်းဖျောက် */
    margin: 0 !important; /* ကွာဟချက်ဖျောက် */
    padding: 5px 12px !important; /* Padding ညှိ */
    background: transparent !important;
  }
}

/* --- FIXED LAYOUT & MOBILE SCROLL --- */

/* 2. Divider Items Style (Desktop) */
.divider-item {
  margin-top: 20px;
  border-top: 1px solid #eee;
  padding-top: 15px;
}

/* =========================================
   MOBILE VIEW (MAX-WIDTH: 768PX)
   ========================================= */
@media (max-width: 768px) {
  /* A. Sidebar Container Setup */
  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    display: block; /* Flex မသုံးဘဲ Block သုံးမယ် */
    padding: 0;
    background: var(--sidebar-bg);
    position: sticky;
    top: 0;
    z-index: 100;
  }

  /* B. HEADER ROW (Logo + Logout) */
  .sidebar-header {
    display: flex;
    justify-content: space-between; /* ဘယ်ညာခွဲမယ် */
    align-items: center;
    padding: 10px 20px;
    background: var(--sidebar-bg); /* နောက်ခံအရောင်ထည့် */
    border-bottom: 1px solid #f3f4f6; /* Menu နဲ့ကြား မျဉ်းတားမယ် */
  }

  /* Logo Fix */
  .logo {
    padding: 0; /* Padding အပိုတွေ ဖယ်မယ် */
    border: none; /* Logo အောက်မျဉ်း ဖယ်မယ် */
  }

  /* C. SCROLLABLE NAV LINKS */
  .nav-links {
    display: flex; /* ဘေးတိုက်စီမယ် */
    flex-direction: row;
    align-items: center;
    gap: 15px;

    /* *** Scrolling Magic *** */
    overflow-x: auto; /* ဘေးကို Scroll ဆွဲမယ် */
    white-space: nowrap; /* စာကြောင်းမကျိုးစေရ */
    padding: 10px 15px;
    width: 100%; /* အပြည့်ယူမယ် */
    box-sizing: border-box;

    /* Hide Scrollbar but keep functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE */
  }

  .nav-links::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }

  /* D. List Items Styling */
  .nav-links li {
    flex: 0 0 auto; /* မကျုံ့သွားအောင် */
    margin: 0 !important;
    border: none !important; /* Divider တွေ ဖျောက်မယ် */
    padding: 8px 12px !important;
    background: transparent !important;
    flex-direction: column; /* Icon အပေါ် စာ အောက် */
    font-size: 0.8rem;
    gap: 5px;
  }

  /* E. Hide Desktop Elements */
  .user-profile,
  .sidebar-logout-btn {
    display: none !important;
  }

  /* F. Divider Reset */
  .divider-item {
    margin-top: 0;
    border-top: none;
    padding-top: 8px;
  }

  /* G. Dark Mode Toggle in Mobile List */
  .dark-mode-item {
    margin-top: 0 !important;
    border-top: none !important;
    padding-top: 8px !important;
  }
  .theme-switch {
    flex-direction: column; /* Icon အပေါ် စာ အောက် ပုံစံ */
    gap: 5px;
  }
  .theme-switch span {
    font-size: 0.8rem;
    margin-left: 0 !important;
  }
}

/* Dark Mode Mobile Header Fix */
body.dark-mode .sidebar-header {
  background: #1f2937;
  border-bottom-color: #374151;
}

/* --- FIX: DARK MODE UPLOAD BOX --- */
body.dark-mode .file-upload-wrapper {
  background-color: #1f2937 !important; /* Dark Background */
  border-color: #4b5563 !important; /* Darker Border */
}

body.dark-mode .file-upload-wrapper:hover {
  background-color: #374151 !important; /* Hover ရင် နည်းနည်းလင်းမယ် */
  border-color: #818cf8 !important; /* Hover Border Blue */
}

/* Upload Box ထဲက စာသေးသေးလေး (Click to upload...) */
body.dark-mode .file-upload-wrapper small {
  color: #d1d5db !important; /* Light Grey Text */
}

/* Upload Box ထဲက Icon */
body.dark-mode .file-upload-wrapper i {
  color: #818cf8 !important; /* Light Blue Icon */
}

/* --- FIX: DARK MODE FOLDER CARDS (REMOVE WHITE GRADIENT) --- */

/* Folder အားလုံး (ID, Housing, etc.) ရဲ့ Gradient ကို ဖျောက်ပြီး အမည်းရောင်ပြောင်းမယ် */
body.dark-mode .folder-card,
body.dark-mode .folder-card.id,
body.dark-mode .folder-card.housing,
body.dark-mode .folder-card.business,
body.dark-mode .folder-card.education,
body.dark-mode .folder-card.travel,
body.dark-mode .folder-card.tax,
body.dark-mode .folder-card.medical,
body.dark-mode .folder-card.auto,
body.dark-mode .folder-card.media {
  background: #1e293b !important; /* နောက်ခံ အမည်းရောင် (Gradient မပါ) */
  border-color: #334155 !important;
}

/* Folder နာမည်စာသား (Grid View) */
body.dark-mode .folder-name {
  color: #f3f4f6 !important; /* အဖြူရောင် */
}

/* List View မှာ Folder နာမည်စာသား */
body.dark-mode .grid-container.list-view .folder-name {
  color: #f3f4f6 !important;
}

/* Folder အရေအတွက် (Files Count) */
body.dark-mode .folder-count {
  background-color: #0f172a !important; /* နောက်ခံ အမည်းရင့် */
  color: #9ca3af !important; /* စာလုံး မီးခိုးရောင် */
}

/* Hover လုပ်ရင် နည်းနည်းလင်းမယ် */
body.dark-mode .folder-card:hover {
  background: #334155 !important;
}

/* --- NEW FEATURES STYLES --- */

/* 1. EXPIRED BADGE */
.expired-badge {
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
  margin-left: 5px;
  border: 1px solid #fecaca;
  display: inline-block;
}
body.dark-mode .expired-badge {
  background: #450a0a;
  color: #fca5a5;
  border-color: #7f1d1d;
}

/* 2. MULTI-SELECT HIGHLIGHT */
.file-card.selected {
  border: 2px solid #4f46e5;
  background: #e0e7ff;
  transform: scale(0.98);
}
body.dark-mode .file-card.selected {
  border-color: #818cf8;
  background: #1e1b4b;
}

/* Checkbox Overlay */
.select-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
  width: 20px;
  height: 20px;
  background: white;
  border: 2px solid #ccc;
  border-radius: 4px;
  display: none; /* Only show in select mode */
  align-items: center;
  justify-content: center;
  color: #4f46e5;
}
.file-card.selected .select-overlay {
  background: #4f46e5;
  border-color: #4f46e5;
  color: white;
}
.select-mode .select-overlay {
  display: flex; /* Show checkboxes when mode active */
}

/* 3. FLOATING ACTION BAR */
.floating-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: white;
  padding: 15px 25px;
  border-radius: 50px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 5000;
  animation: slideUp 0.3s ease;
}

/* =========================================
   BEAUTIFUL SELECTION BAR (DESKTOP & MOBILE)
   ========================================= */

/* 1. Base Design (Desktop - Modern Floating Island) */
#selectionBar {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%); /* အလယ်တည့်တည့်ထားမယ် */
  
  /* Glassy Dark Theme */
  background: rgba(31, 41, 55, 0.95); /* Dark Grey transparency */
  backdrop-filter: blur(10px); /* နောက်ခံဝါးမယ့် Effect */
  color: white;
  
  padding: 12px 25px; /* Desktop အတွက် Padding အနေတော် */
  border-radius: 50px; /* ဆေးတောင့်ပုံစံ (Pill Shape) */
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25); /* အရိပ်အကြီးကြီး */
  border: 1px solid rgba(255, 255, 255, 0.1); /* ဘောင်ပါးပါးလေး */
  
  display: none; /* JS ကနေ flex ပြောင်းပေးလိမ့်မယ် */
  align-items: center;
  gap: 20px;
  z-index: 5000;
  
  /* Animation: အောက်ကနေ ကြွတက်လာမယ် */
  animation: slideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Selected Count Text */
#selectedCount {
  font-weight: 600;
  font-size: 0.95rem;
  color: #f3f4f6;
  padding-right: 15px;
  border-right: 1px solid rgba(255, 255, 255, 0.2); /* မျဉ်းလေးတားမယ် */
}

/* Cancel Button */
.btn-float-cancel {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
  font-size: 0.9rem;
}
.btn-float-cancel:hover {
  color: #fff;
  text-decoration: underline;
}

/* Delete Button (Gradient Red) */
.btn-float-delete {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4); /* အနီရောင် Glow */
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-float-delete:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
}

/* =========================================
   MOBILE COMPACT VIEW (Fix for "Too Big")
   ========================================= */
@media (max-width: 768px) {
  #selectionBar {
    bottom: 20px; /* အောက်ခြေနဲ့ နည်းနည်းပိုကပ်မယ် */
    padding: 8px 15px !important; /* Padding ကို သိသိသာသာ လျှော့မယ် */
    width: 90%; /* ဖုန်း Screen အကျယ်ရဲ့ 90% ယူမယ် */
    max-width: 360px; /* အရမ်းမကျယ်စေရ */
    border-radius: 12px; /* Pill shape မဟုတ်ဘဲ Bar ပုံစံပြောင်းမယ် */
    
    justify-content: space-between; /* ဘယ်ညာခွဲမယ် */
    gap: 10px; /* ကြားဟချက် လျှော့မယ် */
  }

  /* စာလုံးဆိုဒ်တွေ သေးမယ် */
  #selectedCount {
    font-size: 0.8rem !important; /* စာလုံးသေး */
    padding-right: 10px;
    border-right: none; /* Mobile မှာ မျဉ်းမလိုတော့ဘူး */
  }

  .btn-float-cancel {
    font-size: 0.8rem !important;
  }

  /* Delete ခလုတ်ကို ပိုကျစ်လစ်အောင်လုပ်မယ် */
  .btn-float-delete {
    padding: 6px 12px !important; /* ခလုတ်အကြီးကြီး မဖြစ်အောင် */
    font-size: 0.75rem !important;
    border-radius: 8px !important; /* လုံးဝန်းမှု လျှော့မယ် */
    box-shadow: none !important; /* Mobile မှာ အရိပ်မလို */
  }
  
  .btn-float-delete i {
    font-size: 0.8rem; /* Icon သေးမယ် */
  }
}

/* 4. IMAGE FILTER BUTTONS (IN VIEW MODAL) */
.filter-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  background: #333;
}
.btn-filter {
  padding: 8px 15px;
  border: none;
  border-radius: 20px;
  background: #e5e7eb;
  color: #374151;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}
body.dark-mode .btn-filter {
  background: #374151;
  color: white;
}
.btn-filter:hover {
  background: #777;
}

/* --- FIX: DATE INPUT ALIGNMENT --- */
input[type="date"] {
  width: 100%;
  padding: 14px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  font-size: 0.95rem;
  color: #1f2937;
  box-sizing: border-box; /* ဒီအကြောင်းက အရေးကြီးဆုံးပါ (ဘောင်မကျော်အောင် ထိန်းပေးတယ်) */
  font-family: inherit;
  appearance: none; /* iOS မှာ ပုံပျက်တာ ကာကွယ်ဖို့ */
}
body.dark-mode input[type="date"] {
  background: #374151;
  color: white;
  border-color: #4b5563;
}

/* Drop Zone Highlight Effect */
.file-upload-wrapper.drag-over {
  background-color: #e0e7ff !important; /* အပြာနု */
  border-color: #4f46e5 !important; /* ဘောင်အပြာ */
  border-style: solid !important;
  transform: scale(1.02);
}

/* Dark Mode */
body.dark-mode .file-upload-wrapper.drag-over {
  background-color: #374151 !important;
  border-color: #818cf8 !important;
}

/* --- NEW CARD LAYOUT (SPLIT ACTIONS & CHECKBOX) --- */

/* 1. Select Checkbox (Top Left) */
.card-checkbox {
  position: absolute;
  top: 6px !important; /* ထောင့်နဲ့ ပိုကပ်မယ် */
  left: 6px !important;
  z-index: 10;
  width: 18px !important; /* အကျယ် ၁၈ */
  height: 18px !important; /* အမြင့် ၁၈ */
  min-width: 18px !important;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #cbd5e1;
  border-radius: 4px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

/* Select လုပ်ထားရင် အရောင်ပြောင်းမယ် */
.file-card.selected .card-checkbox {
  background: #4f46e5;
  border-color: #4f46e5;
  color: white;
}
.file-card.selected .card-checkbox i {
  display: block; /* Show Check Icon */
  font-size: 14px;
}
.card-checkbox i {
  font-size: 10px !important;
  display: none; /* Hide Check Icon by default */
}

/* Hover လုပ်ရင် Checkbox ပေါ်မယ် (Desktop) */
.file-card:hover .card-checkbox {
  border-color: #4f46e5;
}

/* 2. Top-Right Actions (QR, Star, Share) */
.actions-top-right {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 5px;
  z-index: 10;
}

/* 3. Bottom-Right Actions (Download, Edit, Delete) */
/* Preview Box ရဲ့ အောက်နားကပ်လျက်မှာ ပေါ်မယ် */
.actions-bottom-right {
  position: absolute;
  top: 108px; /* Preview Height (150px) - Button Height (32px) - Margin (10px) */
  right: 8px;
  display: flex;
  gap: 5px;
  z-index: 10;
}

/* Mobile Responsive Tweaks */
/* --- FINAL MOBILE FIX (CLEAN & UNIFORM SIZES) --- */
@media (max-width: 768px) {
  /* 1. Reset & Force Button Sizes */
  /* Grid View ရော List View ရော နေရာတိုင်းက action-btn ကို သေးမယ် */
  .file-card .action-btn,
  .grid-container.list-view .action-btn,
  .btn-download,
  .btn-edit,
  .btn-delete {
    width: 28px !important; /* အကျယ် 28px အသေ */
    height: 28px !important; /* အမြင့် 28px အသေ */
    min-width: 28px !important; /* မပိန်သွားအောင် */
    max-width: 28px !important; /* မကြီးသွားအောင် */

    padding: 0 !important; /* အတွင်းကွာဟချက် ဖျက်မယ် */
    margin: 0 !important;

    font-size: 12px !important; /* Icon စာလုံးဆိုဒ် */

    display: flex !important;
    align-items: center;
    justify-content: center;

    border-radius: 6px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    box-shadow: none !important;
  }

  /* Icon ကိုပါ အတင်းသေးခိုင်းမယ် (တချို့ Icon က ကြီးနေတတ်လို့) */
  .file-card .action-btn i {
    font-size: 12px !important;
    line-height: 1 !important;
  }

  /* 2. Positioning for Grid View (Card View) */
  /* Group 1 (QR, Star, Share) */
  .file-card .actions-top-right {
    top: 8px !important;
    right: 8px !important;
    gap: 4px !important;
  }

  /* Group 2 (Download, Edit, Delete) */
  .file-card .actions-bottom-right {
    top: auto !important;
    bottom: 5px !important; /* Preview အောက်ခြေကပ် */
    right: 5px !important; /* ညာဘက်ကပ် */
    gap: 4px !important;
    z-index: 20;
  }

  .file-card .preview-box {
    position: relative !important; /* For absolute positioning of buttons */
  }

  /* 3. Checkbox Styling */
  .card-checkbox {
    width: 24px !important;
    height: 24px !important;
    border-color: #94a3b8 !important;
    background: rgba(255, 255, 255, 0.9) !important;
  }

  /* 4. List View Specific Layout Fixes */
  .grid-container.list-view .file-card {
    padding-right: 10px !important;
    padding-left: 35px !important;
    padding-bottom: 40px !important; /* ခလုတ်တွေအတွက် အောက်မှာနေရာပေး */
    flex-wrap: wrap !important;
    height: auto !important;
  }

  /* List View - Button Groups Positioning */
  .grid-container.list-view .actions-top-right {
    top: auto !important;
    bottom: 5px !important;
    right: 10px !important;
    transform: none !important;
  }

  .grid-container.list-view .actions-bottom-right {
    top: auto !important;
    bottom: 5px !important;
    right: 115px !important; /* Group 1 ဘေးနား (3 buttons * 28px + gaps) */
    transform: none !important;
  }

  .grid-container.list-view .card-info {
    width: 100% !important;
    margin-bottom: 5px !important;
  }
}

/* =========================================
   ALL-IN-ONE MOBILE LAYOUT & HEADER FIX
   ========================================= */

@media (max-width: 768px) {
  /* 1. Main Container Layout */
  #appContainer {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    overflow: hidden !important; /* Window Scroll ပိတ်မယ် */
  }

  /* 2. Sidebar (Mobile Header) Fix */
  .sidebar {
    width: 100% !important;
    height: auto !important;
    flex-shrink: 0 !important; /* မကျုံ့စေရ */

    /* iPhone Notch ရှောင်ရန် Padding */
    padding-top: env(safe-area-inset-top) !important;
    padding-bottom: 0 !important;

    /* အရေးကြီး: နောက်ခံအရောင် ထည့်ရမယ် (မထည့်ရင် နောက်ကွယ်ကစာတွေနဲ့ ရောကုန်မယ်) */
    background-color: #ffffff !important;
    border-bottom: 1px solid #e5e7eb;

    position: relative !important;
    z-index: 2000 !important; /* အပေါ်ဆုံးမှာ အမြဲရှိမယ် */
    display: block !important;
  }

  /* Logo နဲ့ Logout Icon ပါတဲ့ တန်း */
  .sidebar-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 15px !important;
    height: 50px !important; /* အမြင့်သတ်မှတ်ပေးလိုက်မယ် */
  }

  /* Logo Icon & Text */
  .logo {
    display: flex !important;
    align-items: center !important;
    color: #1f2937 !important;
  }

  /* Logout Icon ကို သေချာပေါက် ပြမယ် */
  .header-logout-icon {
    display: block !important;
    font-size: 1.2rem !important;
    color: #ef4444 !important; /* အနီရောင် */
    cursor: pointer;
    padding: 5px;
  }

  /* 3. Main Content (Scrollable Area) */
  .main-content {
    flex: 1 !important; /* ကျန်တဲ့နေရာအပြည့်ယူ */
    overflow-y: auto !important; /* Scroll ဆွဲရမည့်နေရာ */
    padding: 15px !important;
    padding-bottom: 80px !important;
    background-color: #f3f4f6 !important;

    /* Header နဲ့လွတ်အောင် Padding မလိုတော့ဘူး (Flex ကြောင့်) */
    margin-top: 0 !important;
  }

  /* 4. Announcement Box */
  .announcement-box {
    padding: 8px 12px !important;
    margin-bottom: 15px !important;
    border-radius: 8px !important;
    position: relative !important;
    z-index: 10;
  }

  .announce-content {
    font-size: 0.8rem !important;
    gap: 8px !important;
  }

  /* 5. Top Bar (Search & Sort) */
  .top-bar {
    margin-top: 0 !important;
    margin-bottom: 15px !important;
    z-index: 5;
    background: transparent !important;
  }

  /* 6. Modal Fixes (Scrollable) */
  .modal-box {
    max-height: 85vh !important;
    width: 90% !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .modal-body {
    overflow-y: auto !important;
    flex-grow: 1 !important;
  }
  .modal-header,
  .modal-footer {
    flex-shrink: 0 !important;
  }

  /* Icon (Page Title) ကို ဖျောက်မည် */
  #pageTitle {
    display: none !important;
  }

  /* Search Box ကို ဘယ်ဘက်ကပ်သွားအောင် နေရာပြန်ညှိမည် */
  .header-left {
    padding: 0 !important; /* Back button အတွက် နေရာနည်းနည်းပဲယူမယ် */
  }

  .search-container {
    margin-left: 5px !important; /* ဘယ်ဘက် အကွာအဝေး လျှော့မယ် */
  }
}

/* --- DARK MODE HEADER FIX --- */
body.dark-mode .sidebar {
  background-color: #1f2937 !important; /* Dark Bg */
  border-bottom-color: #374151 !important;
}
body.dark-mode .logo {
  color: #f3f4f6 !important; /* Light Text */
}
body.dark-mode .main-content {
  background-color: #0f172a !important;
}

/* --- COMPACT MOBILE VIEW (SMALLER & DENSER) --- */
@media (max-width: 768px) {
  /* 1. Header & Search Compact */
  header {
    margin-bottom: 10px !important; /* Header အောက် ကွာဟချက်လျှော့ */
  }
  /* SEARCH INPUT FIX (စာသားထပ်နေတာ ဖြေရှင်းရန်) */
  .search-container input {
    padding-left: 38px !important;
    padding-right: 10px !important;
    /* padding: 8px 12px !important;    Search Box အတွင်းသား လျှော့ */
    font-size: 0.8rem !important; /* စာလုံးဆိုဒ် သေး */
    height: 36px !important; /* အမြင့် သတ်မှတ် */
  }
  /* Search Icon ကိုလည်း နေရာနည်းနည်း ညှိမယ် */
  .search-icon {
    left: 12px !important;
    font-size: 0.9rem !important;
  }
  .btn-add {
    padding: 8px 12px !important; /* Add ခလုတ် သေး */
    font-size: 0.8rem !important;
    height: 36px !important;
    white-space: nowrap; /* စာကြောင်း မကျိုးအောင် */
  }
  .header-left .btn-back {
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
    height: 36px !important;
  }

  /* 2. Grid Container Gaps */
  .grid-container {
    gap: 8px !important; /* ကတ်တွေကြား အကွာအဝေး စိပ်လိုက်မယ် */
    padding: 8px !important; /* ဘေးဘောင် ကွာဟချက် လျှော့ */
  }

  /* 3. Card Styling (Grid View) */
  .file-card {
    border-radius: 8px !important;
  }
  .preview-box {
    height: 90px !important; /* ပုံအမြင့်ကို သိသိသာသာ လျှော့လိုက်မယ် */
  }
  /* ပုံမရှိရင်ပြတဲ့ Icon */
  .preview-box i {
    font-size: 2rem !important;
  }

  .card-info {
    padding: 8px !important; /* စာရေးတဲ့နေရာ နေရာလွတ်လျှော့ */
  }
  .card-title {
    font-size: 0.75rem !important; /* ခေါင်းစဉ် စာလုံးသေး */
    margin-bottom: 2px !important;
    line-height: 1.3 !important;
  }
  .card-meta span,
  .cat-badge {
    font-size: 0.65rem !important; /* ရက်စွဲနဲ့ Category စာလုံးသေး */
    padding: 2px 4px !important;
  }

  /* 4. List View Compact */
  .grid-container.list-view {
    gap: 6px !important; /* List တစ်ခုနဲ့တစ်ခု အရမ်းကပ်သွားမယ် */
  }
  .grid-container.list-view .file-card {
    min-height: 50px !important; /* အမြင့် လျှော့မယ် */
    padding-top: 5px !important;
    padding-bottom: 35px !important; /* အောက်ခြေခလုတ်တွေအတွက် နေရာ */
    padding-left: 30px !important; /* Checkbox အတွက် နေရာ */
    padding-right: 5px !important;
  }

  /* List View Preview Image (Tiny) */
  .grid-container.list-view .preview-box {
    width: 30px !important;
    height: 30px !important;
    margin-right: 8px !important;
  }
  .grid-container.list-view .preview-box i {
    font-size: 1rem !important;
  }

  /* 5. Checkbox (Tiny) */
  .card-checkbox {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    top: 5px !important;
    left: 5px !important;
  }
  .card-checkbox i {
    font-size: 10px !important; /* အမှန်ခြစ်လေး သေးမယ် */
  }

  /* 6. Action Buttons (Extra Small) */
  .file-card .action-btn,
  .grid-container.list-view .action-btn,
  .btn-download,
  .btn-edit,
  .btn-delete {
    width: 24px !important; /* ခလုတ်ဆိုဒ် ၂၄ ထိ သေးလိုက်မယ် */
    height: 24px !important;
    min-width: 24px !important;
    font-size: 10px !important; /* Icon စာလုံး သေးမယ် */
    border-radius: 4px !important;
  }

  /* Button Groups positioning update */
  .actions-bottom-right {
    bottom: 4px !important;
    right: 4px !important;
    gap: 3px !important;
  }
  .actions-top-right {
    top: 4px !important;
    right: 4px !important;
    gap: 3px !important;
  }

  /* List View Button Groups */
  .grid-container.list-view .actions-bottom-right {
    right: 90px !important; /* 3 buttons * 24px + gaps */
    bottom: 4px !important;
  }
  .grid-container.list-view .actions-top-right {
    right: 4px !important;
    bottom: 4px !important;
  }

  /* Folder Icon (Grid) */
  .folder-icon {
    font-size: 2rem !important; /* Icon ဆိုဒ်လျှော့ (မူရင်း 3.5rem) */
    margin-bottom: 5px !important;
  }

  /* Folder Name (Grid) */
  .folder-name {
    font-size: 0.75rem !important; /* စာလုံးသေးမယ် */
    line-height: 1.2 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    display: block;
  }

  /* Folder Count (Grid) */
  .folder-count {
    font-size: 0.65rem !important;
    margin-top: 3px !important;
    padding: 1px 6px !important;
  }

  .grid-container.list-view .folder-card {
    height: 50px !important; /* List View အမြင့်လျှော့ */
    min-height: 50px !important;
    padding: 5px 10px !important;
  }

  .grid-container.list-view .folder-icon {
    font-size: 1.4rem !important; /* List Icon သေးမယ် */
    margin-right: 10px !important;
  }

  .grid-container.list-view .folder-name {
    font-size: 0.8rem !important;
  }

  /* Grid View Top Strip (Mobile) */
  .folder-card::before {
    height: 3px !important; /* Mobile မှာ 3px ပဲထားမယ် */
  }

  /* List View Left Strip (Mobile) */
  .grid-container.list-view .folder-card::before {
    width: 3px !important; /* Mobile List မှာ 3px ပဲထားမယ် */
  }

  /* Folder Card Main Border */
  .folder-card {
    border-width: 1px !important; /* ဘောင်အပါးဆုံး */
  }
}

/* --- ONBOARDING TOUR STYLES --- */
.tour-icon {
  font-size: 3.5rem;
  margin-bottom: 15px;
  animation: bounce 2s infinite;
}

.tour-step h3 {
  color: #4f46e5;
  margin-bottom: 10px;
}

.tour-step p {
  color: #4b5563;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Dots Indicator */
.step-indicators {
  display: flex;
  gap: 5px;
  align-items: center;
}
.dot {
  width: 8px;
  height: 8px;
  background: #e5e7eb;
  border-radius: 50%;
  transition: all 0.3s;
}
.dot.active {
  background: #4f46e5;
  width: 20px;
  border-radius: 10px;
}

/* Dark Mode Support */
body.dark-mode .tour-step h3 {
  color: #818cf8;
}
body.dark-mode .tour-step p {
  color: #d1d5db;
}

/* --- FIX: DESKTOP FILE CARD SIZE (MATCH FOLDER) --- */
@media (min-width: 769px) {
  /* Desktop Only */

  /* 1. File Card ကို Folder နဲ့တူအောင် အမြင့်သတ်မှတ်မယ် */
  .grid-container:not(.list-view) .file-card {
    height: 160px !important; /* Folder Card အမြင့်နဲ့ တူစေမယ် */
    display: flex !important;
    flex-direction: column !important;
  }

  /* 2. Preview Image နေရာကို လျှော့ချမယ် */
  .grid-container:not(.list-view) .preview-box {
    /* Preview နေရာကို အမြင့်တိုးမယ် (စာနေရာ လျှော့မယ်) */
    height: 120px !important; 
    background-color: #f1f5f9; /* ပုံအပြည့်ပေါ်ရင် ဘေးလွတ်နေမယ့်နေရာကို မီးခိုးရောင်ထားမယ် */
    padding: 5px; /* ပုံနဲ့ ဘောင် မကပ်အောင် */
    flex-shrink: 0 !important;
  }

  /* 3. စာသားနေရာကို ကျစ်လစ်အောင်လုပ်မယ် */
  .grid-container:not(.list-view) .card-info {
    padding: 8px 15px !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .grid-container:not(.list-view) .card-title {
    font-size: 0.9rem !important;
    margin-bottom: 2px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ပုံကို အပြည့်ပေါ်စေမည့် ကုဒ် */
.grid-container:not(.list-view) .preview-box img,
.grid-container:not(.list-view) .lazy-thumb {
    object-fit: contain !important; /* ပုံကို အတင်းမဖြတ်ဘဲ အချိုးကျ အပြည့်ပြမယ် */
    width: 100% !important;
    height: 100% !important;
    border-radius: 4px;
}

/* 3. Text Area Adjustment (ပုံနေရာယူလိုက်လို့ စာနေရာညှိမယ်) */
.grid-container:not(.list-view) .card-info {
    padding: 6px 10px !important; /* Padding လျှော့မယ် */
}

.grid-container:not(.list-view) .card-title {
    font-size: 0.8rem !important; /* ခေါင်းစဉ် နည်းနည်းသေးမယ် */
    margin-bottom: 0 !important;
}

.grid-container:not(.list-view) .card-meta {
    font-size: 0.7rem !important;
}

/* --- FORCE SHOW THUMBNAILS --- */
.preview-box img,
.lazy-thumb {
    opacity: 1 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 4px;
    object-fit: contain !important;
    
    /* Hardware Acceleration */
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    perspective: 1000px;
    
    /* Opacity တစ်ခုတည်းကိုပဲ animate လုပ်မယ် (Layout မရွေ့အောင်) */
    transition: opacity 0.3s ease; 
    will-change: opacity;
}

/* --- FIX: GRID VIEW CLEANER LAYOUT (VERTICAL BUTTONS) --- */

/* List View မဟုတ်သော (Grid View) အခြေအနေများအတွက်သာ */
.grid-container:not(.list-view) {
    
    /* 1. Group 1 (QR, Star, Share) - ညာဘက်အပေါ် ထောင်လိုက် */
    .actions-top-right {
        flex-direction: column !important; /* ထောင်လိုက်စီမယ် */
        top: 5px !important;
        right: 5px !important;
        gap: 6px !important; /* ခလုတ်ကြား နည်းနည်းခွာမယ် */
    }

    /* 2. Group 2 (Download, Edit, Delete) - ဘယ်ဘက်အောက် ထောင်လိုက် */
    .actions-bottom-right {
        flex-direction: column !important; /* ထောင်လိုက်စီမယ် */
        
        /* နေရာပြောင်းမယ် (ဘယ်ဘက်အောက်) */
        right: auto !important; 
        left: 5px !important;   
        bottom: 5px !important; 
        top: auto !important;
        
        gap: 6px !important;
        z-index: 20;
    }

    /* 3. ခလုတ်ဒီဇိုင်း (ပိုရှင်းလင်းအောင်) */
    .action-btn {
        width: 26px !important;
        height: 26px !important;
        font-size: 11px !important;
        
        /* နောက်ခံကို အဖြူရောင်ဖျော့ဖျော့ထားမယ် (ပုံပေါ်မှာမို့လို့) */
        /* background-color: rgba(255, 255, 255, 0.9) !important;  */
        border: 1px solid #cbd5e1 !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
        border-radius: 6px !important;
        margin: 0 !important;
    }

    /* Checkbox နဲ့ မထပ်အောင် Checkbox ကို နေရာအနည်းငယ်ညှိမယ် */
    .card-checkbox {
        top: 5px !important;
        left: 5px !important;
        z-index: 30; /* ခလုတ်တွေထက် အပေါ်ရောက်အောင် */
    }
}

/* =========================================
   UNIVERSAL PREVIEW MODAL DESIGN
   ========================================= */

/* 1. Overlay (Background) */
.uni-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* နောက်ခံ အမည်းရောင် */
    backdrop-filter: blur(8px); /* ဝါးတဲ့ Effect */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease-out;
}

/* 2. Modal Box */
.uni-modal-content {
    background: #ffffff;
    width: 90%;
    max-width: 900px; /* Desktop မှာ အများဆုံးအကျယ် */
    height: 85vh;     /* အမြင့် 85% */
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
    animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 3. Header */
.uni-modal-header {
    padding: 15px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.uni-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.uni-close-btn {
    background: #f3f4f6;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.uni-close-btn:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

/* 4. Body (Scrollable) */
.uni-modal-body {
    flex: 1;
    background: #000; /* ပုံတွေထင်းအောင် အမည်းခံမယ် */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Content Styling */
.uni-modal-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* ပုံအပြည့်ပေါ်မယ် */
}

.uni-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 5. Footer */
.uni-modal-footer {
    padding: 12px 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
}

.uni-action-btn {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.uni-action-btn:hover {
    background: #4338ca;
}

/* Dark Mode Adjustments */
body.dark-mode .uni-modal-content {
    background: #1f2937;
    border: 1px solid #374151;
}
body.dark-mode .uni-modal-header,
body.dark-mode .uni-modal-footer {
    background: #111827;
    border-color: #374151;
}
body.dark-mode .uni-modal-header h3 {
    color: #f3f4f6;
}

/* Animations */
@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* =========================================
   FINAL MOBILE FIX: LIST VIEW CHECKBOX TOP-LEFT
   ========================================= */

@media (max-width: 768px) {

  /* 1. RESET & UNIFORM SIZES */
  .file-card .action-btn,
  .btn-download,
  .btn-edit,
  .btn-delete,
  .card-checkbox {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    border-radius: 4px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15) !important;
    margin: 0 !important;
    padding: 0 !important;
    
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid #cbd5e1 !important;
  }

  .file-card .action-btn i,
  .card-checkbox i {
      font-size: 10px !important;
      line-height: 1 !important;
      color: #4b5563 !important;
  }

  /* =========================================
     A. MOBILE GRID VIEW
     ========================================= */
  
  /* 1. Hide Checkbox in Grid */
  .grid-container:not(.list-view) .card-checkbox {
      display: none !important;
  }

  /* 2. Download Group (Top Left) */
  .grid-container:not(.list-view) .file-card .actions-bottom-right {
    position: absolute !important;
    top: 5px !important;
    left: 5px !important; 
    
    right: auto !important;
    bottom: auto !important;

    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important; 
    z-index: 40 !important;
  }

  /* 3. QR Group (Top Right) */
  .grid-container:not(.list-view) .file-card .actions-top-right {
    position: absolute !important;
    top: 5px !important;
    right: 5px !important;
    left: auto !important;
    
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
  }

  /* 4. Grid Preview Height */
  .grid-container:not(.list-view) .preview-box {
    height: 110px !important;
    position: relative !important;
  }

  /* =========================================
     B. MOBILE LIST VIEW (UPDATED CHECKBOX)
     ========================================= */

  /* 1. Card Container */
  .grid-container.list-view .file-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    height: auto !important;
    min-height: 60px !important;
    padding: 8px !important;
    
    /* Checkbox နဲ့မထပ်အောင် ဘယ်ဘက်နေရာချန် */
    padding-left: 30px !important; 
    position: relative !important;
  }

  /* 2. CHECKBOX - TOP LEFT & SMALLER */
  .grid-container.list-view .card-checkbox {
    display: flex !important;
    position: absolute !important;
    
    /* ဘယ်ဘက်အပေါ်ထောင့်ကပ်မယ် */
    left: 4px !important;
    top: 4px !important;
    transform: none !important; /* အလယ်ပို့တာဖြုတ်မယ် */
    
    /* ဆိုဒ်ကို ၁၈ ထိ သေးလိုက်မယ် */
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    
    z-index: 50 !important;
  }
  
  /* Icon inside checkbox */
  .grid-container.list-view .card-checkbox i {
      font-size: 9px !important;
  }

  /* 3. Content Area */
  .grid-container.list-view .file-card > div[onclick] {
      display: flex !important;
      align-items: center !important;
      flex: 1 !important;
      width: 100% !important;
      margin-right: 90px !important; 
  }

  /* 4. Thumbnail */
  .grid-container.list-view .preview-box {
    width: 35px !important;
    height: 35px !important;
    min-width: 35px !important;
    margin-right: 10px !important;
    border: none !important;
    background: transparent !important;
    position: static !important;
  }
  
  .grid-container.list-view .preview-box img {
      border-radius: 4px !important;
  }

  /* 5. Title */
  .grid-container.list-view .card-info {
    padding: 0 !important;
    flex: 1 !important;
    min-width: 0 !important;
  }
  
  .grid-container.list-view .card-title {
      font-size: 0.8rem !important;
      margin: 0 !important;
      white-space: nowrap !important;
      overflow: hidden !important;
      text-overflow: ellipsis !important;
  }
  
  .grid-container.list-view .card-meta {
      display: none !important;
  }

  /* --- 6. ACTION BUTTONS (6 Icons Right Side) --- */
  
  /* Group 1 (Rightmost) */
  .grid-container.list-view .actions-top-right {
      display: flex !important;
      position: absolute !important;
      right: 5px !important;
      top: 50% !important;
      transform: translateY(-50%) !important;
      flex-direction: row !important;
      gap: 4px !important;
      left: auto !important;
  }

  /* Group 2 (Left of Group 1) */
  .grid-container.list-view .actions-bottom-right {
      display: flex !important;
      position: absolute !important;
      right: 90px !important; 
      top: 50% !important;
      transform: translateY(-50%) !important;
      flex-direction: row !important;
      gap: 4px !important;
      
      left: auto !important;
      bottom: auto !important;
      margin: 0 !important;
  }

  /* =========================================
     C. GENERAL FIXES
     ========================================= */
  .grid-container {
    gap: 8px !important;
    padding: 10px !important;
  }
  
  .sidebar {
    position: sticky !important;
    top: 0;
    z-index: 100;
    width: 100% !important;
    padding: 0 !important;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
  }
  
  .search-container input {
    padding-left: 35px !important;
    font-size: 0.8rem !important;
    height: 36px !important;
  }
  
  .btn-add, .header-left .btn-back {
      padding: 6px 12px !important;
      font-size: 0.8rem !important;
      height: 36px !important;
  }
}

/* =========================================
   UNIVERSAL PREVIEW MODAL DESIGN
   ========================================= */

/* 1. Overlay (Background) */
.uni-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* နောက်ခံ အမည်းရောင် */
    backdrop-filter: blur(8px); /* ဝါးတဲ့ Effect */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease-out;
}

/* 2. Modal Box */
.uni-modal-content {
    background: #ffffff;
    width: 90%;
    max-width: 900px; /* Desktop မှာ အများဆုံးအကျယ် */
    height: 85vh;     /* အမြင့် 85% */
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
    animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 3. Header */
.uni-modal-header {
    padding: 15px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.uni-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.uni-close-btn {
    background: #f3f4f6;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.uni-close-btn:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

/* 4. Body (Scrollable) */
.uni-modal-body {
    flex: 1;
    background: #000; /* ပုံတွေထင်းအောင် အမည်းခံမယ် */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Content Styling */
.uni-modal-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* ပုံအပြည့်ပေါ်မယ် */
}

.uni-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 5. Footer */
.uni-modal-footer {
    padding: 12px 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
}

.uni-action-btn {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.uni-action-btn:hover {
    background: #4338ca;
}

/* Dark Mode Adjustments */
body.dark-mode .uni-modal-content {
    background: #1f2937;
    border: 1px solid #374151;
}
body.dark-mode .uni-modal-header,
body.dark-mode .uni-modal-footer {
    background: #111827;
    border-color: #374151;
}
body.dark-mode .uni-modal-header h3 {
    color: #f3f4f6;
}

/* Animations */
@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* --- DESKTOP GRID VIEW FIX (TALLER CARDS) --- */
@media (min-width: 769px) {
  /* 1. Increase Card Height */
  .grid-container:not(.list-view) .file-card {
    height: 200px !important; /* အမြင့်တိုးလိုက်သည် (စာဆံ့အောင်) */
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important; /* စာနဲ့ပုံ ခွဲထားမယ် */
  }

  /* 2. Adjust Preview Image Height */
  .grid-container:not(.list-view) .preview-box {
    height: 130px !important; /* ပုံအမြင့် */
    background-color: #f1f5f9; 
    padding: 5px; 
    flex-shrink: 0 !important;
    position: relative;
    overflow: hidden;
  }

  /* 3. Text Area Adjustment */
  .grid-container:not(.list-view) .card-info {
    padding: 10px 15px !important; /* Padding ပြန်ထည့် */
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 70px !important; /* စာနေရာအတွက် အနည်းဆုံးနေရာ */
  }

  /* 4. Title Styling */
  .grid-container:not(.list-view) .card-title {
    font-size: 0.9rem !important;
    margin-bottom: 5px !important;
    line-height: 1.3;
    
    /* စာ ၂ ကြောင်းအထိ ပေးပေါ်မယ် */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal !important; 
    overflow: hidden;
  }
  
  /* 5. Force Show Date & Category */
  .grid-container:not(.list-view) .card-meta {
      display: flex !important; /* အရင်က none ဖြစ်နေရင် ပြန်ဖော်မယ် */
      align-items: center;
      justify-content: space-between;
      font-size: 0.75rem !important;
      margin-top: auto; /* အောက်ဆုံးကပ်မယ် */
  }
}

/* --- MOBILE GRID HEIGHT FIX --- */
@media (max-width: 768px) {
    
  /* Grid View မှာ Card အမြင့်ကို Auto သို့မဟုတ် Fixed Height ပေးမယ် */
  .grid-container:not(.list-view) .file-card {
      height: 155px !important; /* Mobile မှာ ၁၅၅ လောက်ဆို အဆင်ပြေပြီ */
      display: flex !important;
      flex-direction: column !important;
  }

  /* Preview Image (Mobile Grid) */
  .grid-container:not(.list-view) .preview-box {
      height: 100px !important; /* ပုံအမြင့် */
      flex-shrink: 0 !important;
  }

  /* Text Info (Mobile Grid) */
  .grid-container:not(.list-view) .card-info {
      padding: 8px !important;
      flex: 1 !important;
      display: flex !important;
      flex-direction: column !important;
      justify-content: space-between !important;
  }

  /* Date & Category (Mobile Grid) - ပြန်ဖော်မည် */
  .grid-container:not(.list-view) .card-meta {
      display: flex !important;
      justify-content: space-between;
      align-items: center;
      margin-top: 5px !important;
      font-size: 0.65rem !important;
  }
  
  /* Badge Size Adjustment */
  .cat-badge {
      padding: 2px 6px !important;
      font-size: 0.6rem !important;
  }
}