/* ================================================
   Creator Pay Admin - Resources Page Styles
   ================================================ */

/* ================================================
   Base Styles & Variables
   ================================================ */
:root {
  --primary: #667eea;
  --primary-dark: #5a67d8;
  --primary-light: #a5b4fc;
  --secondary: #764ba2;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --bg-card: #ffffff;

  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.35s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.hidden {
  display: none !important;
}

body {
  font-family: "Inter", sans-serif;
  display: flex;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  height: 100vh;
  overflow: hidden;
  color: var(--text-primary);
  line-height: 1.6;
}

/* ================================================
   Sidebar Styles
   ================================================ */
/* ================================================
   Creator Pay Admin - Resources Page Styles
   ================================================ */

/* ================================================
   Base Styles & Variables
   ================================================ */
:root {
  --primary: #667eea;
  --primary-dark: #5a67d8;
  --primary-light: #a5b4fc;
  --secondary: #764ba2;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --bg-card: #ffffff;

  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.35s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.hidden {
  display: none !important;
}

body {
  font-family: "Inter", sans-serif;
  display: flex;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  height: 100vh;
  overflow: hidden;
  color: var(--text-primary);
  line-height: 1.6;
}

/* ================================================
   Sidebar Styles
   ================================================ */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  box-shadow: 4px 0 30px rgba(0, 0, 0, 0.1);
  padding: 10px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 2px solid rgba(59, 130, 246, 0.2);
  z-index: 100;
  flex-shrink: 0;
}

.sidebar h2 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding: 0 30px 30px;
  font-size: 24px;
  text-shadow: none;
  border-bottom: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 2px solid rgba(59, 130, 246, 0.2);
}

.sidebar-header h2 {
  padding: 0;
  border-bottom: none;
  margin: 0;
  white-space: nowrap;
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 2px 6px;
  border-radius: 6px;
  transition:
    background 0.2s,
    color 0.2s;
  box-shadow: none !important;
}

.sidebar-close-btn:hover {
  background: #f1f5f9;
  color: #ef4444;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #64748b;
  padding: 12px 20px 12px 26px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

/* Sidebar user section */
.sidebar-user {
  margin-top: auto;
  padding: 20px;
  border-top: 2px solid #e2e8f0;
  background: #ffffff;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e2e8f0;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.user-details {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-weight: 600;
  color: #1e293b;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  position: fixed;
  top: 16px;
  left: 16px;
}

.mobile-menu-toggle .hamburger {
  width: 100%;
  height: 3px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-normal);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.sidebar-overlay.active {
  display: block;
}

/* Main content area */
.main {
  flex: 1;
  padding: 40px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

@media (max-width: 1024px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .page-header-toggle {
    display: flex;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .sidebar-close-btn {
    display: block;
  }

  .sidebar.active .sidebar-close-btn {
    display: block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .main {
    padding: 20px;
  }
}

@media (min-width: 1025px) {
  .sidebar {
    transform: translateX(0) !important;
  }

  .sidebar-overlay {
    display: none !important;
  }

  .mobile-menu-toggle {
    display: none !important;
  }

  .sidebar-close-btn {
    display: none !important;
  }
}

/* ================================================
   Page Header
   ================================================ */
.page-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 40px;
  border-radius: var(--radius-xl);
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.page-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.page-header::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.2) 0%,
    transparent 70%
  );
  border-radius: 50%;
}

.header-content {
  position: relative;
  z-index: 1;
}

.page-header h1 {
  color: #ffffff;
  display: flex;
  align-items: center;
  /* justify-content: center; */
  font-size: 36px;
  font-weight: 800;
  /* margin-bottom: 8px; */
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-header .subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  display: flex;
  align-items: center;
  margin-bottom: 10px;

  justify-content: center;
  font-weight: 400;
  opacity: 0.95;
}

/* Page header mobile toggle */
.page-header-toggle {
  display: none;
  position: relative;
  z-index: 1001;
}

@media (max-width: 1024px) {
  .page-header-toggle {
    display: flex !important;
    position: relative;
    top: unset;
    left: unset;
    z-index: 1;
  }

  .header-content .page-header-toggle {
    display: flex !important;
    position: static !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    padding: 8px !important;
    border-radius: 10px !important;
    flex-shrink: 0 !important;
    box-shadow: none !important;
    background: rgba(255, 255, 255, 0.25) !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    gap: 5px !important;
  }

  .page-header {
    padding: 24px;
    padding-top: 24px;
  }

  .mobile-menu-toggle.page-header-toggle .hamburger {
    background: white;
  }
}

/* ================================================
   Page Header
   ================================================ */
.page-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 40px;
  border-radius: var(--radius-xl);
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.page-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.page-header::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.2) 0%,
    transparent 70%
  );
  border-radius: 50%;
}

.header-content {
  position: relative;
  z-index: 1;
  display: flex;
  /* justify-content: space-between; */
  align-items: center;
  gap: 16px;
}

