/* ============================================================
   Clay Groot Photography — Transfers
   Stylesheet
   ============================================================ */

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

/* ── Design Tokens ──────────────────────────────────────────────────────────── */

/* Light mode (default) 
:root {
  --bg:         #f5f3f0;
  --bg2:        #ffffff;
  --fg:         #1a1a18;
  --fg2:        #4a4845;
  --accent:     #3d5a80;
  --accent-h:   #2e4460;
  --muted:      #888580;
  --border:     rgba(30,28,26,0.13);
  --glass:      rgba(245,243,240,0.88);
  --green:      #2e6b42;
  --red-bg:     rgba(139,58,58,0.10);
  --red-text:   #b04040;
  --transition: 0.2s ease;
  --row-stripe: rgba(0,0,0,0.018);
  --row-hover:  rgba(0,0,0,0.04);
  --input-bg:   rgba(0,0,0,0.03);
  --nav-bg:     rgba(245,243,240,0.92);
  --topbar-bg:  rgba(245,243,240,0.85);
}
*/

/* Dark mode */
:root {
  --bg:         #111111;
  --bg2:        #1c1c1c;
  --fg:         #f0ede6;
  --fg2:        #c8c4bc;
  --accent:     #3d5a80;
  --accent-h:   #4f70a0;
  --muted:      #888580;
  --border:     rgba(240,237,230,0.13);
  --glass:      rgba(17,17,17,0.78);
  --green:      #4a7c59;
  --red-bg:     rgba(139,58,58,0.28);
  --red-text:   #e88080;
  --transition: 0.2s ease;
  --row-stripe: rgba(255,255,255,0.02);
  --row-hover:  rgba(255,255,255,0.035);
  --input-bg:   rgba(255,255,255,0.04);
  --nav-bg:     rgba(17,17,17,0.92);
  --topbar-bg:  rgba(17,17,17,0.75);
}


/* ── Reset & Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; }
body  {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4,h5 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.2;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-h); }
::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--fg2); }

/* ── Utility ────────────────────────────────────────────────────────────────── */
.text-accent { color: var(--accent); }
.text-muted  { color: var(--muted); }
.text-dim    { color: var(--fg2); }
.text-sm     { font-size: 0.82rem; }
.text-xs     { font-size: 0.72rem; }
.uppercase   { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.68rem; }
.serif       { font-family: 'Cormorant Garamond', serif; }
.hidden      { display: none !important; }
.mt-0        { margin-top: 0; }
.mb-0        { margin-bottom: 0; }

/* ── Navigation ─────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 48px;
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
  min-height: 68px;
  flex-shrink: 0;
}
.nav-logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--fg);
}
/* Invert logos for light mode — they are natively white
.nav-logo img,
.card-logo {
  filter: brightness(0);
}
*/
.nav-logo img,
.card-logo { filter: none; }

