@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@400;700&family=Quicksand:wght@500;700&display=swap');

:root {
  /* Student Notebook Palette */
  --std-bg: #fffcf0;
  --std-line: #b2d4ff;
  --std-margin: #ff9999;
  --std-primary: #ffb703;
  /* Bright Yellow */
  --std-secondary: #02c39a;
  /* Bright Green */
  --std-text: #2b2d42;
  --std-text-light: #5c677d;

  --std-font-heading: 'Quicksand', sans-serif;
  --std-font-hand: 'Comic Neue', cursive;

  --std-shadow: 0 8px 16px rgba(43, 45, 66, 0.08);
  --std-transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--std-font-heading);
  background-color: var(--std-bg);
  /* Notebook Line Background */
  background-image:
    linear-gradient(90deg, transparent 79px, var(--std-margin) 79px, var(--std-margin) 81px, transparent 81px),
    linear-gradient(var(--std-bg) 1.2rem, var(--std-line) 1.25rem);
  background-size: 100% 1.25rem;
  color: var(--std-text);
  overflow-x: hidden;
  position: relative;
}

/* Base bubbly animations */
@keyframes floatBubble {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.8;
  }

  50% {
    transform: translateY(-30px) scale(1.1);
    opacity: 1;
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: 0.8;
  }
}

.bg-bubble-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.bg-bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 183, 3, 0.4) 0%, transparent 80%);
  animation: floatBubble 6s ease-in-out infinite;
  filter: blur(4px);
}

.bg-bubble.green {
  background: radial-gradient(circle at 30% 30%, rgba(2, 195, 154, 0.4) 0%, transparent 80%);
}

/* Navigation */
.std-nav {
  position: sticky;
  top: 2rem;
  margin: 0 auto 2rem;
  width: 90%;
  max-width: 1000px;
  background: white;
  border-radius: 20px;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--std-shadow);
  z-index: 100;
  border: 4px solid var(--std-text);
}

.std-nav .brand {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--std-primary);
  text-decoration: none;
  text-shadow: 2px 2px 0px var(--std-text);
  font-family: var(--std-font-hand);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.std-menu {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.std-btn-nav {
  background: var(--std-secondary);
  color: white;
  border: 3px solid var(--std-text);
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: var(--std-transition);
  box-shadow: 4px 4px 0px var(--std-text);
  cursor: pointer;
}

.std-btn-nav:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px var(--std-text);
}

.std-btn-nav.yellow {
  background: var(--std-primary);
}

/* Main Content Area */
.notebook-container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto 5rem;
  background: white;
  border-radius: 20px;
  border: 4px solid var(--std-text);
  box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.notebook-header {
  padding: 3rem 4rem;
  border-bottom: 4px solid var(--std-text);
  background: #fafafa;
  position: relative;
}

.notebook-header h1 {
  font-family: var(--std-font-hand);
  font-size: 3.5rem;
  color: var(--std-text);
  margin-bottom: 1rem;
}

.notebook-header p {
  font-size: 1.2rem;
  color: var(--std-text-light);
  max-width: 700px;
}

/* Tape decoration */
.tape {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 150px;
  height: 35px;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(2px);
  z-index: 10;
}

/* Tabs */
.tabs {
  position: absolute;
  top: 1rem;
  right: -25px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 0;
}

.tab {
  background: var(--std-primary);
  width: 80px;
  height: 50px;
  border: 4px solid var(--std-text);
  border-left: none;
  border-radius: 0 16px 16px 0;
  color: var(--std-text);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
  position: relative;
  left: -15px;
  font-family: var(--std-font-hand);
}

.tab:hover {
  left: 0px;
}

.tab.c1 {
  background: var(--std-primary);
}

.tab.c2 {
  background: var(--std-secondary);
}

.tab.c3 {
  background: #ff9999;
}

/* Notes Grid */
.notes-main {
  padding: 3rem;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
  align-items: stretch;
}

