/* Client Portal — Styles */

/* Session Bar */
.session-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: #D4A84B;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 1.5rem;
  font-size: 0.82rem;
  font-weight: 500;
}

.signout-btn {
  color: #000;
  text-decoration: none;
  font-weight: 600;
  padding: 0.2rem 0.75rem;
  border: 1.5px solid rgba(0,0,0,0.3);
  border-radius: 4px;
  transition: background 0.15s;
  white-space: nowrap;
}

.signout-btn:hover {
  background: rgba(0,0,0,0.1);
}

.portal-page {
  padding-top: 32px; /* offset for session bar */
}

.portal-page {
  min-height: 100vh;
  background: #000;
  color: #fff;
  padding-top: 80px;
}

.portal-header {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-header h1 {
  font-size: 2rem;
  color: #fff;
  margin: 0 0 0.4rem;
}

.portal-header .user-email {
  color: #D4A84B;
  font-size: 0.95rem;
}

.portal-section {
  padding: 2.5rem 0;
}

.portal-section + .portal-section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-section h2 {
  font-size: 1.3rem;
  color: #fff;
  margin: 0 0 1.5rem;
  font-weight: 500;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed rgba(212, 168, 75, 0.5);
  border-radius: 8px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: #D4A84B;
  background: rgba(212, 168, 75, 0.05);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #D4A84B;
}

.upload-zone p {
  margin: 0.4rem 0;
  color: rgba(255, 255, 255, 0.8);
}

.upload-zone .upload-hint {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.75rem;
}

.upload-progress {
  margin-top: 1.5rem;
  display: none;
}

.progress-bar-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #D4A84B;
  border-radius: 2px;
  transition: width 0.3s;
  width: 0%;
}

.progress-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.5rem;
  text-align: center;
}

/* Alert messages */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  display: none;
}

.alert.success {
  background: rgba(40, 167, 69, 0.15);
  border: 1px solid rgba(40, 167, 69, 0.4);
  color: #75d88e;
}

.alert.error {
  background: rgba(220, 53, 69, 0.15);
  border: 1px solid rgba(220, 53, 69, 0.4);
  color: #f08090;
}

/* Files List */
.files-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

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

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

.file-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: rgba(212, 168, 75, 0.1);
  border: 1px solid rgba(212, 168, 75, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  color: #D4A84B;
}

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

.file-name {
  color: #fff;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.2rem;
}

.file-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-download,
.btn-delete {
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: opacity 0.2s;
}

.btn-download {
  background: #D4A84B;
  color: #000;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}

.btn-download:hover {
  opacity: 0.85;
}

.btn-delete {
  background: rgba(220, 53, 69, 0.15);
  color: #f08090;
  border: 1px solid rgba(220, 53, 69, 0.3);
}

.btn-delete:hover {
  background: rgba(220, 53, 69, 0.25);
}

.empty-state {
  text-align: center;
  padding: 3rem 0;
  color: rgba(255, 255, 255, 0.35);
}

.empty-state p {
  margin: 0.5rem 0;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #D4A84B;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 0.4rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Admin-specific */
.client-group {
  margin-bottom: 2.5rem;
}

.client-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(212, 168, 75, 0.3);
}

.client-email-label {
  font-size: 1rem;
  color: #D4A84B;
  font-weight: 500;
}

.client-file-count {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
}

.admin-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: #D4A84B;
}

.stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.2rem;
}

@media (max-width: 768px) {
  .file-item {
    flex-wrap: wrap;
  }

  .file-actions {
    width: 100%;
    padding-top: 0.5rem;
  }

  .btn-download,
  .btn-delete {
    flex: 1;
    text-align: center;
  }

  .admin-stats {
    gap: 1rem;
  }
}
