/* =============================================
   File: assets/css/app.css
   System: FileVault — Glassmorphism Orange Theme
   Author: AI Pairoj (BUGpairoj Group)
   ============================================= */

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

/* ===== CSS Variables ===== */
:root {
  --orange:       #FF6B35;
  --orange2:      #F7931E;
  --gold:         #FFD23F;
  --grad-orange:  linear-gradient(135deg, #FF6B35, #F7931E);
  --grad-full:    linear-gradient(135deg, #FF6B35, #F7931E, #FFD23F);

  /* Dark mode (default) */
  --bg:           #0f0f1a;
  --bg2:          #13131f;
  --bg3:          #1a1a2e;
  --card:         rgba(255,255,255,0.06);
  --card-border:  rgba(255,255,255,0.09);
  --text:         #f0f0f5;
  --text-muted:   #8888aa;
  --input-bg:     rgba(255,255,255,0.07);
  --input-border: rgba(255,255,255,0.12);
  --sidebar-w:    220px;
  --topbar-h:     60px;
  --radius:       10px;
  --shadow:       0 4px 24px rgba(0,0,0,0.4);
}
[data-theme="light"] {
  --bg:           #f4f4f8;
  --bg2:          #ffffff;
  --bg3:          #eaeaf0;
  --card:         rgba(255,255,255,0.85);
  --card-border:  rgba(0,0,0,0.07);
  --text:         #1a1a2e;
  --text-muted:   #6666880;
  --input-bg:     rgba(0,0,0,0.04);
  --input-border: rgba(0,0,0,0.12);
  --shadow:       0 4px 24px rgba(0,0,0,0.1);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Prompt', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ===== Layout ===== */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}
.main-area {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s;
}
.page-content {
  flex: 1;
  padding: 24px;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--card-border);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 200;
  transition: transform 0.3s;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--card-border);
}
.logo-icon { font-size: 24px; }
.logo-name {
  font-size: 17px;
  font-weight: 600;
  background: var(--grad-orange);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-sub { font-size: 10px; color: var(--text-muted); }
.sidebar-nav { padding: 12px 0; flex: 1; }
.nav-section {
  font-size: 10px;
  color: var(--text-muted);
  padding: 10px 16px 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.2s;
}
.nav-item:hover  { background: rgba(255,107,53,0.07); color: var(--text); }
.nav-item.active { background: rgba(255,107,53,0.12); color: var(--orange); border-left-color: var(--orange); }
.nav-item i { font-size: 16px; width: 18px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: rgba(255,107,53,0.2);
  color: var(--orange);
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 20px;
}
.storage-box {
  margin: 12px;
  background: rgba(255,107,53,0.08);
  border: 1px solid rgba(255,107,53,0.2);
  border-radius: var(--radius);
  padding: 12px;
}
.storage-label { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.storage-bar   { height: 5px; background: rgba(255,255,255,0.1); border-radius: 3px; margin-bottom: 5px; }
.storage-fill  { height: 100%; background: var(--grad-orange); border-radius: 3px; transition: width 0.5s; }
.storage-text  { font-size: 11px; color: var(--orange); font-weight: 500; }

/* ===== Topbar ===== */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: var(--bg2);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-title { font-size: 15px; font-weight: 500; flex: 1; }
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}
.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 7px 12px;
  width: 240px;
}
.search-icon  { color: var(--text-muted); font-size: 15px; }
.search-input { background: none; border: none; outline: none; color: var(--text); font-size: 13px; width: 100%; font-family: inherit; }
.search-input::placeholder { color: var(--text-muted); }
.btn-upload {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--grad-orange);
  border: none;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.btn-upload:hover { opacity: 0.9; }
.theme-btn {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-muted);
  width: 36px; height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.theme-btn:hover { color: var(--orange); border-color: var(--orange); }
.user-menu { position: relative; cursor: pointer; }
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--grad-orange);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff;
}
.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  min-width: 180px;
  padding: 8px 0;
  box-shadow: var(--shadow);
  z-index: 999;
}
.user-dropdown.show { display: block; }
.user-dropdown .user-name { padding: 6px 14px; font-weight: 500; font-size: 13px; }
.user-dropdown .user-role { padding: 0 14px 8px; font-size: 11px; color: var(--text-muted); }
.user-dropdown hr { border-color: var(--card-border); margin: 4px 0; }
.user-dropdown a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; font-size: 13px; color: var(--text);
  transition: background 0.2s;
}
.user-dropdown a:hover { background: var(--input-bg); }
.text-danger { color: #F09595 !important; }

/* ===== Flash ===== */
.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  font-size: 13px;
  border-bottom: 1px solid transparent;
}
.flash-success { background: rgba(99,153,34,0.12); border-color: rgba(99,153,34,0.3); color: #97C459; }
.flash-error   { background: rgba(226,75,74,0.12);  border-color: rgba(226,75,74,0.3);  color: #F09595; }
.flash-close   { margin-left: auto; background: none; border: none; color: inherit; cursor: pointer; font-size: 14px; }

/* ===== Cards ===== */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
  backdrop-filter: blur(10px);
}

/* ===== Stat Cards ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
}
.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}
.stat-icon.blue   { background: rgba(55,138,221,0.15); color: #85B7EB; }
.stat-icon.green  { background: rgba(99,153,34,0.15);  color: #97C459; }
.stat-icon.red    { background: rgba(226,75,74,0.15);  color: #F09595; }
.stat-icon.amber  { background: rgba(186,117,23,0.15); color: #EF9F27; }
.stat-icon.purple { background: rgba(127,119,221,0.15);color: #AFA9EC; }
.stat-icon.orange { background: rgba(255,107,53,0.15); color: var(--orange); }
.stat-num   { font-size: 26px; font-weight: 600; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== File Grid ===== */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title { font-size: 14px; font-weight: 500; }
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}
.file-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.file-card:hover { border-color: rgba(255,107,53,0.4); background: rgba(255,107,53,0.05); transform: translateY(-2px); }
.file-thumb {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin-bottom: 10px;
}
.file-thumb.blue   { background: rgba(55,138,221,0.15); color: #85B7EB; }
.file-thumb.green  { background: rgba(99,153,34,0.15);  color: #97C459; }
.file-thumb.red    { background: rgba(226,75,74,0.15);  color: #F09595; }
.file-thumb.amber  { background: rgba(186,117,23,0.15); color: #EF9F27; }
.file-thumb.purple { background: rgba(127,119,221,0.15);color: #AFA9EC; }
.file-thumb.orange { background: rgba(255,107,53,0.15); color: var(--orange); }
.file-name {
  font-size: 12px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 4px;
}
.file-meta   { font-size: 10px; color: var(--text-muted); }
.file-fav {
  position: absolute; top: 10px; right: 10px;
  font-size: 13px; cursor: pointer;
  color: var(--text-muted); transition: color 0.2s;
}
.file-fav.active { color: #FFD23F; }

/* ===== List View ===== */
.file-list { display: flex; flex-direction: column; gap: 6px; }
.file-list-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 14px;
  transition: all 0.2s;
}
.file-list-item:hover { border-color: rgba(255,107,53,0.3); }
.file-list-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.file-list-info { flex: 1; min-width: 0; }
.file-list-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-list-meta { font-size: 11px; color: var(--text-muted); }
.file-list-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ===== View Toggle ===== */
.view-toggle { display: flex; gap: 4px; }
.vt-btn {
  padding: 6px 10px;
  border-radius: 7px;
  background: none;
  border: 1px solid var(--input-border);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}
.vt-btn.active { background: rgba(255,107,53,0.12); border-color: rgba(255,107,53,0.3); color: var(--orange); }

/* ===== Tags/Badges ===== */
.cat-tag {
  display: inline-block;
  font-size: 10px; padding: 2px 8px;
  border-radius: 20px; margin-top: 6px;
  font-weight: 500; border: 1px solid;
}
.cat-tag.blue   { background: rgba(55,138,221,0.12);  border-color: rgba(55,138,221,0.3);  color: #85B7EB; }
.cat-tag.green  { background: rgba(99,153,34,0.12);   border-color: rgba(99,153,34,0.3);   color: #97C459; }
.cat-tag.red    { background: rgba(226,75,74,0.12);   border-color: rgba(226,75,74,0.3);   color: #F09595; }
.cat-tag.amber  { background: rgba(186,117,23,0.12);  border-color: rgba(186,117,23,0.3);  color: #EF9F27; }
.cat-tag.purple { background: rgba(127,119,221,0.12); border-color: rgba(127,119,221,0.3); color: #AFA9EC; }
.cat-tag.orange { background: rgba(255,107,53,0.12);  border-color: rgba(255,107,53,0.3);  color: var(--orange); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  transition: all 0.2s; font-family: inherit;
}
.btn-primary  { background: var(--grad-orange); color: #fff; }
.btn-primary:hover { opacity: 0.88; }
.btn-outline  { background: none; border-color: var(--input-border); color: var(--text); }
.btn-outline:hover { border-color: var(--orange); color: var(--orange); }
.btn-danger   { background: rgba(226,75,74,0.15); border-color: rgba(226,75,74,0.3); color: #F09595; }
.btn-sm       { padding: 5px 10px; font-size: 12px; }
.btn-icon     { padding: 7px; border-radius: 7px; }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.form-control {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.form-control:focus { border-color: var(--orange); }

/* ===== Upload Zone ===== */
.drop-zone {
  border: 2px dashed rgba(255,107,53,0.35);
  border-radius: 14px;
  padding: 40px 20px;
  text-align: center;
  background: rgba(255,107,53,0.03);
  cursor: pointer;
  transition: all 0.2s;
}
.drop-zone.dragover { border-color: var(--orange); background: rgba(255,107,53,0.08); }
.drop-zone-icon  { font-size: 48px; color: var(--orange); margin-bottom: 12px; }
.drop-zone-title { font-size: 16px; font-weight: 500; margin-bottom: 6px; }
.drop-zone-sub   { font-size: 12px; color: var(--text-muted); line-height: 1.7; }
.type-badges     { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

/* Upload Queue */
.queue-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.qi-icon  { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.qi-info  { flex: 1; min-width: 0; }
.qi-name  { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qi-size  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.qi-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.prog-bar { height: 3px; background: rgba(255,255,255,0.08); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }

/* ===== Table ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 14px; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--card-border); }
td { padding: 11px 14px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,0.04); }
tr:hover td { background: rgba(255,107,53,0.04); }
tr:last-child td { border-bottom: none; }

/* ===== Pagination ===== */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }
.page-btn {
  padding: 6px 12px; border-radius: 7px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-muted); font-size: 13px; cursor: pointer;
}
.page-btn.active { background: var(--grad-orange); border-color: var(--orange); color: #fff; }
.page-btn:hover:not(.active) { border-color: var(--orange); color: var(--orange); }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
  display: none;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 24px;
  width: 90%; max-width: 500px;
  box-shadow: var(--shadow);
}
.modal-title  { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ===== Footer ===== */
.site-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--card-border);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* ===== Login Page ===== */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-box {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 36px 32px;
  width: 380px;
  backdrop-filter: blur(20px);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-big { font-size: 40px; display: block; margin-bottom: 6px; }
.login-logo .logo-title { font-size: 22px; font-weight: 600; background: var(--grad-orange); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.login-logo .logo-sub   { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .search-form { width: 160px; }
  .btn-upload span { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-title { display: none; }
}

/* ===== Utilities ===== */
.text-orange  { color: var(--orange); }
.text-muted   { color: var(--text-muted); }
.text-success { color: #97C459; }
.text-danger  { color: #F09595; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-100 { width: 100%; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state i { font-size: 48px; display: block; margin-bottom: 12px; opacity: 0.4; }