.header-content .page-header-toggle {
  display: none;
  flex-shrink: 0;
}

.page-header h1 {
  color: #ffffff;
  font-size: 36px;
  font-weight: 800;
  /* margin-bottom: 8px; */
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-header .subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  font-weight: 400;
  opacity: 0.95;
}

/* Add button hover effect */
.add-btn {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.add-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Resource card hover effect */
.resource-card {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.resource-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* View toggle button effect */
.view-btn {
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.view-btn:hover {
  transform: translateY(-2px);
}

/* Custom select hover effect */
.custom-select {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.custom-select:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Skeleton for custom-select */
.custom-select-skeleton {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  width: clamp(160px, 20%, 260px);
  pointer-events: none;
}

.custom-select-skeleton .sk-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  flex-shrink: 0;
}

.custom-select-skeleton .sk-text {
  height: 14px;
  flex: 1;
  border-radius: 4px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

.custom-select-skeleton .sk-arrow {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  flex-shrink: 0;
}

/* Skeleton for resource rows */
.skeleton-row {
  pointer-events: none;
}

.sk-row-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  flex-shrink: 0;
}

.sk-row-title {
  height: 15px;
  width: 55%;
  border-radius: 4px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

.sk-row-desc {
  height: 12px;
  width: 80%;
  border-radius: 4px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

.sk-row-price {
  width: 56px;
  height: 18px;
  border-radius: 4px;
  margin: 0 12px;
  flex-shrink: 0;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

.sk-row-btn {
  width: 52px;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

/* Empty state hover */
.empty-state {
  transition: transform 0.3s ease;
}

.empty-state:hover {
  transform: translateY(-3px);
}

/* ================================================
   Tab Navigation
   ================================================ */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================================
   Resource Section
   ================================================ */
.resource-section,
#purchasedSection {
  background: #ffffff;
  border-radius: 15px;
  padding: 32px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  margin-top: 30px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title h2 img {
  border-radius: var(--radius-sm);
}

.resource-count {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

/* ================================================
   Add Buttons Group
   ================================================ */
.add-buttons-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.add-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  color: white;
  box-shadow: var(--shadow-md);
}

.add-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.add-btn:active {
  transform: translateY(0);
}

.pdf-btn {
  color: red;
  background-color: white;
  border: 1px solid red;
}

.pdf-btn:hover {
  background: rgb(249, 178, 178);
}

.excel-btn {
  color: green;
  background-color: white;
  border: 1px solid rgb(3, 144, 3);
}

.excel-btn:hover {
  background: rgb(175, 252, 175);
}

.exam-btn {
  color: orange;
  background-color: white;
  border: 1px solid orange;
}

.exam-btn:hover {
  background: rgb(248, 222, 173);
}

.freelance-btn {
  color: purple;
  background-color: white;
  border: 1px solid purple;
}

.freelance-btn:hover {
  background: rgb(249, 153, 249);
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* ================================================
   Custom Dropdown
   ================================================ */
.resource-filter {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.custom-select {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-light);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  justify-content: center;
  transition: all var(--transition-normal);
  width: 20%;
}

.custom-select:hover {
  border-color: var(--primary);
  background: white;
}

.custom-select .select-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.custom-select span {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

.custom-select .arrow {
  color: var(--text-muted);
  font-size: 12px;
  transition: transform var(--transition-fast);
  /* flex-shrink: 0; */
  margin-left: 4px;
}

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  min-width: 220px;
  z-index: 100;
  display: none;
  overflow: hidden;
}

.dropdown.active {
  display: block;
  animation: dropdownFade 0.2s ease;
}

@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 500;
  color: var(--text-primary);
}

.dropdown div:hover {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1) 0%,
    rgba(118, 75, 162, 0.1) 100%
  );
  color: var(--primary);
}

.dropdown div img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
}

/* View Toggle */
.view-toggle {
  display: flex;
  gap: 8px;
  margin-right: auto;
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-light);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.view-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.view-btn.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-color: var(--primary);
  display: none;
  color: white;
}

.view-btn svg {
  width: 16px;
  height: 16px;
}

/* Hide any table elements if they exist */
.resource-grid table,
.resource-grid thead,
.resource-grid tbody,
.resource-grid th,
.resource-grid td,
.resource-grid tr {
  display: none !important;
}

/* Ensure grid view is always used */
.resource-grid > * {
  display: block;
}

/* Hide list view elements */
.resource-list,
.resource-row,
.resource-cell {
  display: none !important;
}

/* ================================================
   Empty State
   ================================================ */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-icon {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--bg-light) 0%, #e2e8f0 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 48px;
}

.empty-icon img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* ================================================
   Modal Styles
   ================================================ */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.3s ease;
}

.modal.active {
  display: flex;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideIn 0.3s ease;
  box-shadow: var(--shadow-xl);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-content .close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-content .close:hover {
  background: var(--bg-light);
  color: var(--text-primary);
}

.modal-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  padding-right: 40px;
}

/* ================================================
   Form Styles
   ================================================ */
form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea {
  padding: 14px 18px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  transition: all var(--transition-normal);
  background: var(--bg-light);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

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

button[type="submit"] {
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  margin-top: 8px;
}

button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

button[type="submit"]:active {
  transform: translateY(0);
}

/* ================================================
   Auth Modal
   ================================================ */
.auth-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.auth-modal.active {
  display: flex;
}

.auth-modal-content {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 48px;
  width: 90%;
  max-width: 440px;
  position: relative;
  animation: modalSlideIn 0.3s ease;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.auth-modal-content .close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-modal-content .close:hover {
  color: var(--text-primary);
}

.auth-modal-content h2 {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.auth-modal-content p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.toggle-form {
  text-align: center;
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.toggle-form a {
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}

.toggle-form a:hover {
  text-decoration: underline;
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

.error-message.show {
  display: block;
  animation: shake 0.4s ease;
}

.success-message {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

.success-message.show {
  display: block;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-8px);
  }

  75% {
    transform: translateX(8px);
  }
}

/* ================================================
   Mobile Menu Toggle
   ================================================ */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.mobile-menu-toggle .hamburger {
  width: 100%;
  height: 3px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-normal);
}

@media (max-width: 1024px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .page-header-toggle {
    display: flex !important;
  }
}

/* ================================================
   Sidebar Overlay
   ================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ================================================
   Responsive Design
   ================================================ */
@media (max-width: 1024px) {
  .page-header {
    padding: 32px 24px;
  }

  .page-header h1 {
    font-size: 28px;
  }

  .resource-section {
    padding: 24px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .add-buttons-group {
    width: 100%;
  }

  .add-btn {
    flex: 1;
    justify-content: center;
    min-width: calc(50% - 6px);
  }
}

@media (max-width: 768px) {
  .page-header {
    padding: 24px 20px;
    margin-bottom: 20px;
  }

  .page-header h1 {
    font-size: 24px;
  }

  .page-header .subtitle {
    display: none;
    font-size: 14px;
  }

  .resource-section {
    padding: 20px;
    border-radius: var(--radius-lg);
  }

  .section-title h2 {
    font-size: 20px;
  }

  .add-buttons-group {
    flex-direction: column;
  }

  .add-btn {
    width: 100%;
    justify-content: center;
  }

  .resource-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .modal-content {
    padding: 24px;
    margin: 16px;
  }

  .auth-modal-content {
    padding: 32px 24px;
  }
}

@media (max-width: 480px) {
  .page-header h1 {
    font-size: 22px;
  }

  .section-title {
    /* flex-direction: column;
     align-items: flex-start; */
    gap: 8px;
  }

  .resource-count {
    align-self: flex-start;
  }
}

/* ================================================
   Upload Progress
   ================================================ */
#uploadProgress {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1) 0%,
    rgba(118, 75, 162, 0.1) 100%
  );
  color: var(--primary);
  padding: 16px;
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 600;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

/* ================================================
   Last File Info
   ================================================ */
.last-file-info {
  background: var(--bg-light);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

/* ================================================
   View Modal Content
   ================================================ */
#viewContent p {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

#viewContent p:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

#viewContent strong {
  color: var(--text-primary);
  font-weight: 600;
}

#viewContent span {
  color: var(--text-secondary);
}

/* ================================================
   Utility Classes
   ================================================ */
.hidden {
  display: none !important;
}

/* ================================================
   Animations
   ================================================ */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════════════
   SITE VIEW - PUBLIC RESOURCES TABLE (Added for site-view.html)
   ═══════════════════════════════════════════════════════════ */

/* Table Container for Site View */
.table-container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-bottom: 40px;
}

.resources-table {
  width: 100%;
  border-collapse: collapse;
}

.resources-table thead {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.resources-table thead th {
  padding: 18px 20px;
  text-align: left;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.resources-table thead th:first-child {
  width: 60px;
  text-align: center;
}

.resources-table thead th:last-child {
  width: 150px;
  text-align: center;
}

.resources-table tbody tr {
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.2s ease;
  cursor: pointer;
}

.resources-table tbody tr:hover {
  background: #f9fafb;
  transform: scale(1.005);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.resources-table tbody td {
  padding: 20px;
  vertical-align: middle;
}

/* Serial Number */
.resources-table tbody td:first-child {
  text-align: center;
  font-weight: 700;
  color: #667eea;
  font-size: 18px;
}

/* Resource Info */
.resource-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.resource-icon {
  flex-shrink: 0;
}

.resource-icon img {
  width: 55px;
  height: 55px;
  object-fit: contain;
  border-radius: 12px;
  border: 2px solid #f3f4f6;
}

.resource-details {
  flex: 1;
}

.resource-type {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.15),
    rgba(118, 75, 162, 0.15)
  );
  color: #667eea;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.resource-title {
  font-weight: 700;
  font-size: 17px;
  color: #1a1a2e;
  margin-bottom: 6px;
  line-height: 1.3;
}

.resource-desc {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Seller Info */
.seller-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.seller-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.seller-name {
  font-weight: 600;
  color: #374151;
  font-size: 15px;
}

/* Price */
.price {
  font-size: 22px;
  font-weight: 900;
  color: #1a1a2e;
  text-align: center;
}

/* Action Buttons */
.action-cell {
  text-align: center;
}

.btn-buy {
  padding: 12px 28px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-buy:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-purchased {
  padding: 12px 28px;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: not-allowed;
  opacity: 0.8;
}

/* Skeleton Loader for Site View */
.skeleton-loader {
  padding: 40px;
}

.skeleton-line {
  height: 20px;
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 12px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Filter Section for Site View */
.filter-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 12px 20px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #374151;
}

.filter-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 4px;
}

.filter-btn:hover {
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-2px);
}

.filter-btn.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-color: transparent;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-box i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.search-box input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Pagination for Site View */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 60px;
}

.pagination button {
  padding: 10px 16px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #374151;
}

.pagination button:hover:not(:disabled) {
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-2px);
}

.pagination button.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-color: transparent;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Mobile Responsive for Site View Table */
@media (max-width: 768px) {
  .filter-section {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-tabs {
    justify-content: center;
  }

  .search-box {
    max-width: 100%;
  }

  .table-container {
    border-radius: 0;
    box-shadow: none;
  }
}

/* ROW */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  padding: 16px 18px;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* MAIN LEFT SECTION */
.table-title {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 12px;
}

/* ICON */
.icon {
  font-size: 22px;
}

/* TEXT BLOCK */
.table-title h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.table-title p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #64748b;
}

/* PRICE */
.price {
  margin-left: auto;
  /* push to right */
  margin-right: 20px;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}

/* ACTIONS */
.actions {
  display: flex;
  gap: 8px;
}

/* BUTTONS */
.actions button {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

/* COLORS */
.btn-view {
  color: #2563eb;
  border: 1px solid #2563eb;
  background: #fff;
}

.btn-edit {
  color: #f59e0b;
  border: 1px solid #f59e0b;
  background: #fff;
}

.btn-delete {
  color: #ef4444;
  border: 1px solid #ef4444;
  background: #fff;
}

/* HOVER */
.row:hover {
  background: #f8fafc;
}

.actions button:hover {
  opacity: 0.8;
}

/* ================================================
   MODAL & FORM - PERFECT STYLES
   ================================================ */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal[style*="flex"] {
  display: flex !important;
}

.modal-content {
  background: #ffffff;
  border-radius: 20px;
  padding: 36px 32px 32px;
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  animation: modalIn 0.28s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-content .close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 50%;
  background: #f1f5f9;
  transition: all 0.2s ease;
  line-height: 1;
}

.modal-content .close:hover {
  background: #fee2e2;
  color: #ef4444;
}

.modal-content h2 {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 24px;
  padding-right: 36px;
  line-height: 1.3;
}

/* Form inputs */
#resourceForm,
#editForm {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#resourceForm input,
#resourceForm textarea,
#editForm input,
#editForm textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: #1e293b;
  background: #f8fafc;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}

#resourceForm input:focus,
#resourceForm textarea:focus,
#editForm input:focus,
#editForm textarea:focus {
  border-color: #667eea;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
}

#resourceForm input::placeholder,
#resourceForm textarea::placeholder,
#editForm input::placeholder,
#editForm textarea::placeholder {
  color: #94a3b8;
}

