* {
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background: linear-gradient(135deg, #0d1b2a 0%, #1b263b 100%);
  min-height: 100vh;
  color: #ffffff;
  margin: 0;
}

/* Sidebar Styling - Blue Glass */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 280px;
  background: rgba(13, 27, 42, 0.95);
  backdrop-filter: blur(25px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: 10px 0 40px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 210, 255, 0.2) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(0, 210, 255, 0.2);
  border-radius: 10px;
}

.main-content {
  margin-left: 280px;
  padding: 3rem;
  transition: margin 0.3s ease-in-out;
}

/* Logo & Branding */
.branding h1 {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 3rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Navigation */
.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin-bottom: 1rem;
}

.sidebar-nav a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 1rem 1.2rem;
  border-radius: 12px;
}

.sidebar-nav a:hover,
.sidebar-nav li.active a {
  color: #ffffff;
  background: linear-gradient(to right, rgba(0, 123, 255, 0.5), transparent);
  transform: translateX(10px);
}

/* Custom Folder/Category list */
.folder-list {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.folder-list h3 {
  font-size: 0.75rem;
  color: rgba(0, 210, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 2rem;
  font-weight: 800;
}

.folder-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.folder-list li {
  margin-bottom: 0.8rem;
}

.folder-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.8rem 1.2rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 15px;
  transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.folder-link.active,
.folder-link:hover {
  color: #fff;
  background: rgba(0, 210, 255, 0.1);
  border-color: rgba(0, 210, 255, 0.2);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.folder-link .icon {
  font-size: 1.1rem;
  opacity: 0.8;
}

.gallery-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(0, 123, 255, 0.05);
}

.gallery-header h2 {
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.5rem 0;
}

.gallery-header p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.1rem;
}

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

.gallery-item-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.gallery-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  overflow: hidden;
  backdrop-filter: blur(15px);
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.gallery-card:hover {
  transform: translateY(-12px) scale(1.02);
  border-color: rgba(0, 210, 255, 0.4);
  box-shadow: 0 30px 60px rgba(0, 210, 255, 0.2);
}

.card-media {
  position: relative;
  padding-top: 72%;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}

.card-media img,
.card-media video,
.card-media .text-card-preview,
.card-media .video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Edit Overlay */
.hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s;
  z-index: 5;
}

.quick-actions a img,
.quick-actions form img,
.quick-actions button img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.hover-overlay span {
  background: #00d2ff;
  color: #0d1b2a;
  padding: 1rem 2rem;
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 2px;
  transform: translateY(20px);
  transition: all 0.4s;
}

.card-content {
  padding: 2.2rem;
}

.card-content h4 {
  margin: 0 0 1.2rem 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.content-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.folder-badge {
  background: rgba(0, 210, 255, 0.1);
  color: #00d2ff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border: 1px solid rgba(0, 210, 255, 0.1);
}

.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.1);
  padding: 1.2rem;
  border-radius: 50%;
  backdrop-filter: blur(8px);
  opacity: 0.9;
  color: #fff;
  font-size: 1.5rem;
}

/* Text Card Preview */
.text-card-preview {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.text-card-preview .icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  opacity: 0.5;
}
.text-card-preview .excerpt {
  font-style: italic;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.8;
  font-size: 0.95rem;
}

/* Content Footer */
.content-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.folder-badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.75rem;
  color: #00d2ff;
  font-weight: 700;
}

