/* Base */
  body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background: #f0f0f5;
    overflow-x: hidden;
    padding-bottom: 70px; /* For bottom nav */
    transition: background-color 0.3s ease, color 0.3s ease;
  }

  /* Header */
  .header {
    position: sticky;
    top: 0;
    background: white;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .menu-icon,
  .material-icons {
    font-size: 24px;
    cursor: pointer;
    color: #333;
  }

  .app-title,
  .title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    flex: 1;
    text-align: left;
  }

  .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 24px;
    color: #333;
  }

  /* Search Bar */
  .search-bar {
    display: flex;
    padding: 10px;
    background: #fff;
    border-bottom: 1px solid #ccc;
    position: relative;
    z-index: 1000;
  }

  .search-bar input {
    width: 98%;
    padding: 10px;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-sizing: border-box;
  }

  @media (max-width: 400px) {
    .search-bar input {
      width: 94%;
    }
  }

  /* Tab Bar */
  .tab-bar {
    display: flex;
    overflow-x: auto;
    background: #fff;
    border-bottom: 1px solid #ddd;
  }

  .tab-bar a {
    padding: 10px 16px;
    flex-shrink: 0;
    font-size: 14px;
    color: #555;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    text-decoration: none;
  }

  .tab-bar a.active {
    color: #4caf50;
    border-bottom-color: #4caf50;
  }

  .tab-bar a:hover:not(.active) {
    background: #f0f0f5;
  }

  /* Wallpaper Grid */
  .wallpaper-grid {
    display: grid;
    gap: 8px;
    padding: 8px;
  }

  @media (max-width: 768px) {
    .wallpaper-grid {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  @media (min-width: 769px) {
    .wallpaper-grid {
      grid-template-columns: repeat(5, 1fr);
    }
  }

  .wallpaper-item {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    aspect-ratio: 3 / 4;
  }

  .wallpaper-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease;
  }

  /* Lightbox */
  .lightbox {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
  }

  .lightbox.show {
    display: flex;
  }

  .lightbox-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
  }

  .lightbox-carousel {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    transition: transform 0.3s ease-in-out;
    touch-action: pan-x;
  }

  .lightbox-img {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    flex-shrink: 0;
    background: #000;
    user-select: none;
  }

  .close-lightbox {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 28px;
    color: #fff;
    background: rgba(0,0,0,0.4);
    padding: 4px 10px;
    border-radius: 4px;
    text-decoration: none;
    z-index: 10000;
  }

  /* Wallpaper Buttons */
  .set-wallpaper-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 90%;
    max-width: 400px;
    padding: 0 12px;
    z-index: 10001;
  }

  .wallpaper-btn {
    flex-grow: 1;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    border-radius: 10px;
    background: #4caf50;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  }

  .wallpaper-btn:hover {
    background: #43a047;
  }

  .download-btn {
    background: #2196f3;
    border-radius: 50%;
    margin-left: 12px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
  }

  .download-btn:hover {
    background: #1976d2;
  }

  .download-btn .material-icons {
    font-size: 24px;
  }

  .premium-lock {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    background: rgba(0,0,0,0.5);
    padding: 6px;
    border-radius: 50%;
    z-index: 10001;
  }

  /* Wallpaper Popup */
  .wallpaper-popup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10002;
    justify-content: center;
    align-items: center;
  }

  .wallpaper-popup.show {
    display: flex;
  }

  .popup-content {
    background: #fff;
    padding: 20px 24px;
    border-radius: 10px;
    text-align: center;
    width: 90%;
    max-width: 320px;
  }

  .popup-content h3 {
    margin-bottom: 16px;
    font-size: 18px;
  }

  .popup-content button {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    background: #f0f0f0;
    border: none;
    border-radius: 6px;
    font-size: 16px;
  }

  /* Side Drawer */
  .drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 998;
  }

  .side-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    height: 100%;
    background: #fff;
    z-index: 999;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }

  .drawer-header {
    padding: 24px 20px 16px;
    background: #4CAF50;
    color: white;
    border-radius: 0 8px 0 0;
  }

  .drawer-header .app-name {
    font-size: 20px;
    font-weight: bold;
  }

  .drawer-header p#userInfo {
    font-size: 13px;
    color: #eaffea;
    opacity: 0.9;
  }

  .drawer-menu {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px 20px;
    background: #f9f9f9;
  }

  .drawer-item {
    background: white;
    margin-top: 10px;
    padding: 12px 15px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: background 0.2s;
    color: #333;
  }

  .drawer-item:hover {
    background: #f0f0f0;
  }

  .drawer-title {
    margin: 25px 0 8px 4px;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    color: #999;
  }

  .drawer-menu::-webkit-scrollbar {
    width: 6px;
  }

  .drawer-menu::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
  }

  /* Footer */
  .site-footer {
    display: block;
  }

  @media (max-width: 768px) {
    .site-footer {
      display: none;
    }
  }

