/**
 * Portal Styles - Stockholms Golvförening
 * Version: 1.0
 */

/* ===========================
   1. CSS Variables
   =========================== */
:root {
  /* Colors */
  --portal-sidebar-bg: #1C1C1C;
  --portal-sidebar-text: #F5F0E8;
  --portal-main-bg: #EDE7DE;
  --portal-text: #1A1A1A;
  --portal-accent: #D0A843;
  --portal-accent-text: #1A1A1A;
  --portal-muted: #C5BFB3;
  --portal-border: #E0D5C7;
  --portal-card-bg: #FFFFFF;
  
  /* Shadows */
  --portal-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --portal-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --portal-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  
  /* Transitions */
  --portal-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
}

/* ===========================
   2. Reset & Base
   =========================== */
body.portal-page {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--portal-text);
  background: var(--portal-main-bg);
}

body.portal-page * {
  box-sizing: border-box;
}

/* Hide main site navigation and footer on portal pages */
body.portal-page #main-header,
body.portal-page nav#main-header,
body.portal-page footer,
body.portal-page .main-navigation,
body.portal-page .site-header {
  display: none !important;
}

/* ===========================
   3. Layout
   =========================== */
.portal-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.portal-sidebar {
  width: 256px;
  background: var(--portal-sidebar-bg);
  color: var(--portal-sidebar-text);
  position: fixed;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
}

.portal-main {
  flex: 1;
  margin-left: 256px;
  background: var(--portal-main-bg);
  min-height: 100vh;
}

/* Old mobile styles removed - now handled by responsive breakpoints in section 12 */

/* ===========================
   4. Login Page
   =========================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1C1C1C 0%, #3A3A3A 100%);
  padding: 1rem;
}

.login-container {
  width: 100%;
  max-width: 400px;
}

.login-card {
  background: var(--portal-card-bg);
  border-radius: 0.5rem;
  box-shadow: var(--portal-shadow-lg);
  padding: 2rem;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-container {
  margin-bottom: 1.5rem;
}

.logo-container svg,
.logo-container img {
  height: 80px;
  width: auto;
}

.site-logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--portal-text);
}

.login-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--portal-text);
  margin-bottom: 0.5rem;
}

.login-description {
  color: var(--portal-muted);
  font-size: 0.875rem;
}

.login-error {
  background: #fee;
  color: #c33;
  padding: 0.75rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--portal-text);
}

.form-group input {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--portal-border);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: var(--portal-transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--portal-accent);
  box-shadow: 0 0 0 3px rgba(208, 168, 67, 0.1);
}

.forgot-password {
  font-size: 0.875rem;
  color: var(--portal-accent);
  text-decoration: none;
  text-align: right;
  margin-bottom: 0.5rem;
}

.forgot-password:hover {
  text-decoration: underline;
}

.remember-me-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-top: -0.25rem;
}

.remember-me-label {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
  color: var(--portal-text);
  cursor: pointer;
}

.remember-me-label input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--portal-accent);
}

.remember-me-help,
.login-help-text {
  margin: 0;
  font-size: 0.8125rem;
  color: #6b7280;
  line-height: 1.5;
}

.login-help-text {
  margin-top: -0.25rem;
}

.login-support-text {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  color: #4b5563;
  text-align: center;
  line-height: 1.5;
}

.login-support-text a {
  color: var(--portal-accent);
  text-decoration: underline;
}

.btn-primary {
  background: var(--portal-accent);
  color: var(--portal-accent-text);
  padding: 0.625rem 1rem;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--portal-transition);
  width: 100%;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.back-link {
  display: block;
  text-align: center;
  margin-top: 1.5rem;
  color: var(--portal-muted);
  text-decoration: none;
  font-size: 0.875rem;
}

.back-link:hover {
  color: var(--portal-accent);
}

/* ===========================
   5. Sidebar Components
   =========================== */
.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo,
.sidebar-logo-text {
  height: 48px;
  width: auto;
  display: block;
}

