@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&family=Mountains+of+Christmas:wght@700&display=swap');

:root {
  /* --- PALETTES --- */
  --xmas-primary: #C41E3A;
  --xmas-secondary: #165B33;
  --xmas-bg: #F9F7F2;
  --xmas-text: #2c0e0e;
  
  --bday-primary: #0052CC;
  --bday-secondary: #091E42;
  --bday-bg: #F0F2F5;
  --bday-text: #172B4D;

  --card-white: rgba(255, 255, 255, 0.95);
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  transition: background 0.5s ease;
  overflow-x: hidden;
}

/* --- THEMES --- */
body.xmas-theme { background-color: var(--xmas-bg); color: var(--xmas-text); }
body.bday-theme { background-color: var(--bday-bg); color: var(--bday-text); }

/* --- DYNAMIC WALLPAPER --- */
.bg-pattern {
  position: fixed;
  top: -150%; left: -150%; width: 400%; height: 400%;
  z-index: -1; 
  overflow: hidden; opacity: 0.06; pointer-events: none;
  display: flex; flex-wrap: wrap; justify-content: center; align-content: center;
  font-size: 80px; line-height: 1.5; user-select: none; filter: grayscale(0.2);
  text-align: center; transform: rotate(-15deg); 
}
body.xmas-theme .pattern-bday { display: none; }
body.bday-theme .pattern-xmas { display: none; }

/* --- LAYOUT --- */
.container { max-width: 900px; margin: 0 auto; padding: 40px 20px; position: relative; z-index: 2; }

h1 {
  font-family: 'Mountains of Christmas', cursive;
  font-size: 4rem; text-align: center; margin-bottom: 20px;
  text-shadow: 2px 2px 0px rgba(255,255,255,0.5);
}
body.xmas-theme h1 { color: var(--xmas-primary); }
body.bday-theme h1 { font-family: 'Inter', sans-serif; font-weight: 900; color: var(--bday-primary); text-transform: uppercase; letter-spacing: -2px; }

/* --- TABS --- */
.tabs { display: flex; justify-content: center; gap: 15px; margin-bottom: 40px; }
.tab {
  padding: 12px 30px; border: none; border-radius: 12px;
  font-size: 1.1rem; font-weight: 700; cursor: pointer;
  transition: all 0.2s; background: rgba(0,0,0,0.05); color: #666;
}
.tab.active { color: white; transform: scale(1.05); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
body.xmas-theme .tab.active.xmas { background: var(--xmas-primary); }
body.bday-theme .tab.active.bday { background: var(--bday-primary); }

/* --- CARDS --- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 25px; }

.card {
  position: relative; 
  display: flex; align-items: center; justify-content: center;
  min-height: 80px; background: var(--card-white); padding: 25px;
  border-radius: 16px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid rgba(0,0,0,0.05);
  text-align: center; backdrop-filter: blur(5px);
  text-decoration: none; color: inherit; font-weight: 700; font-size: 1.1rem;
}

.card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); cursor: pointer; }
body.xmas-theme .card { border-bottom: 4px solid var(--xmas-primary); }
body.bday-theme .card { border-bottom: 4px solid var(--bday-primary); }

/* --- STAR STYLES (Fixed: Inside the card) --- */
.star-badge {
  position: absolute;
  /* Positive numbers put it INSIDE the box */
  top: 10px; 
  left: 10px;
  
  background: #FFD700; color: #fff; width: 28px; height: 28px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; box-shadow: 0 2px 4px rgba(0,0,0,0.2); z-index: 10;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn { 0% { transform: scale(0); } 100% { transform: scale(1); } }

.starred-card { 
  border: 2px solid #FFD700 !important; 
  background: #fffdf0 !important; /* Slight yellow tint for starred cards */
}

/* --- ADMIN PANEL STYLES --- */
.form-box { background: white; padding: 40px; border-radius: 20px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); max-width: 450px; margin: 50px auto; }
input, select { width: 100%; padding: 15px; margin: 10px 0; border: 2px solid #eee; border-radius: 10px; font-size: 1rem; outline: none; box-sizing: border-box; }
input:focus, select:focus { border-color: var(--xmas-primary); }
body.bday-theme input:focus { border-color: var(--bday-primary); }

.btn { width: 100%; padding: 15px; margin-top: 20px; border: none; border-radius: 10px; font-size: 1.1rem; font-weight: bold; color: white; cursor: pointer; }
body.xmas-theme .btn { background: var(--xmas-primary); }
body.bday-theme .btn { background: var(--bday-primary); }

/* Admin Item List Styles */
.admin-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px; border-bottom: 1px solid #eee; margin-bottom: 10px;
    background: #fff; border-radius: 8px; transition: background 0.3s;
}

/* Highlight item in admin panel if starred */
.admin-item.is-starred {
    border: 2px solid #2ecc71; /* Green Border */
    background: #f0fff4; /* Light Green Background */
}

.star-btn { background: #eee; color: #555; border: none; padding: 8px 15px; border-radius: 8px; cursor: pointer; font-weight: bold; transition: 0.2s; }

/* GREEN BUTTON WHEN ACTIVE */
.star-btn.active { 
    background: #2ecc71; /* Bright Green */
    color: white; 
    box-shadow: 0 4px 6px rgba(46, 204, 113, 0.3);
}

.del-btn { background: #ff4757; color: white; border: none; padding: 8px 15px; border-radius: 8px; cursor: pointer; }

/* --- SNOWFLAKES --- */
.snowflake {
  position: fixed; top: -10%; color: var(--xmas-primary); opacity: 0.6; z-index: 1;
  font-size: 1.5em; animation: fall 10s linear infinite, shake 3s ease-in-out infinite; pointer-events: none;
}
body.bday-theme .snowflake { display: none; }
@keyframes fall { 0% { top: -10%; } 100% { top: 110%; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(40px); } }

.snowflake:nth-of-type(1) { left: 5vw; animation-delay: 0s, 0s; }
.snowflake:nth-of-type(2) { left: 15vw; animation-delay: 1s, 1s; }
.snowflake:nth-of-type(3) { left: 25vw; animation-delay: 6s, 0.5s; }
.snowflake:nth-of-type(4) { left: 35vw; animation-delay: 4s, 2s; }
.snowflake:nth-of-type(5) { left: 45vw; animation-delay: 2s, 2s; }
.snowflake:nth-of-type(6) { left: 55vw; animation-delay: 8s, 3s; }
.snowflake:nth-of-type(7) { left: 65vw; animation-delay: 6s, 2s; }
.snowflake:nth-of-type(8) { left: 75vw; animation-delay: 2.5s, 1s; }
.snowflake:nth-of-type(9) { left: 85vw; animation-delay: 1s, 0s; }
.snowflake:nth-of-type(10) { left: 95vw; animation-delay: 3s, 1.5s; }
