/* Modern Virtual Coin Album - Creative/Artistic Design with Dual Theme Support */

/* ===== CSS CUSTOM PROPERTIES FOR DUAL THEMES ===== */
:root {
  /* Bright Theme Colors */
  --bg-primary: #f8f6f1;
  --bg-secondary: #fff;
  --bg-accent: #f0f0f0;
  --bg-header: linear-gradient(135deg, #d4af37 0%, #f4e4bc 100%);
  --bg-album: linear-gradient(145deg, #e8e8e8 0%, #d0d0d0 100%);
  --bg-filters: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
  --bg-card: rgba(255, 255, 255, 0.9);

  /* Text Colors */
  --text-primary: #2c2c2c;
  --text-secondary: #555;
  --text-accent: #d4af37;
  --text-light: #777;

  /* Border and Shadow */
  --border-color: #ddd;
  --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.15);
  --shadow-heavy: 0 8px 30px rgba(0, 0, 0, 0.2);

  /* Accent Colors */
  --accent-gold: #d4af37;
  --accent-green: #4caf50;
  --accent-blue: #2196f3;
  --accent-red: #f44336;

  /* Gradients */
  --gradient-coin: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #d4af37 100%);
  --gradient-button: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  --gradient-progress: linear-gradient(90deg, #4caf50 0%, #8bc34a 100%);
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-accent: #2a2a2a;
  --bg-header: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  --bg-album: linear-gradient(145deg, #2a2a2a 0%, #1f1f1f 100%);
  --bg-filters: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
  --bg-card: rgba(26, 26, 26, 0.95);

  --text-primary: #f0f0f0;
  --text-secondary: #ccc;
  --text-accent: #ffd700;
  --text-light: #999;

  --border-color: #444;
  --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-heavy: 0 8px 30px rgba(0, 0, 0, 0.5);

  --accent-gold: #ffd700;
  --accent-green: #66bb6a;
  --accent-blue: #42a5f5;
  --accent-red: #ef5350;

  --gradient-coin: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #d4af37 100%);
  --gradient-button: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%);
  --gradient-progress: linear-gradient(90deg, #66bb6a 0%, #4caf50 100%);
}

/* ===== BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: all 0.3s ease;
  overflow-x: hidden;
}

body.modal-open {
    overflow: hidden; /* Prevent scrolling when modal is active */
}

/* ===== HEADER STYLES ===== */
header {
  background: var(--bg-header);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-light);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

// Site logo

.logo a {
  display: flex;
  align-items: center;
  color: var(--text-accent);
  text-decoration: none;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

.logo a {
    background: var(--gradient-coin);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo::before {
    content: "🏛️";
    margin-right: 8px;
    font-size: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-accent);
  text-decoration: none;
  transition: all 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.logo img {
  height: 60px;
  margin-right: 12px;
  border-radius: 50%;
  box-shadow: var(--shadow-light);
}

/* Navigation */
nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

nav a, #flipAllButton, #showStoryBtn {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

nav a::before, #flipAllButton::before, #showStoryBtn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-button);
  transition: left 0.3s ease;
  z-index: -1;
}

nav a:hover::before, #flipAllButton:hover::before, #showStoryBtn:hover::before {
  left: 0;
}

nav a:hover, #flipAllButton:hover, #showStoryBtn:hover{
  color: white;
  transform: translateY(-2px);
}

nav button {
  background: var(--gradient-button);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

nav button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-light);
}

/* New styles for the logout button */
nav button[type="submit"] {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 25px;
  background: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

nav button[type="submit"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-button);
  transition: left 0.3s ease;
  z-index: -1;
}

nav button[type="submit"]:hover::before {
  left: 0;
}

nav button[type="submit"]:hover {
  color: white;
  transform: translateY(-2px);
}


/* ===== THEME TOGGLE ===== */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.5rem 1rem;
  border-radius: 25px;
  box-shadow: var(--shadow-light);
  backdrop-filter: blur(10px);
}