/* Make logo SVG smaller in sidebar */
.sidebar-header svg,
.sidebar-header img {
  height: 32px;
  width: auto;
  max-width: 100%;
  display: block;
}

.sidebar-logo-text {
  color: var(--portal-sidebar-text);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--portal-sidebar-text);
  text-decoration: none;
  transition: var(--portal-transition);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--portal-accent);
}

.nav-item.active {
  background: rgba(208, 168, 67, 0.1);
  color: var(--portal-accent);
  border-left: 3px solid var(--portal-accent);
}

.nav-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Dokumentbibliotek – expanderbar sektion */
.nav-docs-wrap .nav-item.menu-item {
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.nav-chevron {
  width: 20px;
  height: 20px;
  margin-left: auto;
  stroke: currentColor;
  fill: none;
  transition: transform 0.2s ease;
}

.nav-item.menu-item.open .nav-chevron {
  transform: rotate(90deg);
}

/* Trädstruktur – kategorier under Dokumentbibliotek */
.docs-tree-content {
  margin-top: 0.25rem;
}

.tree-list {
  margin-left: 1.75rem;
  margin-top: 0.25rem;
  margin-bottom: 0;
  padding-left: 0.75rem;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  list-style: none;
}

.tree-list li {
  margin: 0;
}

.tree-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: var(--portal-transition);
}

.tree-link:hover {
  color: var(--portal-sidebar-text);
  background: rgba(255, 255, 255, 0.05);
}

.tree-link.active {
  background: rgba(208, 168, 67, 0.2);
  color: var(--portal-accent);
  font-weight: 500;
}

.tree-link .tree-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
}

.tree-link .count {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-left: auto;
}

.sidebar-footer {
  flex-shrink: 0;
  padding: 1.25rem 1.5rem 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.375rem;
  color: var(--portal-sidebar-text);
  cursor: pointer;
  width: 100%;
  transition: var(--portal-transition);
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--portal-accent);
  color: var(--portal-accent);
}

.logout-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ===========================
   6. Dashboard
   =========================== */
body.portal-page .dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: block !important;
  visibility: visible !important;
}

body.portal-page .dashboard-header {
  margin-bottom: 2rem;
  display: block !important;
  visibility: visible !important;
}

.rich-content-card {
  border: 1px solid var(--portal-border);
  border-radius: 0.5rem;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  background: var(--portal-card-bg);
}

.rich-content-card.prose p:last-child {
  margin-bottom: 0;
}

body.portal-page .category-title-header {
  display: flex !important;
  align-items: center;
  gap: 1rem;
}

body.portal-page .dashboard-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--portal-text) !important;
  margin-bottom: 0.5rem;
  display: block !important;
}

body.portal-page .dashboard-subtitle {
  font-size: 1.125rem;
  color: rgba(26, 26, 26, 0.7) !important; /* Darker color for better readability */
  display: block !important;
}

.stats-grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 3rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.dashboard-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.dashboard-card-link:hover .stat-card {
  box-shadow: var(--portal-shadow-md);
  border-color: rgba(208, 168, 67, 0.5);
}

.stat-card {
  background: var(--portal-card-bg);
  border-radius: 0.5rem;
  border: 1px solid var(--portal-border);
  padding: 1.5rem;
  display: flex;
  transition: box-shadow 0.2s, border-color 0.2s;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--portal-shadow-sm);
}

.stat-icon-container {
  width: 48px;
  height: 48px;
  border-radius: 0.5rem;
  background: rgba(208, 168, 67, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon {
  width: 24px;
  height: 24px;
  stroke: var(--portal-accent);
  stroke-width: 2;
  fill: none;
}

.stat-content {
  flex: 1;
}

/* Kommande händelser */
.events-section {
  margin-bottom: 3rem;
}

.events-card {
  border: 1px solid var(--portal-border);
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--portal-card-bg);
}

.events-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  font-weight: 600;
  font-size: 1.125rem;
  border-bottom: 1px solid var(--portal-border);
}