.note-card {
  background: #fff;
  border: 4px solid var(--std-text);
  border-radius: 12px;
  padding: 1.5rem;
  position: relative;
  cursor: pointer;
  transition: var(--std-transition);
  box-shadow: 4px 4px 0px var(--std-text);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.note-card:hover {
  transform: translateY(-10px) rotate(2deg) scale(1.05);
  box-shadow: 8px 8px 0px var(--std-text);
}

.note-card.yellow {
  background: #fffde7;
}

.note-card.green {
  background: #e0f2f1;
}

.note-card.pink {
  background: #fce4ec;
}

.note-pin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ef476f;
  border: 2px solid var(--std-text);
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: inset -2px -2px rgba(0, 0, 0, 0.2);
}

.note-card h3 {
  font-family: var(--std-font-hand);
  font-size: 1.4rem;
  border-bottom: 2px solid var(--std-text);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.note-card p {
  font-family: var(--std-font-heading);
  color: var(--std-text-light);
  font-size: 0.95rem;
  line-height: 1.5;
  flex-grow: 1;
}

/* Action Button */
.add-note-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  border: 4px dashed var(--std-text-light);
  border-radius: 12px;
  background: transparent;
  padding: 2.5rem;
  font-family: var(--std-font-hand);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--std-text-light);
  cursor: pointer;
  transition: var(--std-transition);
  min-height: 180px;
  grid-column: 1 / -1;
  text-align: center;
}

.add-note-btn:hover {
  border-color: var(--std-primary);
  color: var(--std-primary);
  transform: scale(1.02);
}

/* Back Link */
.back-link {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: white;
  border: 3px solid var(--std-text);
  color: var(--std-text);
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 4px 4px 0px var(--std-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 100;
  transition: var(--std-transition);
}

.back-link:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px var(--std-text);
}

/* Responsive Design */
@media(max-width: 1024px) {
  .notebook-container {
    width: 95%;
  }

  .notes-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
  }
}

@media(max-width: 768px) {
  .std-nav {
    width: 95%;
    flex-wrap: wrap;
    padding: 1rem;
    gap: 0.5rem;
  }

  .std-menu {
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
  }

  .notebook-container {
    width: 95%;
    border: 3px solid var(--std-text);
    border-radius: 16px;
  }

  .notebook-header {
    padding: 2rem;
  }

  .notebook-header h1 {
    font-size: 2.5rem;
  }

  .notes-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    padding: 2rem;
  }

  .note-card {
    padding: 1.2rem;
  }

  .note-card h3 {
    font-size: 1.2rem;
  }

  .note-card p {
    font-size: 0.9rem;
  }

  .add-note-btn {
    padding: 2rem;
    font-size: 1.2rem;
    min-height: 150px;
  }
}

@media(max-width: 480px) {
  .std-nav {
    width: 100%;
    border: 2px solid var(--std-text);
    border-radius: 12px;
    padding: 0.8rem;
  }

  .std-nav .brand {
    font-size: 1.4rem;
  }

  .std-menu {
    display: none;
  }

  .notebook-container {
    width: 100%;
    margin: 0;
    border-radius: 12px;
    border: 2px solid var(--std-text);
  }

  .notes-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 1rem;
  }

  .notebook-header {
    padding: 1.5rem;
  }

  .notebook-header h1 {
    font-size: 2rem;
  }

  .note-card {
    padding: 1rem;
    border-radius: 8px;
    border: 3px solid var(--std-text);
  }

  .note-card h3 {
    font-size: 1rem;
  }

  .note-pin {
    width: 12px;
    height: 12px;
    border: 2px solid var(--std-text);
  }

  .add-note-btn {
    padding: 1.5rem;
    font-size: 1rem;
    min-height: 120px;
    border: 3px dashed var(--std-text-light);
  }

  .back-link {
    padding: 0.6rem 1rem;
    font-size: 0.75rem;
    bottom: 1rem;
    right: 1rem;
    box-shadow: 2px 2px 0px var(--std-text);
    border: 2px solid var(--std-text);
  }

  .std-btn-nav {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border: 2px solid var(--std-text);
    box-shadow: 2px 2px 0px var(--std-text);
  }
}