body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background-color: #FAFBF6;
  margin: 0;
  padding: 0;
  color: #0F172A;
}

/* === HEADER === */
/* === HEADER ACTIONS (Scoped to header only) === */
header .actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  letter-spacing: 0.5px;
  color: #ffffff;
}


header .actions .btn {
  background-color: white;
  color: #0A4D8C;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}

header .actions .btn:hover {
  background-color: #f0f4fa;
  transform: translateY(-1px);
}

header .actions .btn.secondary {
  background-color: #E0E7EF;
  color: #0A4D8C;
}


/* === FILTER BAR === */
.filters {
  display: flex;
  justify-content: center;
  background: #E9EEF5;
  padding: 0.5rem;
}
.filter {
  border: none;
  background: none;
  margin: 0 0.5rem;
  font-weight: 600;
  cursor: pointer;
  color: #0A4D8C;
}
.filter.active { border-bottom: 2px solid #0A4D8C; }

/* === GALLERY === */
#gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  padding: 0 1rem 2rem;
}

/* === CARD BASE === */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  position: relative;
  text-align: left;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.card img, .card video {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-bottom: 1px solid #eee;
  border-radius: 8px 8px 0 0;
}
.card audio {
  width: 100%;
  display: block;
  margin-top: .5rem;
}

/* === FILE INFO LINE (FIXED ALIGNMENT) === */
.file-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .6rem .8rem;
  font-size: .85rem;
  background: rgba(255,255,255,0.95);
  border-top: 1px solid #eee;
}

.file-meta {
  flex: 1;
  min-width: 0;
}
.file-meta .filename {
  font-weight: 600;
  font-size: .9rem;
  color: #0A4D8C;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.file-meta .details {
  font-size: .75rem;
  color: #666;
}

/* === BUTTONS (CLEAN, CENTERED) === */
.file-info .buttons {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .25s ease;
}
.card:hover .file-info .buttons {
  opacity: 1;
}
.file-info .buttons a,
.file-info .buttons button {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: #0A4D8C;
  cursor: pointer;
  transition: color .2s, transform .1s ease;
}
.file-info .buttons a:hover,
.file-info .buttons button:hover {
  color: #d75d2a;
  transform: scale(1.15);
}

/* === DELETE BTN OVERRIDE === */
.delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #0A4D8C;
}

/* === YOUTUBE ICON === */
.yt-icon {
  width: 28px;
  position: absolute;
  top: 8px;
  left: 8px;
  opacity: 0.8;
}

/* === LIGHTBOX === */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 100;
}
#lightbox img, #lightbox video {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
#lightboxClose {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 2rem;
  cursor: pointer;
}

/* --- LIGHTBOX ICON OVERLAY --- */
.fileTypeIcon {
  position: absolute;
  top: 18px;
  left: 22px;
  font-size: 2.2rem;
  font-weight: 600;
  z-index: 101;
  opacity: 0.95;
  filter: drop-shadow(0 0 8px currentColor);
  user-select: none;
  pointer-events: none;
}
/* === HEADER FIX === */
header {
  background-color: #0A4D8C;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  flex-wrap: wrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

header h1 {
  font-size: 1.6rem;
  margin: 0;
  font-weight: 700;
}

/* === DASHBOARD === */
#dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-tile {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  text-align: center;
  padding: 1.5rem;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.section-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.section-tile span {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.section-tile small {
  color: #555;
  font-weight: 600;
}

/* === TOOLBAR CLEANUP === */
#toolbar {
  background: #E9EEF5;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  border-bottom: 1px solid #d0d7e2;
}
#toolbar .btn {
  background: #fff;
  border: 1px solid #d0d7e2;
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  color: #0A4D8C;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
#toolbar .btn:hover {
  background: #f0f4fa;
}
/* === MODAL VISIBILITY FIX === */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none; /* Always hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none !important;
}

.modal-content {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  width: 320px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.modal-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}
/* === INLINE UPLOAD ZONE === */
.upload-zone {
  background: #f9fafc;
  border: 2px dashed #c9d6e3;
  border-radius: 12px;
  text-align: center;
  padding: 2rem;
  margin: 1.5rem auto;
  width: 90%;
  max-width: 700px;
  transition: background 0.2s, border-color 0.2s;
}

.upload-zone.dragover {
  background: #e8f3ff;
  border-color: #0A4D8C;
}

.upload-zone p {
  color: #0A4D8C;
  font-weight: 500;
  margin: 0.5rem 0 0;
}

.upload-icon {
  font-size: 2rem;
  color: #0A4D8C;
}

/* === PROGRESS BAR === */
.progress-container {
  width: 100%;
  height: 8px;
  background: #e4ebf2;
  border-radius: 4px;
  margin-top: 1rem;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0A4D8C, #3fa9f5);
  transition: width 0.3s ease;
}

/* === TOAST NOTIFICATION === */
.toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: #0A4D8C;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.3s ease;
  transform: translateY(10px);
  z-index: 2000;
  font-weight: 500;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.drop-area {
  border: 2px dashed #ccc;
  padding: 2rem;
  text-align: center;
  border-radius: 10px;
  background: #f8f9fa;
  cursor: pointer;
  transition: all 0.2s ease;
}
.drop-area.dragover {
  background-color: #f0f8ff;
  border-color: #0A4D8C;
}
.upload-status {
  margin-top: 0.5rem;
  font-weight: 600;
  color: #2ecc71;
  text-align: center;
  transition: opacity 0.3s;
}
/* === ACTIVE SECTION VISUALS === */
nav button.active {
  background: var(--orange);
  color: var(--cream);
  border-radius: 8px;
  transition: all .25s ease;
}

/* Optional section-tint feedback */
body[data-section="images"]  { background-color: #fdfaf7; }
body[data-section="videos"]  { background-color: #f8fafc; }
body[data-section="audio"]   { background-color: #faf8fd; }
body[data-section="docs"]    { background-color: #f9f9f9; }
body[data-section="links"]   { background-color: #f7fbff; }

/* === UPLOAD PROGRESS === */
.progress {
  width: 100%;
  height: 8px;
  background: #eee;
  border-radius: 8px;
  overflow: hidden;
  margin-top: .5rem;
}

.bar {
  height: 100%;
  width: 0%;
  background: var(--orange);
  transition: width 0.2s ease;
}

.upload-status {
  margin-top: .5rem;
  font-size: .9rem;
  font-weight: 600;
}