.events-card-icon {
  width: 24px;
  height: 24px;
  stroke: var(--portal-accent);
  fill: none;
}

.events-card-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.events-list {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.event-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(224, 213, 199, 0.5);
  transition: border-color 0.15s;
}

.event-item:hover {
  border-color: rgba(208, 168, 67, 0.5);
}

.date-block {
  width: 3rem;
  height: 3.5rem;
  border-radius: 0.5rem;
  background: rgba(208, 168, 67, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.date-block-day {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--portal-accent);
  line-height: 1;
}

.date-block-month {
  font-size: 0.625rem;
  font-weight: 500;
  color: rgba(208, 168, 67, 0.8);
  text-transform: uppercase;
}

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

.event-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.event-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-badge {
  font-size: 0.625rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: var(--portal-muted, #C5BFB3);
  color: var(--portal-text);
  flex-shrink: 0;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--portal-muted, #C5BFB3);
}

.event-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.event-meta-icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
}

.events-empty {
  padding: 1.5rem;
  margin: 0;
  color: var(--portal-muted);
  font-size: 0.9375rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--portal-muted);
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--portal-text);
}

.recent-section {
  background: var(--portal-card-bg);
  border-radius: 0.5rem;
  border: 1px solid var(--portal-border);
  padding: 1.5rem;
  box-shadow: var(--portal-shadow-sm);
}

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

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--portal-text);
}

.view-all-link {
  color: var(--portal-accent);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--portal-transition);
}

.view-all-link:hover {
  text-decoration: underline;
}

/* ===========================
   7. Document Library
   =========================== */
.category-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.category-card {
  background: var(--portal-card-bg);
  border: 1px solid var(--portal-border);
  border-radius: 0.5rem;
  padding: 1.5rem;
  text-decoration: none;
  display: block;
  transition: var(--portal-transition);
  box-shadow: var(--portal-shadow-sm);
}

.category-card:hover {
  transform: scale(1.05);
  box-shadow: var(--portal-shadow-lg);
  border-color: rgba(208, 168, 67, 0.5);
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

body.portal-page .category-icon-container {
  width: 48px;
  height: 48px;
  border-radius: 0.5rem;
  background: rgba(208, 168, 67, 0.1);
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.category-icon {
  width: 24px;
  height: 24px;
  stroke: var(--portal-accent);
  stroke-width: 2;
  fill: none;
}

.category-count {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--portal-muted);
}

.category-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--portal-text);
  margin-bottom: 0.5rem;
}

.category-description {
  font-size: 0.875rem;
  color: var(--portal-muted);
  line-height: 1.5;
}

/* ===========================
   8. Documents
   =========================== */