.theme-toggle-switch {
  position: relative;
  width: 60px;
  height: 30px;
  background: var(--border-color);
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.theme-toggle-switch::before {
  content: '☀️';
  position: absolute;
  top: 50%;
  left: 5px;
  transform: translateY(-50%);
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.theme-toggle-switch::after {
  content: '🌙';
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.theme-toggle-switch.active {
  background: var(--accent-gold);
}

.theme-toggle-switch.active::before {
  opacity: 0.3;
}

.theme-toggle-switch.active::after {
  opacity: 1;
}

.nav-user {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
}

.user-info h3 {
  color: var(--text-accent);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.user-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.stat-icon {
  font-size: 1.2rem;
}

.stat-value {
  font-weight: 700;
  color: var(--accent-gold);
}

.welcome-banner {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-medium);
}

.welcome-banner h2 {
  color: var(--text-accent);
  font-size: 2rem;
  margin-bottom: 1rem;
}

.welcome-banner p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 0.8rem 2rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.btn-secondary, .btn-primary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover, .btn-primary:hover {
  background: var(--accent-gold);
  color: white;
  border-color: var(--accent-gold);
}

/* ===== MAIN CONTENT ===== */
main {
  min-height: calc(100vh - 140px);
  padding: 2rem;
}

.user-summary-box {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-medium);
  text-align: center;
  font-weight: 600;
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.user-summary-box::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(212, 175, 55, 0.1), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.user-summary-box > * {
  position: relative;
  z-index: 1;
}

/* ===== MAIN CONTENT LAYOUT ===== */
.main-content {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* ===== FILTERS PANEL ===== */
.filters-panel {
  background: var(--bg-filters);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow-medium);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-color);
  height: fit-content;
  position: sticky;
  top: 120px;
}

.filters-panel h3 {
  color: var(--text-accent);
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
  text-align: center;
}

.dropdown-group {
  margin-bottom: 1.5rem;
}

.dropdown-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-secondary);
}

select {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

select:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

select:hover {
  border-color: var(--accent-gold);
}

/* ===== TOGGLE SWITCHES ===== */
.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

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

.toggle-item span {
  font-weight: 600;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  width: 60px;
  height: 30px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border-color);
  transition: 0.4s;
  border-radius: 15px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background: white;
  transition: 0.4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background: var(--accent-green);
}

input:checked + .slider:before {
  transform: translateX(30px);
}

/* ===== FLIP ALL BUTTON =====*/
#flipAllButton {
  width: 100%;
  background: var(--gradient-button);
  color: white;
  border: none;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}


/* ===== COIN ALBUM SECTION ===== */
#coinAlbum {
  background: var(--bg-album);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow-heavy);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-color);
  position: relative;
}

/* ===== PROGRESS BAR - ENHANCED FOR COIN COUNT DISPLAY ===== */
.progress-container {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-light);
    backdrop-filter: blur(10px);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: var(--text-secondary);
}

.progress-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.progress-stats {
    font-weight: 700 !important;
    color: #d4af37 !important;
    background: rgba(240, 240, 240, 0.8) !important;
    padding: 0.3rem 0.7rem !important;
    border-radius: 15px !important;
    border: 2px solid #d4af37 !important;
    min-width: 90px !important;
    text-align: center !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.progress-bar-container {
    background: var(--bg-accent);
    border-radius: 15px;
    overflow: hidden;
    height: 30px;
    position: relative; /* Support absolute positioning for text */
}

.progress-bar {
    height: 100%;
    background: var(--gradient-progress);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    color: var(--text-primary); /* Ensure visibility on dark bar */
    font-weight: 700;
    font-size: 1rem;
    text-shadow: none;
}

.progress-bar[style="width: 0%;"] {
    display: none; /* Hide green progress entirely at 0% */
}

#progressBar:not([style*="width"]) {
    width: 0% !important;
}

