/* assets/css/app.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #f5f6fa;
  --surface: #ffffff;
  --border:  #e2e5ed;
  --text:    #1a1d23;
  --muted:   #6b7280;
  --accent:  #2563eb;
  --accent-light: #eff6ff;
  --danger:  #dc2626;
  --danger-light: #fef2f2;
  --success: #16a34a;
  --radius:  10px;
  --shadow:  0 1px 4px rgba(0,0,0,.08);
}

body { font-family: 'Segoe UI',system-ui,sans-serif; background:var(--bg); color:var(--text); font-size:14px; min-height:100vh; }

/* ---- NAVBAR ---- */
.navbar {
  display:flex; align-items:center; gap:20px;
  background:var(--surface); border-bottom:1px solid var(--border);
  padding:0 24px; height:56px; position:sticky; top:0; z-index:100;
}
.brand { display:flex; align-items:center; gap:8px; font-weight:700; font-size:17px; color:var(--accent); text-decoration:none; }
.nav-links { display:flex; gap:4px; flex:1; }
.nav-links a { padding:6px 12px; border-radius:6px; color:var(--muted); text-decoration:none; font-size:13px; transition:background .15s,color .15s; }
.nav-links a:hover, .nav-links a.active { background:var(--accent-light); color:var(--accent); }
.nav-user { display:flex; align-items:center; gap:12px; }
.storage-pill { display:flex; flex-direction:column; align-items:flex-end; gap:3px; }
.storage-bar { width:100px; height:4px; background:var(--border); border-radius:2px; overflow:hidden; }
.storage-fill { height:100%; background:var(--accent); border-radius:2px; transition:width .3s; }
.storage-pill span { font-size:11px; color:var(--muted); }
.username { font-size:13px; font-weight:500; }
.btn-logout { font-size:12px; color:var(--muted); text-decoration:none; padding:4px 8px; border-radius:5px; border:1px solid var(--border); transition:all .15s; }
.btn-logout:hover { background:var(--danger-light); color:var(--danger); border-color:var(--danger); }

/* ---- LAYOUT ---- */
.container { max-width:1200px; margin:0 auto; padding:24px; }
.page-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; flex-wrap:wrap; gap:12px; }
.page-title { font-size:20px; font-weight:700; }