/* Password Form Styling */
.password-wrapper {
  height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
  background: linear-gradient(135deg, #001a33 0%, #003366 100%);
}

.glass-container {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3.5rem;
  border-radius: 40px;
  text-align: center;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 50px 100px rgba(0, 0, 0, 0.5);
  animation: fadeIn 1s cubic-bezier(0.19, 1, 0.22, 1);
}

.user-avatar {
  width: 150px;
  height: 150px;
  margin: 0 auto 2rem;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.glass-container p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.2rem;
  line-height: 1.6;
  margin-bottom: 2.5rem;
  font-weight: 600;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

input[type="password"] {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  padding: 1.2rem;
  border-radius: 12px;
  color: #ffffff;
  width: 100%;
  margin-bottom: 2rem;
  font-size: 1.2rem;
  text-align: center;
  outline: none;
  transition: all 0.3s;
}

input[type="password"]:focus {
  border-color: #00d2ff;
  background: rgba(255, 255, 255, 0.1);
}

.submit-btn {
  background: linear-gradient(to right, var(--primary), var(--secondary));
  border: none;
  padding: 1.2rem 3rem;
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  width: 100%;
  transition: transform 0.3s;
}

.submit-btn:hover {
  transform: scale(1.05);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    top: auto;
    bottom: 0;
    flex-direction: row;
    padding: 0;
    justify-content: flex-start;
    align-items: center;
    border-right: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-nav a:hover,
  .sidebar-nav li.active a {
    transform: translateY(-3px); /* Fix overlap: use vertical lift instead of right-shift on mobile */
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  } /* Hide scrollbar for mobile clean look */

  .branding,
  .folder-list {
    display: none;
  }

  .sidebar-nav {
    width: 100%;
    min-width: max-content;
  }

  .sidebar-nav ul {
    display: flex;
    padding: 0.8rem 1rem;
    gap: 10px;
  }

  .sidebar-nav li {
    margin-bottom: 0;
  }

  .sidebar-nav a {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
  }

  .main-content {
    margin-left: 0;
    padding: 1.5rem;
    margin-bottom: 90px;
  }
}

/* Dashboard / Command Center Styling */
.dashboard-wrap {
  padding: 2rem 0;
  max-width: 1200px;
  margin: 0 auto;
}

.dash-header {
  margin-bottom: 4rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.05);
}

.dash-header h1 {
  font-size: 4rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -3px;
  background: linear-gradient(to right, #ffffff, #00d2ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  margin-bottom: 4rem;
}

.dash-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 40px;
  padding: 3.5rem;
  backdrop-filter: blur(20px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

.dash-card h3 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 3rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #00d2ff;
}

/* Forms in Dashboard */
.form-group {
  margin-bottom: 2rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 1rem;
  color: #00d2ff;
  letter-spacing: 1.5px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 2px solid rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 15px;
  color: #fff;
  font-family: "Poppins", sans-serif;
  outline: none;
  transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  font-size: 0.95rem;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #00d2ff;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 20px rgba(0, 210, 255, 0.1);
}

/* Buttons */
.btn {
  padding: 1.2rem 2.5rem;
  border-radius: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  border: none;
  display: inline-block;
  text-align: center;
}

.btn.primary {
  background: #00d2ff;
  color: #0d1b2a;
}
.btn.secondary {
  background: #fff;
  color: #0d1b2a;
}
.btn.delete-btn {
  background: rgba(255, 77, 77, 0.1);
  color: #ff4d4d;
  padding: 0.6rem 1.2rem;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 77, 77, 0.1);
}
.btn.delete-btn:hover {
  background: #ff4d4d;
  color: #fff;
  transform: translateY(-3px);
}

.btn:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 210, 255, 0.3);
}

/* Avatar Preview */
.current-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 2.5rem;
  border: 4px solid #00d2ff;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.current-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Table Styling */
.items-list {
  margin-top: 3rem;
}

.items-table-wrap {
  overflow-x: auto;
  border-radius: 25px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.items-table th,
.items-table td {
  padding: 1.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.items-table th {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.02);
}

.items-table tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

/* Alerts */
.alert {
  padding: 2rem;
  border-radius: 20px;
  margin-bottom: 3rem;
  text-align: center;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.alert.success {
  background: rgba(0, 255, 128, 0.1);
  color: #00ff80;
  border: 1px solid rgba(0, 255, 128, 0.2);
}

@media (max-width: 992px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .dash-header h1 {
    font-size: 2.5rem;
  }
  .dash-card {
    padding: 2rem 1.2rem;
    border-radius: 30px;
  }
}

/* Mobile Gallery Scaling */
@media (max-width: 600px) {
  .main-content { padding: 1rem; }
  .dash-card { padding: 1.5rem 1rem; border-radius: 20px; }
  .form-group { margin-bottom: 1.2rem; }
  .btn.btn-full { padding: 1rem 1.5rem; font-size: 0.85rem; }
  
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .gallery-header h2 { font-size: 1.8rem; }
  .gallery-filters-bar { gap: 1.5rem; }
  .filter-group-row { flex-direction: column; width: 100%; gap: 15px; }
  .filter-item { width: 100%; }
  .gallery-type-filter { overflow-x: auto; padding-bottom: 5px; width: 100%; -webkit-overflow-scrolling: touch; }
  .type-btn { white-space: nowrap; padding: 0.7rem 1.2rem; }
  
  .card-content h4 { font-size: 1.3rem; }
  .action-btn { width: 38px; height: 38px; } /* Slightly larger for touch */
}