@keyframes progress-shine {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ===== ALBUM FRAME ===== */
.album-frame {
  position: relative;
  background: var(--bg-card);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.album-header {
  text-align: center;
  margin-bottom: 2rem;
}

.album-header h2 {
  color: var(--text-accent);
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.album-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* ===== COIN GRID ===== */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.coin-slot {
  background: var(--bg-card);
  border-radius: 15px;
  padding: 1rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  backdrop-filter: blur(10px);
}

.coin-slot::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-coin);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.coin-slot:hover::before {
  opacity: 0.1;
}

.coin-slot:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
  border-color: var(--accent-gold);
}

.coin-year {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.coin-image {
    transition: transform 0.3s ease;
}

.coin-image-container {
  position: relative;
  margin-bottom: 1rem;
}

.coin-slot p {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.coin-slot img {
  width: 100%;
  max-width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-light);
}

.coin-slot img:hover {
  transform: scale(1.1) rotate(5deg);
}

.coin-slot:hover {
  opacity: 1;
}

.coin-name {
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

/* ===== COIN STATES ===== */
.not-collected {
  filter: grayscale(1) brightness(0.3);
}

.collected {
  filter: none;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.collected.double {
  animation: double-glow 2s infinite;
}

@keyframes double-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.5); }
  50% { box-shadow: 0 0 30px rgba(212, 175, 55, 0.8); }
}

.double-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #ff6b6b, #ff5252);
  color: white;
  padding: 4px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 12px;
  box-shadow: var(--shadow-light);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ===== COIN BUTTONS ===== */
.coin-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.coin-btn {
  width: 35px;
  height: 35px;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
}

.coin-btn:hover {
  transform: scale(1.15);
}

.coin-btn.flip:hover {
  border-color: var(--accent-blue);
  background: var(--accent-blue);
  color: white;
}

.coin-btn.info:hover {
  border-color: var(--accent-gold);
  background: var(--accent-gold);
  color: white;
}

.coin-btn.add-to-collection:hover {
  border-color: var(--accent-green);
  background: var(--accent-green);
  color: white;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.page-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  background: var(--bg-card);
  border-radius: 12px;
  border: 2px solid var(--border-color);
}

.page-current {
  font-weight: 700;
  color: var(--accent-gold);
}

.page-separator {
  color: var(--text-secondary);
}

.page-total {
  font-weight: 600;
}

.btn-pagination {
  padding: 0.8rem 1.5rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-pagination:hover {
  background: var(--accent-gold);
  color: white;
  transform: translateY(-2px);
}

.btn-pagination.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== COIN INFO PAGE ===== */
#coinInfoPage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.coin-info-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.coin-info-content {
  background: var(--bg-primary);
  border-radius: 20px;
  padding: 2rem;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.close-info {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: var(--accent-red);
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-medium);
  transition: all 0.3s ease;
}

.close-info:hover {
  transform: scale(1.1);
  background: #d32f2f;
}

/* ===== FOOTER ===== */
footer {
  background: var(--bg-header);
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 3rem;
}

/* ===== RESPONSIVE DESIGN ===== */
/* ===== HAMBURGER MENU STYLES ===== */
/* Base styles for hamburger (hidden by default on large screens) */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.3s ease;
    padding: 0.5rem;
}

.hamburger:hover {
    transform: rotate(90deg);
    color: var(--accent-gold);
}

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

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

.slide-in {
  animation: slideIn 0.6s ease-out;
}

/* ===== SMOOTH SCROLLING ===== */
html {
  scroll-behavior: smooth;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-accent);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-gold);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: #b8941f;
}

/* ===== PRINT STYLES ===== */
@media print {
  .filters-panel,
  .pagination,
  .theme-toggle,
  nav,
  footer {
    display: none !important;
  }

  .main-content {
    grid-template-columns: 1fr;
  }

  .album-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ===== LOADING AND NOTIFICATIONS ===== */
.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.spinner {
    width: 80px; /* Larger size */
    height: 80px; /* Larger size */
    border: 10px solid #ccc; /* Thicker border for visibility */
    border-top: 10px solid #f00; /* Contrasting color to see spinning */
    border-radius: 50%;
    animation: spin 0.8s linear infinite; /* Faster spin for clarity */
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow-medium);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideInRight 0.3s ease;
  backdrop-filter: blur(10px);
}

.notification-success {
  border-color: var(--accent-green);
}

.notification-error {
  border-color: var(--accent-red);
}

.notification-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  margin-left: 0.5rem;
  color: var(--text-secondary);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: ripple-animation 600ms linear;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Style the tab */
.tab {
  overflow: hidden;
  border: 1px solid #ccc;
  background: var(--bg-primary);
}

/* Style the buttons that are used to open the tab content */
.tab button {
  background-color: inherit;
  color: var(--text-primary);
  float: left;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 14px 16px;
  transition: 0.3s;
}

/* Change background color of buttons on hover */
.tab button:hover {
  background-color: #ddd;
}

/* Create an active/current tablink class */
.tab button.active {
  background-color: var(--bg-card);
  color: var(--text-accent);
}

/* Style the tab content */
.tabcontent {
  display: none;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-top: none;
}

h2 {
    color: var(--text-accent);
}

img {
  display: block;
  margin: auto;
  width: 60%;
}