/* === Popup Overlay === */
.theme-popup-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

/* Make sure popup uses flex when shown via JS */
.theme-popup-overlay.show {
  display: flex;
}

/* === Popup Box === */
.theme-popup {
  background: var(--popup-bg, #fff);
  color: var(--text-color, #000);
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  text-align: center;
}

.theme-options {
  display: flex;
  justify-content: space-around;
  margin: 20px 0;
}

.theme-option {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.preview {
  width: 50px;
  height: 30px;
  margin-bottom: 5px;
  border-radius: 5px;
  border: 1px solid #ccc;
}

.light-preview { background: #f0f0f0; }
.dark-preview { background: #333; }
.system-preview { background: linear-gradient(45deg, #f0f0f0, #333); }

/* === Dark Mode Support === */
body.dark-mode {
  background: #121212;
  color: #e0e0e0;
}

body.dark-mode .theme-popup {
  background: #1e1e1e;
  color: #fff;
}

body.dark-mode .theme-popup button {
  background: #333;
  color: #fff;
}


  /* Bottom Navigation */
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #fff;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
  }

  .bottom-item {
    text-decoration: none;
    color: #555;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .bottom-item .material-symbols-outlined {
    font-size: 24px;
    margin-bottom: 2px;
    color: #4CAF50;
  }

  .bottom-item:hover {
    background: #f9f9f9;
    border-radius: 10px;
    padding: 6px 8px;
  }

  /* Notifications */
  .notification-icon {
    position: relative;
    font-size: 24px;
    color: #4CAF50;
    cursor: pointer;
  }

  .notification-icon:hover {
    color: #388E3C;
  }

  .notification-icon .badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: red;
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 50%;
    font-weight: bold;
    line-height: 1;
  }

  .notification-panel {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background: white;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    padding: 15px;
  }

  .notification-panel.active {
    right: 0;
  }

  .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
  }

  .panel-header h3 {
    margin: 0;
    font-size: 18px;
  }

  .close-btn {
    cursor: pointer;
    color: #555;
  }

  .panel-actions {
    display: flex;
    justify-content: flex-end;
    margin: 10px 0;
  }

  .panel-actions button {
    background: #4CAF50;
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
  }

  .scroll-area {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex: 1;
    max-height: 70vh;
  }

  .scroll-area li {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #333;
  }

  .empty-message {
    text-align: center;
    color: #888;
    margin-top: 30px;
    font-size: 14px;
  }
  
  .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: red;
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 12px;
}
/* 🔥 Base: Mobile-first layout (1 item per row) */
.wallpaper-grid.quote-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 10px;
  margin: 0;
}

.wallpaper-grid.quote-layout .wallpaper-item {
  height: 400px;
  width: 100%;
  overflow: hidden;
}

.wallpaper-grid.quote-layout .wallpaper-item img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

/* 🖥️ Desktop: 3 items per row */
@media (min-width: 768px) {
  .wallpaper-grid.quote-layout {
    grid-template-columns: repeat(3, 1fr);
  }

  .wallpaper-grid.quote-layout .wallpaper-item {
    height: 450px;
  }
}