#resourceForm textarea,
#editForm textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

#resourceForm input[type="file"],
#editForm input[type="file"] {
  padding: 10px 14px;
  cursor: pointer;
  color: #64748b;
  font-size: 13px;
  background: #f8fafc;
}

#resourceForm input[type="file"]::-webkit-file-upload-button,
#editForm input[type="file"]::-webkit-file-upload-button {
  padding: 7px 14px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 10px;
  transition: opacity 0.2s;
}

#resourceForm input[type="file"]::-webkit-file-upload-button:hover,
#editForm input[type="file"]::-webkit-file-upload-button:hover {
  opacity: 0.85;
}

#resourceForm button[type="submit"],
#editForm button[type="submit"] {
  padding: 14px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-top: 4px;
  letter-spacing: 0.3px;
}

#resourceForm button[type="submit"]:hover,
#editForm button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

#uploadProgress {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1),
    rgba(118, 75, 162, 0.1)
  );
  color: #667eea;
  padding: 13px 16px;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  border: 2px dashed rgba(102, 126, 234, 0.3);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.65;
  }
}

.last-file-info {
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 13px;
}

/* View modal content */
#viewContent p {
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  color: #475569;
  display: flex;
  gap: 8px;
}

#viewContent p:last-child {
  border-bottom: none;
}