/* ===== FEEDBACK MODAL STYLES ===== */
/* Reusing theme variables for consistency in bright/dark modes */
#feedback-modal {
    display: none; /* Hidden by default; JS will show it */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card); /* Themed card background */
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-heavy); /* Heavy shadow for depth */
    backdrop-filter: blur(15px); /* Blurred backdrop for modern feel */
    border: 1px solid var(--border-color); /* Subtle border */
    z-index: 1000; /* Above other elements */
    max-width: 500px;
    width: 90%; /* Responsive width */
    animation: fadeIn 0.6s ease-out; /* Reuse existing fadeIn animation */
    overflow-y: auto; /* Scroll if too tall */
    max-height: 80vh; /* Limit height on small screens */
}

#feedback-modal h2 {
    color: var(--text-accent); /* Gold accent for heading */
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

#feedback-modal p {
    color: var(--text-secondary); /* Secondary text color */
    font-weight: 600;
    margin-bottom: 0.5rem;
}

#feedback-modal label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary); /* Primary text */
    cursor: pointer;
}

#feedback-modal input[type="radio"] {
    accent-color: var(--accent-gold); /* Themed radio buttons */
}

#feedback-modal input[type="number"],
#feedback-modal input[type="range"] {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-accent); /* Accent background */
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease; /* Smooth transitions */
}

#feedback-modal input[type="number"]:focus,
#feedback-modal input[type="range"]:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2); /* Gold focus glow */
}

#feedback-modal textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-accent);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    resize: vertical; /* Allow resizing */
}

#feedback-modal textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

#feedback-modal button[type="submit"] {
    background: var(--gradient-button); /* Reuse button gradient */
    color: white;
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#feedback-modal button[type="submit"]:hover {
    transform: translateY(-3px); /* Lift on hover */
    box-shadow: var(--shadow-medium);
}

#feedback-modal #dismiss-feedback {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#feedback-modal #dismiss-feedback:hover {
    border-color: var(--accent-red); /* Red accent for dismiss */
    color: var(--accent-red);
    transform: translateY(-3px);
}

/* Responsive adjustments for mobile */

@media (max-width: 1200px) {
  .main-content {
    grid-template-columns: 350px 1fr;
  }
}

@media (max-width: 968px) {
  .main-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .filters-panel {
    position: relative;
    top: 0;
  }

  .album-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

@media (max-width: 768px) {
    header {
        flex-direction: row;  /* Keep logo and hamburger side-by-side */
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
    }

    .hamburger {
        display: block;  /* Show hamburger on mobile */
    }

    #main-nav {
        display: none;  /* Hide nav by default on mobile */
        position: absolute;
        top: 100%;  /* Position below header */
        left: 0;
        width: 100%;
        background: var(--bg-header);  /* Match header background */
        flex-direction: column;  /* Stack items vertically */
        gap: 0;  /* Remove horizontal gap for vertical menu */
        box-shadow: var(--shadow-medium);
        z-index: 99;  /* Ensure it overlays content */
    }

    #main-nav.active {
        display: flex;  /* Show when toggled */
    }

    #main-nav a,
    #main-nav button,
    #main-nav form button {
        width: 100%;  /* Full width for touch-friendly clicks */
        text-align: center;
        padding: 1rem;
        border-radius: 0;  /* Flatten for menu look */
        border-bottom: 1px solid var(--border-color);  /* Separate items */
    }

    #main-nav .theme-toggle {
        padding: 1rem;
        justify-content: center;
        border-bottom: 1px solid var(--border-color);
    }

    /* Ensure no overflow issues with existing nav styles */
    #main-nav > * {
        margin: 0;
    }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.4rem;
  }

  .filters-panel {
    padding: 1rem;
  }

  .album-grid {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  }

  #feedback-modal {
    padding: 1.5rem;
    max-width: 95%;
  }

  #feedback-modal h2 {
    font-size: 1.3rem;
  }

  #feedback-modal button {
    font-size: 1rem;
    padding: 0.8rem;
  }
}

@media (max-width: 430px) {

  .album-grid {
    /* Larger min width for fewer, bigger cards; auto-fit adapts */
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem; /* Reduce gap slightly to fit without overflow */
  }

  .coin-slot img {
    max-width: 120px; /* Increase max-width to make images fill more of the slot */
    height: 120px; /* Match height for square aspect */
  }

  .coin-slot {
    padding: 0.75rem; /* Reduce padding inside slots for more image space */
  }

  .filters-panel {
    max-width: 395px; /* Increase max-width to make images fill more of the slot */
    padding: 1rem; /* Reduce from 2rem to save vertical space */
  }

  #coinAlbum{
      max-width: 395px; /* Increase max-width to make images fill more of the slot */
      padding: 1rem; /* Reduce from 2rem to save vertical space */
  }

  .dropdown-group label {
    font-size: 0.9rem; /* Slightly smaller labels for compactness */
  }

  .toggle-group {
    gap: 0.75rem; /* Reduce toggle spacing */
  }

  main {
    padding: 1rem; /* Reduce main padding from 2rem for more content visibility */
  }

  .user-summary-box {
    padding: 1rem; /* Slight reduction to match */
  }

  .user-stats {
    gap: 1rem; /* Smaller gap for stats to prevent wrapping issues */
    font-size: 0.9rem; /* Compact text */
  }
}