body.portal-page .document-list {
  display: flex !important;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

body.portal-page .document-card {
  background: var(--portal-card-bg) !important;
  border: 1px solid var(--portal-border) !important;
  border-radius: 0.5rem;
  padding: 1rem;
  display: flex !important;
  align-items: center;
  gap: 1rem;
  transition: var(--portal-transition);
  box-shadow: var(--portal-shadow-sm);
  margin-bottom: 0.5rem;
}

.document-card:hover {
  box-shadow: var(--portal-shadow-md);
}

.document-icon-container {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  background: rgba(208, 168, 67, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.document-icon {
  width: 20px;
  height: 20px;
  stroke: var(--portal-accent);
  stroke-width: 2;
  fill: none;
}

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

.document-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--portal-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.document-meta {
  font-size: 0.875rem;
  color: var(--portal-muted);
}

.document-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.document-download {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--portal-text);
  transition: var(--portal-transition);
  text-decoration: none;
  flex-shrink: 0;
}

.document-download:hover {
  background: rgba(208, 168, 67, 0.1);
  color: var(--portal-accent);
}

.document-preview-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  background: transparent;
  border: none;
  color: var(--portal-text);
  cursor: pointer;
  transition: var(--portal-transition);
  flex-shrink: 0;
  padding: 0;
}

.document-preview-btn:hover {
  background: rgba(208, 168, 67, 0.1);
  color: var(--portal-accent);
}

.preview-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.download-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.document-delete {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  background: transparent;
  border: none;
  color: var(--portal-muted);
  cursor: pointer;
  transition: var(--portal-transition);
  flex-shrink: 0;
  padding: 0;
}

.document-delete:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.delete-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ===========================
   9. Search
   =========================== */
body.portal-page .search-container {
  margin-bottom: 1.5rem;
  position: relative;
  display: block !important;
}

.search-input {
  width: 100%;
  padding: 0.625rem 0.75rem 0.625rem 2.5rem;
  border: 1px solid var(--portal-border);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background: var(--portal-card-bg);
  transition: var(--portal-transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--portal-accent);
  box-shadow: 0 0 0 3px rgba(208, 168, 67, 0.1);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  stroke: var(--portal-muted);
  pointer-events: none;
}

/* ===========================
   10. Utilities
   =========================== */
.btn-ghost {
  background: transparent;
  border: none;
  color: var(--portal-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.375rem;
  transition: var(--portal-transition);
}

.btn-ghost:hover {
  background: rgba(208, 168, 67, 0.1);
  color: var(--portal-accent);
}

body.portal-page .back-button {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  color: var(--portal-text);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  transition: var(--portal-transition);
  font-weight: 500;
}

.back-button:hover {
  color: var(--portal-accent);
}

.back-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Upload Document Button */
body.portal-page .upload-document-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  background: var(--portal-accent);
  color: var(--portal-accent-text);
  padding: 0.625rem 1rem;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--portal-transition);
  margin-bottom: 1.5rem;
}

body.portal-page .upload-document-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.upload-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--portal-muted);
}

/* ===========================
   11. Upload Modal & Dropzone
   =========================== */
.upload-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.upload-modal {
  background: var(--portal-card-bg);
  border-radius: 0.5rem;
  box-shadow: var(--portal-shadow-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

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

.upload-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--portal-text);
}

.upload-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--portal-muted);
  transition: var(--portal-transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-modal-close:hover {
  color: var(--portal-text);
}

.upload-modal-close svg {
  width: 24px;
  height: 24px;
}

.upload-modal-body {
  padding: 1.5rem;
}

/* Dropzone */
.upload-dropzone {
  border: 2px dashed var(--portal-border);
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--portal-transition);
  margin-bottom: 1.5rem;
}

.upload-dropzone:hover {
  border-color: var(--portal-accent);
  background: rgba(208, 168, 67, 0.05);
}

.upload-dropzone.dragging {
  border-color: var(--portal-accent);
  background: rgba(208, 168, 67, 0.1);
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  color: var(--portal-muted);
}

.dropzone-title {
  font-weight: 500;
  color: var(--portal-text);
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.dropzone-subtitle {
  font-size: 0.875rem;
  color: var(--portal-muted);
  margin-bottom: 0.5rem;
}

.dropzone-info {
  font-size: 0.75rem;
  color: var(--portal-muted);
  margin-top: 0.5rem;
}

/* Selected File Info */
.selected-file-info {
  background: var(--portal-main-bg);
  border: 1px solid var(--portal-border);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.file-info-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.file-icon {
  width: 24px;
  height: 24px;
  color: var(--portal-accent);
  flex-shrink: 0;
}

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

.file-name {
  font-weight: 500;
  color: var(--portal-text);
  margin: 0 0 0.25rem 0;
  word-break: break-word;
}

.file-size {
  font-size: 0.875rem;
  color: var(--portal-muted);
  margin: 0;
}

.remove-file-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--portal-muted);
  transition: var(--portal-transition);
  flex-shrink: 0;
}

.remove-file-btn:hover {
  color: var(--portal-text);
}

/* Form Fields */
.form-field {
  margin-bottom: 1.5rem;
}