#viewContent strong {
  color: #1e293b;
  font-weight: 600;
  min-width: 90px;
  flex-shrink: 0;
}

/* Mobile */
@media (max-width: 480px) {
  .modal-content {
    padding: 28px 20px 24px;
    border-radius: 16px;
  }

  .modal-content h2 {
    font-size: 18px;
  }
}

/* ================================================
   RESOURCE GRID - MOBILE ROW FIX
   ================================================ */

.resource-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  padding: 16px 18px;
  border-radius: 12px;
  margin-bottom: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  border: 1px solid #f1f5f9;
  /* gap: 12px; */
  transition: box-shadow 0.2s ease;
}

.row:hover {
  background: #f8fafc;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.12);
}

.table-title {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 12px;
  min-width: 0;
}

.table-title .icon img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 10px;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
}

.table-title > div {
  min-width: 0;
}

.table-title h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-title p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row .price {
  font-size: 16px;
  font-weight: 700;
  color: #667eea;
  white-space: nowrap;
  margin: 0 12px;
  flex-shrink: 0;
}

.actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.actions button {
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-view {
  color: #2563eb;
  border: 1.5px solid #2563eb;
  background: #fff;
}
.btn-edit {
  color: #f59e0b;
  border: 1.5px solid #f59e0b;
  background: #fff;
}
.btn-delete {
  color: #ef4444;
  border: 1.5px solid #ef4444;
  background: #fff;
}

.btn-view:hover {
  background: #2563eb;
  color: #fff;
}
.btn-edit:hover {
  background: #f59e0b;
  color: #fff;
}
.btn-delete:hover {
  background: #ef4444;
  color: #fff;
}

/* ── MOBILE ── */
@media (max-width: 640px) {
  .row {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .table-title {
    width: 100%;
  }

  .table-title h4 {
    white-space: normal;
    font-size: 15px;
  }

  .table-title p {
    white-space: normal;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .row .price {
    margin: 0;
    font-size: 18px;
  }

  .actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }

  .actions button {
    width: 100%;
    padding: 9px 6px;
    font-size: 13px;
    text-align: center;
  }

  /* ── Skeleton row mobile fix ── */
  .skeleton-row {
    gap: 10px;
  }

  .skeleton-row .table-title {
    width: 100%;
  }

  .sk-row-price {
    margin: 0;
    width: 70px;
    height: 16px;
  }

  .skeleton-row .actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }

  .sk-row-btn {
    width: 100%;
    height: 34px;
  }

  /* ── Skeleton select mobile fix ── */
  .custom-select-skeleton {
    width: 60%;
    min-width: unset;
  }
}

/* Skeleton for custom-select */
.custom-select-skeleton {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  width: clamp(160px, 20%, 260px);
  pointer-events: none;
}

.custom-select-skeleton .sk-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  flex-shrink: 0;
}