.nav-logo img {
  height: 38px;
  width: auto;
  display: block;
}
.nav-back {
  font-size: 0.72rem; color: var(--fg2); letter-spacing: 0.1em;
  text-transform: uppercase; text-decoration: none;
  display: flex; align-items: center; gap: 6px;
  transition: color var(--transition);
}
.nav-back:hover { color: var(--fg); }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 28px;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem; font-weight: 400;
  letter-spacing: 0.12em; text-transform: uppercase;
  border: none; cursor: pointer; border-radius: 2px;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  text-decoration: none; line-height: 1;
}
.btn-primary       { background: var(--accent);  color: #fff; }
.btn-primary:hover { background: var(--accent-h); color: #fff; }
.btn-ghost         { background: transparent; border: 1px solid var(--border); color: var(--fg2); }
.btn-ghost:hover   { border-color: var(--fg2); color: var(--fg); }
.btn-danger        { background: rgba(139,58,58,0.30); color: var(--red-text); border: 1px solid rgba(139,58,58,0.45); }
.btn-danger:hover  { background: rgba(139,58,58,0.55); }
.btn-sm            { padding: 8px 10px; font-size: 0.68rem; }
.btn-block         { width: 100%; }
.btn:disabled      { opacity: 0.4; cursor: not-allowed; }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-group   { margin-bottom: 22px; }
.form-label   {
  display: block;
  font-size: 0.67rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg2); margin-bottom: 8px;
}
.form-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 13px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem; font-weight: 300;
  outline: none; border-radius: 2px;
  transition: border-color var(--transition), background var(--transition);
  appearance: none;
}
.form-input:focus   { border-color: var(--accent); background: rgba(61,90,128,0.08); }
.form-input::placeholder { color: var(--muted); }
.form-error {
  background: var(--red-bg);
  border: 1px solid rgba(139,58,58,0.55);
  color: var(--red-text);
  padding: 12px 16px;
  font-size: 0.83rem;
  border-radius: 2px;
  margin-bottom: 16px;
}
.form-success {
  background: rgba(74,124,89,0.18);
  border: 1px solid rgba(74,124,89,0.45);
  color: #8ed4a0;
  padding: 12px 16px;
  font-size: 0.83rem;
  border-radius: 2px;
  margin-bottom: 16px;
}
.form-hint { font-size: 0.72rem; color: var(--muted); margin-top: 6px; }

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 2px;
}
.card-pad    { padding: 28px 32px; }
.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title  { font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg); }
.card-body   { padding: 24px; }

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 2px;
  font-size: 0.63rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 400; min-width: max-content;
}
.badge-green  { background: rgba(74,124,89,0.15);  color: var(--green); border: 1px solid rgba(74,124,89,0.35); }
.badge-accent { background: rgba(61,90,128,0.15);  color: var(--accent); border: 1px solid rgba(61,90,128,0.35); }
.badge-muted  { background: var(--row-stripe); color: var(--muted); border: 1px solid var(--border); }
.badge-red    { background: var(--red-bg); color: var(--red-text); border: 1px solid rgba(139,58,58,0.35); }
@media (prefers-color-scheme: dark) {
  .badge-green { color: #8ed4a0; }
}
.dot          { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-green    { background: #8ed4a0; }
.dot-accent   { background: var(--accent); }
.dot-muted    { background: var(--muted); }
.dot-red      { background: var(--red-text); }

/* ── Tables ─────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; padding: 11px 18px;
  font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); font-weight: 400; white-space: nowrap;
  border-bottom: 1px solid var(--border);
  background: var(--row-stripe);
}
/* Pin column widths so the table doesn't reflow */
thead th:nth-child(1) { min-width: 130px; }          /* Filename    */
thead th:nth-child(2) { min-width: 160px; }          /* Email       */
thead th:nth-child(3) { width: 70px;  }              /* Size        */
thead th:nth-child(4) { width: 90px;  }              /* Uploaded    */
thead th:nth-child(5) { width: 90px;  }              /* Expires     */
thead th:nth-child(6) { width: 110px; }              /* Downloaded  */
thead th:nth-child(7) { width: 160px; }              /* Note        */
thead th:nth-child(8) { width: 110px; }              /* Actions     */

tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--row-hover); }
tbody td { padding: 10px 15px; font-size: 0.83rem; color: var(--fg2); vertical-align: middle; min-width: 100px; }
td.td-primary { color: var(--fg); font-size: 0.875rem; font-weight: 500; }
td.td-warn    { color: var(--accent); }

/* Note cell — truncate long notes, show edit button inline */
td.td-note  { max-width: 180px; }
.note-preview {
  display: inline-block; max-width: 120px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--fg2); font-size: 0.8rem; vertical-align: middle;
}
.note-empty { color: var(--muted); vertical-align: middle; }

/* ── Storage Bar ────────────────────────────────────────────────────────────── */
.storage-bar-track {
  height: 4px; background: var(--border);
  border-radius: 2px; overflow: hidden;
}
.storage-bar-fill {
  height: 100%; border-radius: 2px;
  background: var(--accent);
  transition: width 0.6s ease;
}
.storage-bar-fill.warn     { background: var(--accent); }
.storage-bar-fill.critical { background: var(--red-text); }

/* ── Drop Zone ──────────────────────────────────────────────────────────────── */
.drop-zone {
  border: 1px dashed var(--border);
  border-radius: 2px; padding: 40px 24px;
  text-align: center; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(61,90,128,0.08);
}
.drop-icon { font-size: 2rem; margin-bottom: 10px; opacity: 0.45; }
.drop-text { font-size: 0.88rem; color: var(--fg2); margin-bottom: 4px; }
.drop-hint { font-size: 0.72rem; color: var(--muted); }

/* ── Progress Bar ───────────────────────────────────────────────────────────── */
.upload-progress { margin-top: 16px; display: none; }
.upload-progress.visible { display: block; }
.upload-progress-bar {
  height: 3px; background: var(--border); border-radius: 2px;
  overflow: hidden; margin-bottom: 8px;
}
.upload-progress-fill {
  height: 100%; background: var(--accent); border-radius: 2px;
  transition: width 0.3s ease; width: 0%;
}
.upload-progress-text { font-size: 0.72rem; color: var(--fg2); text-align: center; }

/* ── Admin Layout ───────────────────────────────────────────────────────────── */
.admin-layout { display: flex; min-height: calc(100vh - 68px); }
.admin-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 28px 0;
  /* Stick sidebar so it doesn't scroll with content */
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  overflow-y: auto;
}
.sidebar-section-label {
  font-size: 0.58rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted); padding: 0 22px; margin: 20px 0 6px;
  display: block;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 22px;
  font-size: 0.78rem; color: var(--fg2);
  text-decoration: none; letter-spacing: 0.04em;
  transition: color var(--transition), background var(--transition);
  border-left: 2px solid transparent;
}
.sidebar-link:hover  { color: var(--fg); background: var(--row-hover); }
.sidebar-link.active { color: var(--fg); background: rgba(61,90,128,0.18); border-left-color: var(--accent); }
.sidebar-link svg    { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.75; }