.form-field label {
  display: block;
  font-weight: 500;
  color: var(--portal-text);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.form-field input,
.form-field select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--portal-border);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: var(--portal-text);
  background: var(--portal-card-bg);
  transition: var(--portal-transition);
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--portal-accent);
  box-shadow: 0 0 0 3px rgba(208, 168, 67, 0.1);
}

/* Error Message */
.upload-error {
  background: #fee;
  border: 1px solid #fcc;
  color: #c33;
  padding: 0.75rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

/* Progress Bar */
.upload-progress {
  margin-bottom: 1.5rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--portal-border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: var(--portal-accent);
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 0.875rem;
  color: var(--portal-muted);
  text-align: center;
  margin: 0;
}

/* Modal Actions */
.upload-modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

.btn-cancel {
  background: var(--portal-card-bg);
  color: var(--portal-text);
  border: 1px solid var(--portal-border);
  padding: 0.625rem 1.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--portal-transition);
}

.btn-cancel:hover {
  background: var(--portal-main-bg);
}

.btn-upload {
  background: var(--portal-accent);
  color: var(--portal-accent-text);
  border: none;
  padding: 0.625rem 1.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--portal-transition);
}

.btn-upload:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-upload:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===========================
   12. Delete Confirmation Modal
   =========================== */
.delete-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  padding: 1rem;
}

.delete-modal {
  background: var(--portal-card-bg);
  border-radius: 0.5rem;
  box-shadow: var(--portal-shadow-lg);
  width: 100%;
  max-width: 400px;
}

.delete-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--portal-border);
}

.delete-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--portal-text);
}

.delete-modal-body {
  padding: 1.5rem;
}

.delete-modal-body p {
  margin: 0 0 1rem 0;
  color: var(--portal-text);
  line-height: 1.6;
}

.delete-modal-body p:last-child {
  margin-bottom: 0;
}

.delete-modal-body strong {
  font-weight: 600;
  color: var(--portal-text);
}

.delete-warning {
  font-size: 0.875rem;
  color: var(--portal-muted);
}

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

.btn-cancel-delete {
  background: var(--portal-card-bg);
  color: var(--portal-text);
  border: 1px solid var(--portal-border);
  padding: 0.625rem 1.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--portal-transition);
}

.btn-cancel-delete:hover:not(:disabled) {
  background: var(--portal-main-bg);
}

.btn-confirm-delete {
  background: #dc2626;
  color: white;
  border: none;
  padding: 0.625rem 1.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--portal-transition);
}

.btn-confirm-delete:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-confirm-delete:disabled,
.btn-cancel-delete:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Responsive utilities */
@media (max-width: 640px) {
  .dashboard-title {
    font-size: 1.875rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .category-title-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===========================
   12. Mobile Navigation
   =========================== */

/* Mobile Header - visible only on mobile */
.portal-mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--portal-sidebar-bg);
  z-index: 99998; /* Just below admin bar (99999) */
  padding: 0 1rem;
  align-items: center;
  justify-content: space-between;
}

/* Account for WordPress admin bar */
.admin-bar .portal-mobile-header {
  top: 32px; /* Desktop admin bar height */
}

@media screen and (max-width: 782px) {
  .admin-bar .portal-mobile-header {
    top: 46px; /* Mobile admin bar height */
  }
}

.portal-mobile-header .mobile-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.portal-mobile-header .mobile-logo img,
.portal-mobile-header .mobile-logo svg {
  height: 32px;
  width: 32px;
  display: block;
}

.portal-mobile-header .mobile-logo-text {
  color: var(--portal-sidebar-text);
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1.2;
}

/* Remove padding from buttons on portal pages */
body.portal-page button,
body.portal-page input[type="button"],
body.portal-page input[type="reset"],
body.portal-page input[type="submit"] {
  padding: 0 !important;
}

/* Hamburger Button */
.hamburger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  color: #FFFFFF !important; /* White color for visibility on dark background */
  cursor: pointer;
  border-radius: 0.375rem;
  transition: var(--portal-transition);
  padding: 0 !important; /* Explicitly remove padding */
}