.custom-select-skeleton .sk-text {
  height: 14px;
  flex: 1;
  border-radius: 4px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

.custom-select-skeleton .sk-arrow {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  flex-shrink: 0;
}

/* Skeleton for resource rows */
.skeleton-row {
  pointer-events: none;
}

.sk-row-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  flex-shrink: 0;
}

.sk-row-title {
  height: 15px;
  width: 55%;
  border-radius: 4px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

.sk-row-desc {
  height: 12px;
  width: 80%;
  border-radius: 4px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

.sk-row-price {
  width: 56px;
  height: 18px;
  border-radius: 4px;
  margin: 0 12px;
  flex-shrink: 0;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

.sk-row-btn {
  width: 52px;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

/* Empty state hover */
.empty-state {
  transition: transform 0.3s ease;
}

.empty-state:hover {
  transform: translateY(-3px);
}

/* ================================================
   Tab Navigation
   ================================================ */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================================
   Resource Section
   ================================================ */
.resource-section,
#purchasedSection {
  background: #ffffff;
  border-radius: 15px;
  padding: 32px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  margin-top: 30px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title h2 img {
  border-radius: var(--radius-sm);
}

.resource-count {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

/* ================================================
   Add Buttons Group
   ================================================ */
.add-buttons-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.add-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  color: white;
  box-shadow: var(--shadow-md);
}

.add-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.add-btn:active {
  transform: translateY(0);
}

.pdf-btn {
  color: red;
  background-color: white;
  border: 1px solid red;
}

.pdf-btn:hover {
  background: rgb(249, 178, 178);
}

.excel-btn {
  color: green;
  background-color: white;
  border: 1px solid rgb(3, 144, 3);
}

.excel-btn:hover {
  background: rgb(175, 252, 175);
}

.exam-btn {
  color: orange;
  background-color: white;
  border: 1px solid orange;
}

.exam-btn:hover {
  background: rgb(248, 222, 173);
}

.freelance-btn {
  color: purple;
  background-color: white;
  border: 1px solid purple;
}

.freelance-btn:hover {
  background: rgb(249, 153, 249);
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* ================================================
   Custom Dropdown
   ================================================ */
.resource-filter {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.custom-select {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-light);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  justify-content: center;
  transition: all var(--transition-normal);
  width: 20%;
}

.custom-select:hover {
  border-color: var(--primary);
  background: white;
}

.custom-select .select-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.custom-select span {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

.custom-select .arrow {
  color: var(--text-muted);
  font-size: 12px;
  transition: transform var(--transition-fast);
  /* flex-shrink: 0; */
  margin-left: 4px;
}

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  min-width: 220px;
  z-index: 100;
  display: none;
  overflow: hidden;
}

.dropdown.active {
  display: block;
  animation: dropdownFade 0.2s ease;
}

@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 500;
  color: var(--text-primary);
}

.dropdown div:hover {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1) 0%,
    rgba(118, 75, 162, 0.1) 100%
  );
  color: var(--primary);
}

.dropdown div img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
}

/* View Toggle */
.view-toggle {
  display: flex;
  gap: 8px;
  margin-right: auto;
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-light);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.view-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.view-btn.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-color: var(--primary);
  display: none;
  color: white;
}

