@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

/* ===== Base Layout ===== */
body {
  min-height: 100vh;
  color: #fff;
  background: linear-gradient(135deg, #a0c4ff, #bdb2ff, #ffc6ff);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  overflow-x: hidden;
  transition: 0.8s ease;
}

/* ===== Canvas + Overlay ===== */
#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background: transparent;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  background: transparent;
}

/* ===== Header ===== */
header {
  position: relative;
  margin-top: 2rem;
  z-index: 10;
}

h1 {
  font-size: 2rem;
  letter-spacing: 1px;
}

button {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s ease;
}

button:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ===== Main Sections ===== */
main {
  display: flex;
  gap: 2rem;
  margin: 2rem 0;
  flex-wrap: wrap;
  justify-content: center;
}

section {
  background: rgba(0, 0, 0, 0.3); /* solid box */
  border-radius: 12px;            /* slightly rounded corners */
  padding: 1.5rem;
  width: 280px;
  min-height: 200px;  
  max-height: 200px; /* keeps all sections same height */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); /* soft shadow */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;    /* content aligns top */
  backdrop-filter: none;          /* remove blur effect */
}

/* Pomodoro Timer */
#time {
  font-size: 2.5rem;
  margin: 1rem 0;
}

/* Notes Section */
textarea {
  width: 100%;
  height: 150px;
  border: none;
  outline: none;
  border-radius: 10px;
  padding: 10px;
  resize: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ===== Comments ===== */
.comments {
  text-align: left;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* fills remaining space */
}

#commentList {
  height: 200px;       /* fixed height */
  overflow-y: auto;    /* scrollbar appears when needed */
  margin-bottom: 0.5rem;
  padding-right: 5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comment {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.6rem;
  border-radius: 8px;
  font-size: 0.9rem;
  word-wrap: break-word; /* long text wraps */
}

/* Chat input & button spacing */
.comments textarea {
  margin-top: 0.5rem;
}

.comments button {
  margin-top: 0.3rem;
}

/* ===== Footer ===== */
footer {
  margin-bottom: 2rem;
  position: relative;
  z-index: 10;
}

/* ===== Study Widget ===== */
.study-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 1rem 1.5rem;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 1s ease forwards;
  z-index: 10;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.4;
  width: fit-content;
}

.study-widget h3 {
  margin: 0;
  font-size: 1rem;
}

.study-widget p {
  margin: 0.3rem 0 0 0;
  opacity: 0.9;
  font-size: 0.85rem;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Floating Social Bar ===== */
.floating-socials {
  position: fixed;
  top: 50%;
  left: 25px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 999;
  opacity: 0.9;
  animation: fadeInLeft 1s ease;
}

.floating-socials a img {
  width: 32px;
  height: 32px;
  filter: invert(1);
  opacity: 0.7;
  transition: all 0.3s ease;
}

.floating-socials a img:hover {
  opacity: 1;
  transform: scale(1.2);
  filter: invert(80%) sepia(60%) saturate(400%) hue-rotate(180deg);
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translate(-20px, -50%); }
  to { opacity: 1; transform: translate(0, -50%); }
}

/* ===== Dark Mode ===== */
.dark {
  background: linear-gradient(135deg, #2b2d42, #3a0ca3, #4361ee);
}

.dark section {
  background: rgba(255, 255, 255, 0.08);
}

.dark textarea {
  background: rgba(255, 255, 255, 0.1);
}

.dark .floating-socials a img {
  filter: invert(0.9);
}