.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hamburger-btn svg {
  width: 24px;
  height: 24px;
  stroke: #FFFFFF !important; /* Ensure SVG stroke is white */
  color: #FFFFFF !important;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99997; /* Below mobile header but above content */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.admin-bar .mobile-menu-overlay {
  top: 32px; /* Account for admin bar */
}

@media screen and (max-width: 782px) {
  .admin-bar .mobile-menu-overlay {
    top: 46px; /* Mobile admin bar */
  }
}

.mobile-menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Mobile Menu Sheet */
.mobile-menu-sheet {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 256px;
  background: var(--portal-sidebar-bg);
  z-index: 99998; /* Same as mobile header */
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.admin-bar .mobile-menu-sheet {
  top: 32px; /* Account for admin bar */
}

@media screen and (max-width: 782px) {
  .admin-bar .mobile-menu-sheet {
    top: 46px; /* Mobile admin bar */
  }
}

.mobile-menu-sheet.open {
  transform: translateX(0);
}

/* Sidebar content inside mobile menu sheet */
.mobile-menu-sheet .portal-sidebar {
  position: static;
  width: 100%;
  height: auto;
  min-height: 100%;
  transform: none;
  display: flex !important;
  flex-direction: column;
  visibility: visible !important;
}

/* Ensure menu items are visible in mobile menu */
.mobile-menu-sheet .sidebar-nav {
  display: block !important;
  visibility: visible !important;
}

.mobile-menu-sheet .nav-item {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: var(--portal-sidebar-text) !important;
}

.mobile-menu-sheet .sidebar-footer {
  display: block !important;
  visibility: visible !important;
}

.mobile-menu-sheet .logout-btn {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: var(--portal-sidebar-text) !important;
}

/* Prevent body scroll when menu is open */
body.menu-open {
  overflow: hidden;
}

/* PDF preview modal */
.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.preview-modal.is-hidden {
  display: none !important;
}

.preview-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.preview-modal-content {
  position: relative;
  max-width: 56rem;
  width: 95vw;
  height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--portal-card-bg, #fff);
  border-radius: 0.5rem;
  box-shadow: var(--portal-shadow-lg);
  overflow: hidden;
}

.preview-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--portal-border, #E0D5C7);
  flex-shrink: 0;
}

.preview-modal-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-modal-close {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 0.375rem;
  color: var(--portal-text, #1A1A1A);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  transition: background 0.15s;
}

.preview-modal-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

.preview-modal-body {
  flex: 1;
  min-height: 0;
  padding: 1rem 1.5rem;
}

.pdf-iframe {
  width: 100%;
  height: 100%;
  min-height: 300px;
  border: 1px solid var(--portal-border, #E0D5C7);
  border-radius: 0.375rem;
  background: #fff;
}

/* Ensure WordPress admin bar stays at top */
#wpadminbar {
  position: fixed !important;
  top: 0 !important;
  z-index: 99999 !important;
}

/* Responsive breakpoints */
@media (max-width: 1023px) {
  .portal-mobile-header {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .portal-sidebar {
    display: none !important;
  }
  
  .portal-main {
    margin-left: 0 !important;
    padding-top: 64px !important; /* Header height */
  }
  
  /* Account for admin bar + mobile header */
  .admin-bar .portal-main {
    padding-top: 96px !important; /* 32px admin bar + 64px header */
  }
  
  @media screen and (max-width: 782px) {
    .admin-bar .portal-main {
      padding-top: 110px !important; /* 46px admin bar + 64px header */
    }
  }
}

@media (min-width: 1024px) {
  .portal-mobile-header,
  .mobile-menu-overlay,
  .mobile-menu-sheet {
    display: none !important;
  }
  
  .portal-sidebar {
    display: flex !important;
  }
  
  .portal-main {
    margin-left: 256px;
    padding-top: 0;
  }
}