.view-btn svg {
  width: 16px;
  height: 16px;
}

/* Hide any table elements if they exist */
.resource-grid table,
.resource-grid thead,
.resource-grid tbody,
.resource-grid th,
.resource-grid td,
.resource-grid tr {
  display: none !important;
}

/* Ensure grid view is always used */
.resource-grid > * {
  display: block;
}

/* Hide list view elements */
.resource-list,
.resource-row,
.resource-cell {
  display: none !important;
}

/* ================================================
   Empty State
   ================================================ */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-icon {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--bg-light) 0%, #e2e8f0 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 48px;
}

.empty-icon img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* ================================================
   Modal Styles
   ================================================ */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.3s ease;
}

.modal.active {
  display: flex;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideIn 0.3s ease;
  box-shadow: var(--shadow-xl);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-content .close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-content .close:hover {
  background: var(--bg-light);
  color: var(--text-primary);
}

.modal-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  padding-right: 40px;
}

/* ================================================
   Form Styles
   ================================================ */
form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea {
  padding: 14px 18px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  transition: all var(--transition-normal);
  background: var(--bg-light);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

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

button[type="submit"] {
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  margin-top: 8px;
}

button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

button[type="submit"]:active {
  transform: translateY(0);
}

/* ================================================
   Auth Modal
   ================================================ */
.auth-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.auth-modal.active {
  display: flex;
}

.auth-modal-content {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 48px;
  width: 90%;
  max-width: 440px;
  position: relative;
  animation: modalSlideIn 0.3s ease;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.auth-modal-content .close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-modal-content .close:hover {
  color: var(--text-primary);
}

.auth-modal-content h2 {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.auth-modal-content p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.toggle-form {
  text-align: center;
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.toggle-form a {
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}

.toggle-form a:hover {
  text-decoration: underline;
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

.error-message.show {
  display: block;
  animation: shake 0.4s ease;
}

.success-message {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

.success-message.show {
  display: block;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-8px);
  }

  75% {
    transform: translateX(8px);
  }
}

/* ================================================
   Mobile Menu Toggle
   ================================================ */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.mobile-menu-toggle .hamburger {
  width: 100%;
  height: 3px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-normal);
}

@media (max-width: 1024px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .page-header-toggle {
    display: flex !important;
  }
}

/* ================================================
   Sidebar Overlay
   ================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ================================================
   Responsive Design
   ================================================ */
@media (max-width: 1024px) {
  .page-header {
    padding: 32px 24px;
  }

  .page-header h1 {
    font-size: 28px;
  }

  .resource-section {
    padding: 24px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .add-buttons-group {
    width: 100%;
  }

  .add-btn {
    flex: 1;
    justify-content: center;
    min-width: calc(50% - 6px);
  }
}

@media (max-width: 768px) {
  .page-header {
    padding: 24px 20px;
    margin-bottom: 20px;
  }

  .page-header h1 {
    font-size: 24px;
  }

  .page-header .subtitle {
    display: none;
    font-size: 14px;
  }

  .resource-section {
    padding: 20px;
    border-radius: var(--radius-lg);
  }

  .section-title h2 {
    font-size: 20px;
  }

  .add-buttons-group {
    flex-direction: column;
  }

  .add-btn {
    width: 100%;
    justify-content: center;
  }

  .resource-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .modal-content {
    padding: 24px;
    margin: 16px;
  }

  .auth-modal-content {
    padding: 32px 24px;
  }
}

@media (max-width: 480px) {
  .page-header h1 {
    font-size: 22px;
  }

  .section-title {
    /* flex-direction: column;
     align-items: flex-start; */
    gap: 8px;
  }

  .resource-count {
    align-self: flex-start;
  }
}

/* ================================================
   Upload Progress
   ================================================ */
#uploadProgress {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1) 0%,
    rgba(118, 75, 162, 0.1) 100%
  );
  color: var(--primary);
  padding: 16px;
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 600;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

/* ================================================
   Last File Info
   ================================================ */
.last-file-info {
  background: var(--bg-light);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

/* ================================================
   View Modal Content
   ================================================ */
#viewContent p {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

#viewContent p:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

#viewContent strong {
  color: var(--text-primary);
  font-weight: 600;
}

#viewContent span {
  color: var(--text-secondary);
}

/* ================================================
   Utility Classes
   ================================================ */
.hidden {
  display: none !important;
}

/* ================================================
   Animations
   ================================================ */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════════════
   SITE VIEW - PUBLIC RESOURCES TABLE (Added for site-view.html)
   ═══════════════════════════════════════════════════════════ */

/* Table Container for Site View */
.table-container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-bottom: 40px;
}

.resources-table {
  width: 100%;
  border-collapse: collapse;
}

.resources-table thead {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.resources-table thead th {
  padding: 18px 20px;
  text-align: left;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.resources-table thead th:first-child {
  width: 60px;
  text-align: center;
}

.resources-table thead th:last-child {
  width: 150px;
  text-align: center;
}

.resources-table tbody tr {
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.2s ease;
  cursor: pointer;
}

.resources-table tbody tr:hover {
  background: #f9fafb;
  transform: scale(1.005);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.resources-table tbody td {
  padding: 20px;
  vertical-align: middle;
}

/* Serial Number */
.resources-table tbody td:first-child {
  text-align: center;
  font-weight: 700;
  color: #667eea;
  font-size: 18px;
}

/* Resource Info */
.resource-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.resource-icon {
  flex-shrink: 0;
}

.resource-icon img {
  width: 55px;
  height: 55px;
  object-fit: contain;
  border-radius: 12px;
  border: 2px solid #f3f4f6;
}

.resource-details {
  flex: 1;
}

.resource-type {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.15),
    rgba(118, 75, 162, 0.15)
  );
  color: #667eea;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.resource-title {
  font-weight: 700;
  font-size: 17px;
  color: #1a1a2e;
  margin-bottom: 6px;
  line-height: 1.3;
}

.resource-desc {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Seller Info */
.seller-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.seller-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.seller-name {
  font-weight: 600;
  color: #374151;
  font-size: 15px;
}

/* Price */
.price {
  font-size: 22px;
  font-weight: 900;
  color: #1a1a2e;
  text-align: center;
}

/* Action Buttons */
.action-cell {
  text-align: center;
}

.btn-buy {
  padding: 12px 28px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-buy:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-purchased {
  padding: 12px 28px;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: not-allowed;
  opacity: 0.8;
}

/* Skeleton Loader for Site View */
.skeleton-loader {
  padding: 40px;
}

.skeleton-line {
  height: 20px;
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 12px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Filter Section for Site View */
.filter-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 12px 20px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #374151;
}

.filter-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 4px;
}

.filter-btn:hover {
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-2px);
}

.filter-btn.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-color: transparent;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-box i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.search-box input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Pagination for Site View */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 60px;
}

.pagination button {
  padding: 10px 16px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #374151;
}

.pagination button:hover:not(:disabled) {
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-2px);
}

