  @import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg-main: #0a0c12;
  --sidebar-bg: #11141d;
  --card-bg: #181b26;
  --border-color: rgba(255, 255, 255, 0.08);
  --accent-purple: #c084fc;
  --accent-pink: #f472b6;
  --accent-cyan: #38bdf8;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}

/* Splash Screen Animation */
.splash-screen {
  position: fixed;
  inset: 0;
  background-color: #06080d;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.splash-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.splash-logo {
  width: 70px;
  height: 70px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: #fff;
  box-shadow: 0 0 35px rgba(192, 132, 252, 0.6);
  margin-bottom: 20px;
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 25px rgba(192, 132, 252, 0.5); }
  50% { transform: scale(1.08); box-shadow: 0 0 45px rgba(244, 114, 182, 0.8); }
  100% { transform: scale(1); box-shadow: 0 0 25px rgba(192, 132, 252, 0.5); }
}

.splash-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.splash-title span { color: var(--accent-pink); }

.splash-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 6px;
  margin-bottom: 30px;
}

.loader-bar {
  width: 180px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.loader-progress {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-pink));
  animation: loadProgress 1.8s ease-in-out forwards;
}

@keyframes loadProgress {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* App Container */
.app-container {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 0 15px rgba(192, 132, 252, 0.4);
}

.sidebar-brand h2 { font-size: 1.3rem; font-weight: 800; }
.sidebar-brand h2 span { color: var(--accent-pink); }

.menu-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-secondary);
  letter-spacing: 1.2px;
  margin-bottom: 12px;
  padding-left: 8px;
}

.folder-list { list-style: none; }

.folder-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  margin-bottom: 6px;
  transition: all 0.25s ease;
}

.folder-item .count {
  margin-left: auto;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 10px;
}

.folder-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.folder-item.active {
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.18), rgba(244, 114, 182, 0.18));
  color: #fff;
  border: 1px solid rgba(192, 132, 252, 0.3);
  box-shadow: 0 4px 15px rgba(192, 132, 252, 0.15);
}

.folder-item.active i { color: var(--accent-pink); }

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.user-profile { display: flex; align-items: center; gap: 12px; }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.user-info h4 { font-size: 0.88rem; font-weight: 700; }
.user-info p { font-size: 0.72rem; color: var(--text-secondary); }

.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg-main);
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  background: rgba(10, 12, 18, 0.85);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border-color);
}

.nav-left { display: flex; align-items: center; gap: 16px; }

.back-btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.back-btn:hover { background: rgba(255, 255, 255, 0.1); }

.view-title { font-size: 1.2rem; font-weight: 800; }

.search-wrapper { position: relative; width: 340px; }

.search-wrapper i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

.search-wrapper input {
  width: 100%;
  padding: 10px 18px 10px 44px;
  border-radius: 30px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: #fff;
  font-size: 0.85rem;
  outline: none;
}

.gallery-wrapper { padding: 32px; }

/* Albums / Folders Screen */
.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.album-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 14px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.3s ease;
}

.album-card:hover {
  transform: translateY(-6px);
  border-color: rgba(192, 132, 252, 0.4);
  box-shadow: 0 16px 30px rgba(0,0,0,0.5);
}

.album-cover {
  position: relative;
  height: 180px;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
}

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.album-card:hover .album-cover img { transform: scale(1.08); }

.album-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(10, 12, 18, 0.7);
  backdrop-filter: blur(8px);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.album-info h3 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.album-info p { font-size: 0.78rem; color: var(--text-secondary); }

/* Masonry Photos Grid */
.masonry-grid {
  column-count: 4;
  column-gap: 20px;
}

@media (max-width: 1200px) { .masonry-grid { column-count: 3; } }
@media (max-width: 800px) { .masonry-grid { column-count: 2; } }

.card {
  break-inside: avoid;
  margin-bottom: 20px;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.35s ease;
}

.card.tall img { height: 380px; }
.card.short img { height: 220px; }
.card img {
  width: 100%;
  height: 290px;
  object-fit: cover;
  display: block;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(192, 132, 252, 0.4);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 12, 18, 0.95) 0%, transparent 80%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
}

.tag {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 10px;
  margin-bottom: 6px;
}

.tag.anime { background: rgba(192, 132, 252, 0.25); color: #e9d5ff; }
.tag.cute { background: rgba(244, 114, 182, 0.25); color: #fbcfe8; }
.tag.cyber { background: rgba(56, 189, 248, 0.25); color: #bae6fd; }
.tag.cozy { background: rgba(251, 146, 60, 0.25); color: #fed7aa; }

.card-overlay h3 { font-size: 0.98rem; font-weight: 700; color: #fff; }

.like-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(10, 12, 18, 0.6);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.like-btn.liked i { color: #fb7185; font-weight: 900; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 10, 0.88);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal.active { display: flex; }

.modal-card {
  background: var(--sidebar-bg);
  border-radius: 24px;
  max-width: 620px;
  width: 100%;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-color);
}

.close-btn {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 1.8rem;
  cursor: pointer;
  color: #fff;
  z-index: 10;
}

.modal-card img { width: 100%; max-height: 440px; object-fit: cover; display: block; }

.modal-details {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-download {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  color: #fff;
  padding: 10px 20px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
}