/* ---- BREADCRUMB ---- */
.breadcrumb { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.breadcrumb a { color:var(--accent); text-decoration:none; font-size:13px; }
.breadcrumb a:hover { text-decoration:underline; }
.breadcrumb .sep { color:var(--muted); font-size:13px; }
.breadcrumb .current { font-size:13px; color:var(--text); font-weight:500; }

/* ---- TOOLBAR ---- */
.toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.toolbar .spacer { flex:1; }
.search-wrap { position:relative; }
.search-wrap input { padding:7px 10px 7px 32px; border:1px solid var(--border); border-radius:var(--radius); font-size:13px; background:var(--surface); outline:none; width:200px; }
.search-wrap input:focus { border-color:var(--accent); }
.search-wrap svg { position:absolute; left:9px; top:50%; transform:translateY(-50%); color:var(--muted); pointer-events:none; }

/* ---- BUTTONS ---- */
.btn { display:inline-flex; align-items:center; gap:6px; padding:7px 14px; border-radius:var(--radius); border:1px solid var(--border); background:var(--surface); color:var(--text); cursor:pointer; font-size:13px; font-family:inherit; transition:all .15s; text-decoration:none; white-space:nowrap; }
.btn:hover { background:var(--bg); }
.btn-primary { background:var(--accent); color:#fff; border-color:var(--accent); }
.btn-primary:hover { background:#1d4ed8; border-color:#1d4ed8; }
.btn-danger { background:var(--danger); color:#fff; border-color:var(--danger); }
.btn-danger:hover { background:#b91c1c; }
.btn-sm { padding:5px 10px; font-size:12px; }
.btn-icon { width:32px; height:32px; padding:0; justify-content:center; }
.btn svg { width:14px; height:14px; }

/* ---- DROP ZONE ---- */
.drop-zone { border:2px dashed var(--border); border-radius:var(--radius); padding:32px; text-align:center; cursor:pointer; color:var(--muted); margin-bottom:20px; transition:all .2s; }
.drop-zone:hover, .drop-zone.drag-over { border-color:var(--accent); background:var(--accent-light); color:var(--accent); }
.drop-zone svg { display:block; margin:0 auto 10px; }
.drop-zone p { font-size:14px; margin-bottom:4px; }
.drop-zone small { font-size:12px; }

/* ---- FILE GRID ---- */
.file-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:12px; }
.file-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px 12px; text-align:center; cursor:pointer; transition:border-color .15s,box-shadow .15s; position:relative; }
.file-card:hover { border-color:var(--accent); box-shadow:0 2px 8px rgba(37,99,235,.12); }
.file-card.selected { border-color:var(--accent); background:var(--accent-light); }
.file-card .icon { font-size:36px; display:block; margin-bottom:8px; }
.file-card .name { font-size:12px; font-weight:500; word-break:break-word; line-height:1.35; margin-bottom:4px; }
.file-card .meta { font-size:10px; color:var(--muted); }
.file-card .thumb { width:100%; height:80px; object-fit:cover; border-radius:6px; margin-bottom:8px; display:block; }
.file-card .card-actions { display:none; position:absolute; top:6px; right:6px; gap:4px; }
.file-card:hover .card-actions { display:flex; }

/* ---- FILE LIST ---- */
.file-list { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.file-list-header { display:grid; grid-template-columns:1fr 80px 140px 120px; gap:0; padding:8px 14px; border-bottom:1px solid var(--border); font-size:11px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.5px; }
.file-list-row { display:grid; grid-template-columns:1fr 80px 140px 120px; gap:0; padding:10px 14px; border-bottom:1px solid var(--border); align-items:center; transition:background .12s; cursor:pointer; }
.file-list-row:last-child { border-bottom:none; }
.file-list-row:hover { background:var(--bg); }
.file-list-row.selected { background:var(--accent-light); }
.file-list-row .row-name { display:flex; align-items:center; gap:8px; min-width:0; }
.file-list-row .row-name span.icon { font-size:18px; flex-shrink:0; }
.file-list-row .row-name .label { font-size:13px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.file-list-row .row-size, .file-list-row .row-date { font-size:12px; color:var(--muted); }
.file-list-row .row-actions { display:flex; gap:4px; justify-content:flex-end; opacity:0; transition:opacity .15s; }
.file-list-row:hover .row-actions { opacity:1; }

/* ---- VIEW TOGGLE ---- */
.view-toggle { display:flex; border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.view-toggle button { width:32px; height:32px; border:none; background:var(--surface); cursor:pointer; display:flex; align-items:center; justify-content:center; color:var(--muted); transition:all .15s; }
.view-toggle button.active { background:var(--accent-light); color:var(--accent); }

/* ---- MODALS ---- */
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.4); z-index:200; align-items:center; justify-content:center; }
.modal-overlay.open { display:flex; }
.modal { background:var(--surface); border-radius:14px; padding:24px; width:100%; max-width:400px; box-shadow:0 8px 32px rgba(0,0,0,.18); }
.modal h3 { font-size:16px; font-weight:700; margin-bottom:16px; }
.modal label { display:block; font-size:12px; font-weight:600; color:var(--muted); margin-bottom:5px; text-transform:uppercase; letter-spacing:.4px; }
.modal input, .modal select { width:100%; padding:8px 10px; border:1px solid var(--border); border-radius:8px; font-size:13px; margin-bottom:14px; outline:none; font-family:inherit; background:var(--surface); color:var(--text); }
.modal input:focus { border-color:var(--accent); }
.modal-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:4px; }
.share-link { display:flex; gap:6px; margin-top:10px; }
.share-link input { flex:1; font-size:12px; }

/* ---- PREVIEW MODAL ---- */
.preview-modal { max-width:800px; }
.preview-modal img { max-width:100%; max-height:60vh; display:block; margin:0 auto; border-radius:8px; }

/* ---- ALERTS ---- */
.alert { padding:10px 14px; border-radius:8px; font-size:13px; margin-bottom:16px; }
.alert-success { background:#f0fdf4; color:#166534; border:1px solid #bbf7d0; }
.alert-error   { background:var(--danger-light); color:#991b1b; border:1px solid #fecaca; }
.alert-info    { background:var(--accent-light); color:#1e40af; border:1px solid #bfdbfe; }

/* ---- AUTH PAGES ---- */
.auth-page { min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#eff6ff 0%,#f5f6fa 60%); }
.auth-box { background:var(--surface); border:1px solid var(--border); border-radius:16px; padding:36px; width:100%; max-width:400px; box-shadow:0 4px 24px rgba(0,0,0,.08); }
.auth-box .logo { display:flex; align-items:center; gap:10px; justify-content:center; margin-bottom:28px; }
.auth-box .logo svg { color:var(--accent); }
.auth-box .logo span { font-size:22px; font-weight:800; color:var(--accent); }
.auth-box h2 { font-size:18px; font-weight:700; margin-bottom:6px; }
.auth-box p.sub { font-size:13px; color:var(--muted); margin-bottom:22px; }
.form-group { margin-bottom:16px; }
.form-group label { display:block; font-size:12px; font-weight:600; color:var(--muted); margin-bottom:5px; text-transform:uppercase; letter-spacing:.4px; }
.form-group input { width:100%; padding:9px 12px; border:1px solid var(--border); border-radius:8px; font-size:14px; outline:none; font-family:inherit; color:var(--text); }
.form-group input:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(37,99,235,.1); }
.auth-box .btn-primary { width:100%; justify-content:center; padding:10px; font-size:14px; margin-top:4px; }
.auth-link { text-align:center; margin-top:18px; font-size:13px; color:var(--muted); }
.auth-link a { color:var(--accent); text-decoration:none; font-weight:500; }

/* ---- ADMIN TABLE ---- */
table.data-table { width:100%; border-collapse:collapse; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
table.data-table th { background:var(--bg); padding:10px 14px; font-size:11px; font-weight:600; color:var(--muted); text-align:left; text-transform:uppercase; letter-spacing:.5px; border-bottom:1px solid var(--border); }
table.data-table td { padding:10px 14px; font-size:13px; border-bottom:1px solid var(--border); }
table.data-table tr:last-child td { border-bottom:none; }
table.data-table tr:hover td { background:var(--bg); }
.badge { display:inline-block; padding:2px 8px; border-radius:100px; font-size:11px; font-weight:600; }
.badge-admin { background:#fef3c7; color:#92400e; }
.badge-user  { background:var(--accent-light); color:#1e40af; }

/* ---- EMPTY STATE ---- */
.empty-state { text-align:center; padding:56px 20px; color:var(--muted); }
.empty-state .emoji { font-size:48px; margin-bottom:14px; display:block; }
.empty-state p { font-size:15px; }

/* ---- PROGRESS ---- */
.upload-toast { position:fixed; bottom:20px; right:20px; background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:14px 18px; width:260px; box-shadow:0 4px 16px rgba(0,0,0,.12); display:none; z-index:300; }
.upload-toast p { font-size:13px; margin-bottom:8px; }
.upload-toast .bar { height:4px; background:var(--border); border-radius:2px; overflow:hidden; }
.upload-toast .fill { height:100%; background:var(--accent); transition:width .3s; }

/* ---- RESPONSIVE ---- */
@media(max-width:640px) {
  .navbar { padding:0 14px; gap:10px; }
  .nav-links { display:none; }
  .container { padding:14px; }
  .file-grid { grid-template-columns:repeat(auto-fill,minmax(110px,1fr)); gap:8px; }
  .file-list-header, .file-list-row { grid-template-columns:1fr 80px; }
  .file-list-header .h-size, .file-list-header .h-date,
  .file-list-row .row-date, .file-list-row .row-actions { display:none; }
}