.pagination button.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-color: transparent;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Mobile Responsive for Site View Table */
@media (max-width: 768px) {
  .filter-section {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-tabs {
    justify-content: center;
  }

  .search-box {
    max-width: 100%;
  }

  .table-container {
    border-radius: 0;
    box-shadow: none;
  }
}

/* ROW */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  padding: 16px 18px;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* MAIN LEFT SECTION */
.table-title {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 12px;
}

/* ICON */
.icon {
  font-size: 22px;
}

/* TEXT BLOCK */
.table-title h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.table-title p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #64748b;
}

/* PRICE */
.price {
  margin-left: auto;
  /* push to right */
  margin-right: 20px;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}

/* ACTIONS */
.actions {
  display: flex;
  gap: 8px;
}

/* BUTTONS */
.actions button {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}

/* COLORS */
.btn-view {
  color: #2563eb;
  border: 1px solid #2563eb;
  background: #fff;
}

.btn-edit {
  color: #f59e0b;
  border: 1px solid #f59e0b;
  background: #fff;
}

.btn-delete {
  color: #ef4444;
  border: 1px solid #ef4444;
  background: #fff;
}

/* HOVER */
.row:hover {
  background: #f8fafc;
}

.actions button:hover {
  opacity: 0.8;
}

/* ================================================
   MODAL & FORM - PERFECT STYLES
   ================================================ */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal[style*="flex"] {
  display: flex !important;
}

.modal-content {
  background: #ffffff;
  border-radius: 20px;
  padding: 36px 32px 32px;
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  animation: modalIn 0.28s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-content .close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 50%;
  background: #f1f5f9;
  transition: all 0.2s ease;
  line-height: 1;
}

.modal-content .close:hover {
  background: #fee2e2;
  color: #ef4444;
}

.modal-content h2 {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 24px;
  padding-right: 36px;
  line-height: 1.3;
}

