/* ── Huntsland Data Room Styles ───────────────────────────────────────────── */
/* Branded to match huntsland.co.uk                                           */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Huntsland brand colours */
  --primary: #091E20;
  --primary-light: #0C2B2D;
  --accent: #1CD166;
  --accent-hover: #2EDD76;
  --accent-dark: #17BF5F;
  --bg: #0C2B2D;
  --bg-card: #0F3436;
  --bg-elevated: #113A3D;
  --text: #E2EDE8;
  --text-light: #96AEA4;
  --text-muted: #7A9488;
  --text-dim: #516B60;
  --border: rgba(28, 209, 102, 0.1);
  --border-strong: rgba(28, 209, 102, 0.25);
  --danger: #d63031;
  --success: #1CD166;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.4);

  /* Fonts */
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-weight: 500;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
}

/* ── Logo ────────────────────────────────────────────────────────────────── */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo .pin-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.logo .pin-icon.lg {
  width: 32px;
  height: 32px;
}

.logo-text {
  color: var(--text-dim);
}

.logo-text span {
  color: var(--accent);
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.header {
  background: var(--primary);
  color: var(--text);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.header .logo {
  font-size: 1.35rem;
}

.header .subtitle {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
  margin-left: 2.5rem;
}

/* ── Auth Screen ─────────────────────────────────────────────────────────── */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--primary);
}

.auth-card {
  background: var(--bg-card);
  padding: 3rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.auth-card .logo {
  font-size: 1.8rem;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.auth-card .tagline {
  font-family: var(--font-body);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 2.5rem;
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
input, textarea, select {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  font-weight: 500;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--primary);
  color: var(--text);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(28, 209, 102, 0.07);
}

/* ── Buttons (matching huntsland.co.uk) ──────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--accent);
  color: var(--primary);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(28, 209, 102, 0.25);
}

.btn-danger {
  background: var(--danger);
  color: white;
  border-radius: 8px;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-success {
  background: var(--success);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(28, 209, 102, 0.05);
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.78rem;
}

.btn .arrow {
  transition: transform 0.2s;
}

.btn:hover .arrow {
  transform: translateX(3px);
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.card-body {
  padding: 1.25rem 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* ── Room Card ───────────────────────────────────────────────────────────── */
.room-card .meta {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.room-card .meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.room-card .client-name {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.88rem;
}

.room-card .description {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  line-height: 1.6;
}

.share-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
  overflow: hidden;
  border: 1px solid var(--border);
}

.share-link:hover {
  background: var(--primary-light);
  border-color: var(--border-strong);
  color: var(--accent);
}

.share-link code {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-body);
  font-size: 0.78rem;
}

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 30, 32, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-strong);
  width: 100%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 1.2rem;
  font-weight: 800;
}

.modal-body {
  padding: 1.5rem;
}

.modal-body .form-group {
  margin-bottom: 1.25rem;
}

.modal-body label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 0.5rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  transition: color 0.2s;
}

.close-btn:hover {
  color: var(--text);
}

/* ── Drop Zone ───────────────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  background: rgba(28, 209, 102, 0.02);
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(28, 209, 102, 0.06);
}

.drop-zone .icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.drop-zone p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.drop-zone .browse-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}

/* ── File List ───────────────────────────────────────────────────────────── */
.file-list {
  list-style: none;
}

.file-item {
  display: flex;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  gap: 0.85rem;
}

.file-item:last-child {
  border-bottom: none;
}

.file-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.file-icon.pdf { background: rgba(214, 48, 49, 0.12); }
.file-icon.doc { background: rgba(28, 209, 102, 0.08); }
.file-icon.img { background: rgba(46, 221, 118, 0.08); }
.file-icon.vid { background: rgba(162, 155, 254, 0.12); }
.file-icon.zip { background: rgba(253, 203, 110, 0.12); }
.file-icon.other { background: rgba(150, 174, 164, 0.1); }

.file-info {
  flex: 1;
  min-width: 0;
}

.file-info .name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-info .details {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
}

.file-actions {
  display: flex;
  gap: 0.4rem;
}

/* ── Upload Progress ─────────────────────────────────────────────────────── */
.upload-progress {
  margin-top: 1.25rem;
}

.progress-bar {
  height: 6px;
  background: var(--primary);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
}

/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 1.25rem;
}

.empty-state p {
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ── Toolbar ─────────────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.toolbar h2 {
  font-size: 1.4rem;
  font-weight: 800;
}

/* ── Toast ────────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-elevated);
  color: var(--text);
  padding: 0.85rem 1.25rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
  max-width: 350px;
}

.toast.success { background: var(--accent); color: var(--primary); border-color: var(--accent); }
.toast.error { background: var(--danger); color: white; border-color: var(--danger); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ── Client Room Page ────────────────────────────────────────────────────── */
.room-header {
  background: var(--primary);
  color: var(--text);
  padding: 4rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.room-header h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.room-header .room-desc {
  color: var(--text-light);
  max-width: 550px;
  margin: 0 auto;
  line-height: 1.7;
  font-size: 0.95rem;
}

.room-header .powered-by {
  margin-top: 2rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.download-all-bar {
  background: var(--bg-card);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.download-all-bar .file-count {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .container { padding: 1.5rem 1rem; }
  .grid { grid-template-columns: 1fr; }
  .header { padding: 1rem; }
  .toolbar { flex-direction: column; gap: 1rem; align-items: stretch; }
  .card-footer { flex-direction: column; }
  .share-link { width: 100%; }
  .modal { margin: 1rem; }
  .room-header { padding: 3rem 1.5rem; }
  .room-header h1 { font-size: 1.8rem; }
}