@media (max-width: 414px) {

  .album-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Larger min width for fewer, bigger cards; auto-fit adapts */
    gap: 1rem; /* Reduce gap slightly to fit without overflow */
  }

  .coin-slot img {
    max-width: 120px; /* Increase max-width to make images fill more of the slot */
    height: 120px; /* Match height for square aspect */
  }

  .coin-slot {
    padding: 0.75rem; /* Reduce padding inside slots for more image space */
  }

  .filters-panel {
    max-width: 380px; /* Increase max-width to make images fill more of the slot */
    padding: 1rem; /* Reduce from 2rem to save vertical space */
  }

  #coinAlbum{
      max-width: 380px; /* Increase max-width to make images fill more of the slot */
      padding: 1rem; /* Reduce from 2rem to save vertical space */
  }

  .dropdown-group label {
    font-size: 0.9rem; /* Slightly smaller labels for compactness */
  }

  .toggle-group {
    gap: 0.75rem; /* Reduce toggle spacing */
  }

  main {
    padding: 1rem; /* Reduce main padding from 2rem for more content visibility */
  }

  .user-summary-box {
    padding: 1rem; /* Slight reduction to match */
  }

  .user-stats {
    gap: 1rem; /* Smaller gap for stats to prevent wrapping issues */
    font-size: 0.9rem; /* Compact text */
  }
}

@media (max-width: 390px) {

  .album-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Larger min width for fewer, bigger cards; auto-fit adapts */
    gap: 1rem; /* Reduce gap slightly to fit without overflow */
  }

  .coin-slot img {
    max-width: 120px; /* Increase max-width to make images fill more of the slot */
    height: 120px; /* Match height for square aspect */
  }

  .coin-slot {
    padding: 0.75rem; /* Reduce padding inside slots for more image space */
  }

  .filters-panel {
    max-width: 360px; /* Increase max-width to make images fill more of the slot */
    padding: 1rem; /* Reduce from 2rem to save vertical space */
  }

  #coinAlbum{
      max-width: 360px; /* Increase max-width to make images fill more of the slot */
      padding: 1rem; /* Reduce from 2rem to save vertical space */
  }

  .dropdown-group label {
    font-size: 0.9rem; /* Slightly smaller labels for compactness */
  }

  .toggle-group {
    gap: 0.75rem; /* Reduce toggle spacing */
  }

  main {
    padding: 1rem; /* Reduce main padding from 2rem for more content visibility */
  }

  .user-summary-box {
    padding: 1rem; /* Slight reduction to match */
  }

  .user-stats {
    gap: 1rem; /* Smaller gap for stats to prevent wrapping issues */
    font-size: 0.9rem; /* Compact text */
  }
}

@media (max-width: 375px) {

  .album-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Larger min width for fewer, bigger cards; auto-fit adapts */
    gap: 1rem; /* Reduce gap slightly to fit without overflow */
  }

  .coin-slot img {
    max-width: 120px; /* Increase max-width to make images fill more of the slot */
    height: 120px; /* Match height for square aspect */
  }

  .coin-slot {
    padding: 0.75rem; /* Reduce padding inside slots for more image space */
  }

  .filters-panel {
    max-width: 340px; /* Increase max-width to make images fill more of the slot */
    padding: 1rem; /* Reduce from 2rem to save vertical space */
  }

  #coinAlbum{
      max-width: 355px; /* Increase max-width to make images fill more of the slot */
      padding: 1rem; /* Reduce from 2rem to save vertical space */
  }

  .dropdown-group label {
    font-size: 0.9rem; /* Slightly smaller labels for compactness */
  }

  .toggle-group {
    gap: 0.75rem; /* Reduce toggle spacing */
  }

  main {
    padding: 1rem; /* Reduce main padding from 2rem for more content visibility */
  }

  .user-summary-box {
    padding: 1rem; /* Slight reduction to match */
  }

  .user-stats {
    gap: 1rem; /* Smaller gap for stats to prevent wrapping issues */
    font-size: 0.9rem; /* Compact text */
  }
}