/* Form inputs */
#resourceForm,
#editForm {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#resourceForm input,
#resourceForm textarea,
#editForm input,
#editForm textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: #1e293b;
  background: #f8fafc;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}

#resourceForm input:focus,
#resourceForm textarea:focus,
#editForm input:focus,
#editForm textarea:focus {
  border-color: #667eea;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
}

#resourceForm input::placeholder,
#resourceForm textarea::placeholder,
#editForm input::placeholder,
#editForm textarea::placeholder {
  color: #94a3b8;
}

#resourceForm textarea,
#editForm textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

#resourceForm input[type="file"],
#editForm input[type="file"] {
  padding: 10px 14px;
  cursor: pointer;
  color: #64748b;
  font-size: 13px;
  background: #f8fafc;
}

#resourceForm input[type="file"]::-webkit-file-upload-button,
#editForm input[type="file"]::-webkit-file-upload-button {
  padding: 7px 14px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 10px;
  transition: opacity 0.2s;
}

#resourceForm input[type="file"]::-webkit-file-upload-button:hover,
#editForm input[type="file"]::-webkit-file-upload-button:hover {
  opacity: 0.85;
}

#resourceForm button[type="submit"],
#editForm button[type="submit"] {
  padding: 14px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-top: 4px;
  letter-spacing: 0.3px;
}

#resourceForm button[type="submit"]:hover,
#editForm button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

#uploadProgress {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1),
    rgba(118, 75, 162, 0.1)
  );
  color: #667eea;
  padding: 13px 16px;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  border: 2px dashed rgba(102, 126, 234, 0.3);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.65;
  }
}

.last-file-info {
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 13px;
}

/* View modal content */
#viewContent p {
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  color: #475569;
  display: flex;
  gap: 8px;
}

#viewContent p:last-child {
  border-bottom: none;
}

#viewContent strong {
  color: #1e293b;
  font-weight: 600;
  min-width: 90px;
  flex-shrink: 0;
}

/* Mobile */
@media (max-width: 480px) {
  .modal-content {
    padding: 28px 20px 24px;
    border-radius: 16px;
  }

  .modal-content h2 {
    font-size: 18px;
  }
}

/* ================================================
   RESOURCE GRID - MOBILE ROW FIX
   ================================================ */

.resource-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  padding: 16px 18px;
  border-radius: 12px;
  margin-bottom: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  border: 1px solid #f1f5f9;
  /* gap: 12px; */
  transition: box-shadow 0.2s ease;
}

.row:hover {
  background: #f8fafc;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.12);
}

.table-title {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 12px;
  min-width: 0;
}

.table-title .icon img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 10px;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
}

.table-title > div {
  min-width: 0;
}

.table-title h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-title p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row .price {
  font-size: 16px;
  font-weight: 700;
  color: #667eea;
  white-space: nowrap;
  margin: 0 12px;
  flex-shrink: 0;
}

.actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.actions button {
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-view {
  color: #2563eb;
  border: 1.5px solid #2563eb;
  background: #fff;
}
.btn-edit {
  color: #f59e0b;
  border: 1.5px solid #f59e0b;
  background: #fff;
}
.btn-delete {
  color: #ef4444;
  border: 1.5px solid #ef4444;
  background: #fff;
}

.btn-view:hover {
  background: #2563eb;
  color: #fff;
}
.btn-edit:hover {
  background: #f59e0b;
  color: #fff;
}
.btn-delete:hover {
  background: #ef4444;
  color: #fff;
}

/* ── MOBILE ── */
@media (max-width: 640px) {
  .row {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .table-title {
    width: 100%;
  }

  .table-title h4 {
    white-space: normal;
    font-size: 15px;
  }

  .table-title p {
    white-space: normal;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .row .price {
    margin: 0;
    font-size: 18px;
  }

  .actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }

  .actions button {
    width: 100%;
    padding: 9px 6px;
    font-size: 13px;
    text-align: center;
  }

  /* ── Skeleton row mobile fix ── */
  .skeleton-row {
    gap: 10px;
  }

  .skeleton-row .table-title {
    width: 100%;
  }

  .sk-row-price {
    margin: 0;
    width: 70px;
    height: 16px;
  }

  .skeleton-row .actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }

  .sk-row-btn {
    width: 100%;
    height: 34px;
  }

  /* ── Skeleton select mobile fix ── */
  .custom-select-skeleton {
    width: 60%;
    min-width: unset;
  }
}

/* ── Dark mode: empty-icon fix ── */
body.dark-mode .empty-icon {
  background: linear-gradient(135deg, #1e2a3a 0%, #2d3a4a 100%) !important;
  box-shadow: 0 0 0 2px rgba(124, 106, 247, 0.2);
}
body.dark-mode .empty-icon img {
  filter: invert(1) brightness(2);
  border-radius: 0 !important;
}

/* ── Dark mode: empty-cart / inline empty-state img fix ── */
body.dark-mode .empty-state-img {
  filter: invert(1) brightness(2);
}