.admin-main { flex: 1; min-width: 0; overflow-x: auto; }
.admin-topbar {
  padding: 18px 36px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  z-index: 10;
}
.admin-topbar h1 { font-size: 1.6rem; color: var(--fg); }
.admin-content   { padding: 32px 36px 60px; }

/* ── Stats Grid ─────────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 28px; }
.stat-card  { background: var(--bg2); border: 1px solid var(--border); border-radius: 2px; padding: 20px 22px; }
.stat-label { font-size: 0.63rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.stat-value { font-family: 'Cormorant Garamond', serif; font-size: 2.1rem; color: var(--fg); line-height: 1; }
.stat-value.warn { color: var(--accent); }
.stat-value.good { color: #8ed4a0; }

/* ── Client Portal ──────────────────────────────────────────────────────────── */
.portal-hero {
  min-height: calc(100vh - 68px);
  background:
    linear-gradient(160deg,
      rgba(10,21,32,0.82) 0%,
      rgba(17,17,17,0.72) 50%,
      rgba(17,17,17,0.92) 100%
    ),
    linear-gradient(160deg, #0a1520 0%, #1a2a3a 50%, #111 100%);
  background-image: url('../assets/login-bg.jpg');
  background-size: cover;
  background-position: center;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 24px;
  text-align: center;
}
.portal-eyebrow {
  font-size: 0.66rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.portal-heading { font-size: 3rem; color: var(--fg); margin-bottom: 10px; }
.portal-sub     { font-size: 0.9rem; color: var(--fg2); margin-bottom: 48px; max-width: 380px; }
.portal-card {
  width: 100%; max-width: 420px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 40px;
}
.portal-card-title { margin-bottom: 5px; color: var(--fg); }
.portal-card-sub   { font-size: 0.82rem; color: var(--fg2); margin-bottom: 28px; }
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ── File Cards ─────────────────────────────────────────────────────────────── */
.files-section  { background: var(--bg); }
.files-subheader {
  background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 22px 40px;
  display: flex; align-items: center; justify-content: space-between;
}
.files-subheader-info { font-size: 0.76rem; color: var(--fg2); }
.files-subheader-info strong { color: var(--fg); }
.files-container { max-width: 1000px; margin: 0 auto; padding: 48px 40px 80px; }
.files-eyebrow   { font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.files-heading   { font-size: 2.4rem; margin-bottom: 32px; color: var(--fg); }
.file-grid       { display: grid; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); gap: 18px; }
.file-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 2px; padding: 26px;
  transition: border-color var(--transition);
}
.file-card:hover { border-color: var(--fg2); }
.file-card-icon {
  width: 46px; height: 46px;
  background: rgba(61,90,128,0.18);
  border: 1px solid rgba(61,90,128,0.35);
  border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; color: var(--accent-h);
}
.file-card-name   {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.08rem; color: var(--fg); margin-bottom: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-card-meta   { font-size: 0.75rem; color: var(--fg2); margin-bottom: 3px; }
.file-card-expiry { font-size: 0.7rem; color: var(--muted); margin-bottom: 12px; }
.file-card-expiry.expiry-soon { color: var(--accent); }
.file-card-note {
  font-size: 0.78rem;
  color: var(--fg2);
  background: var(--row-stripe);
  border-left: 2px solid var(--accent);
  border-radius: 3px;
  padding: 7px 10px;
  margin-bottom: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

/* ── Empty State ────────────────────────────────────────────────────────────── */
.empty-state        { text-align: center; padding: 80px 40px; }
.empty-state-icon   { font-size: 2.8rem; opacity: 0.18; margin-bottom: 16px; }
.empty-state h3     { font-size: 1.6rem; color: var(--fg2); margin-bottom: 8px; }
.empty-state p      { font-size: 0.85rem; color: var(--muted); }

/* ── Admin Login ────────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
  background:
      linear-gradient(160deg,
        rgba(10, 21, 32, 0.82) 0%,
        rgba(17, 17, 17, 0.72) 50%,
        rgba(17, 17, 17, 0.92) 100%),
      linear-gradient(160deg, #0a1520 0%, #1a2a3a 50%, #111 100%);
  background-image: url('../assets/login-bg.jpg');
  background-size: cover;
  background-position: center;
}
.login-card {
  width: 100%; max-width: 370px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 15px; 
  padding: 48px 40px;
  text-align: center;
}
.login-icon {
  width: 54px; height: 54px;
  border: 1px solid var(--border); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px; color: var(--accent-h);
}
.login-card h2  { font-size: 1.7rem; margin-bottom: 4px; color: var(--fg); }
.login-card p   { font-size: 0.8rem; color: var(--fg2); margin-bottom: 32px; }
.login-footer   { margin-top: 20px; font-size: 0.72rem; color: var(--muted); }
.login-footer a { color: var(--muted); }
.login-footer a:hover { color: var(--fg2); }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .admin-sidebar { display: none; }
  .admin-topbar, .admin-content { padding-left: 20px; padding-right: 20px; }
  .nav { padding: 0 20px; }
  .files-subheader, .files-container { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 540px) {
  .portal-heading { font-size: 2.2rem; }
  .portal-card { padding: 28px 22px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