@media (max-width: 360px) {

  .album-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Larger min width for fewer, bigger cards; auto-fit adapts */
    gap: 1rem; /* Reduce gap slightly to fit without overflow */
  }

  .coin-slot img {
    max-width: 120px; /* Increase max-width to make images fill more of the slot */
    height: 120px; /* Match height for square aspect */
  }

  .coin-slot {
    padding: 0.75rem; /* Reduce padding inside slots for more image space */
  }

  .filters-panel {
    max-width: 335px; /* Increase max-width to make images fill more of the slot */
    padding: 1rem; /* Reduce from 2rem to save vertical space */
  }

  #coinAlbum{
      max-width: 335px; /* Increase max-width to make images fill more of the slot */
      padding: 1rem; /* Reduce from 2rem to save vertical space */
  }

  .dropdown-group label {
    font-size: 0.9rem; /* Slightly smaller labels for compactness */
  }

  .toggle-group {
    gap: 0.75rem; /* Reduce toggle spacing */
  }

  main {
    padding: 1rem; /* Reduce main padding from 2rem for more content visibility */
  }

  .user-summary-box {
    padding: 1rem; /* Slight reduction to match */
  }

  .user-stats {
    gap: 1rem; /* Smaller gap for stats to prevent wrapping issues */
    font-size: 0.9rem; /* Compact text */
  }
}

@media (max-width: 344px) {

  .album-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Larger min width for fewer, bigger cards; auto-fit adapts */
    gap: 1rem; /* Reduce gap slightly to fit without overflow */
  }

  .coin-slot img {
    max-width: 120px; /* Increase max-width to make images fill more of the slot */
    height: 120px; /* Match height for square aspect */
  }

  .coin-slot {
    padding: 0.75rem; /* Reduce padding inside slots for more image space */
  }

  .filters-panel {
    max-width: 320px; /* Increase max-width to make images fill more of the slot */
    padding: 1rem; /* Reduce from 2rem to save vertical space */
  }

  #coinAlbum{
      max-width: 320px; /* Increase max-width to make images fill more of the slot */
      padding: 1rem; /* Reduce from 2rem to save vertical space */
  }

  .dropdown-group label {
    font-size: 0.9rem; /* Slightly smaller labels for compactness */
  }

  .toggle-group {
    gap: 0.75rem; /* Reduce toggle spacing */
  }

  main {
    padding: 1rem; /* Reduce main padding from 2rem for more content visibility */
  }

  .user-summary-box {
    padding: 1rem; /* Slight reduction to match */
  }

  .user-stats {
    gap: 1rem; /* Smaller gap for stats to prevent wrapping issues */
    font-size: 0.9rem; /* Compact text */
  }
}


/* Modal backdrop using pseudo-element on body (dim gray overlay with blur, matching coin info effect) */
body.modal-open::before {
  content: '';  /* Required for pseudo-element to render */
  position: fixed;  /* Covers entire viewport, fixed to stay in place */
  top: 0;
  left: 0;
  width: 100vw;  /* Full width, using vw to prevent overflow issues */
  height: 100vh;  /* Full height, using vh for complete coverage */
  background-color: rgba(0, 0, 0, 0.4);  /* Lighter gray for subtle dimming; matches coin info's softness */
  backdrop-filter: blur(5px);  /* Adds blur effect like coin info's faded background */
  z-index: 1030;  /* Below modal (ensure #feedback-modal z-index is 1040+ in CSS) */
  pointer-events: none;  /* Prevents interaction with backdrop itself */
  transition: opacity 0.3s ease, backdrop-filter 0.3s ease;  /* Smooth fade and blur-in */
  opacity: 1;  /* Fully visible when active */
}

/* Theme adjustments for backdrop (stronger blur/contrast in dark mode, like coin info adaptation) */
[data-theme="dark"] body.modal-open::before {
  background-color: rgba(0, 0, 0, 0.6);  /* Darker overlay for better visibility in dark theme */
  backdrop-filter: blur(8px);  /* Slightly stronger blur for depth in low-light theme */
}

/* Ensure modal sits above backdrop (add if not present, or update existing #feedback-modal rule) */
#feedback-modal {
  position: fixed;  /* Fixed positioning to overlay on top */
  z-index: 1050;  /* Higher than backdrop for layering, matching typical popup z-index */
  /* Existing styles like padding, background, etc., remain unchanged */
}