:root {
  /* Enhanced color palette */
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #a5b4fc;
  --secondary-color: #06b6d4;
  --accent-color: #f59e0b;
  --success-color: #10b981;
  
  /* Text colors */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  /* Background colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-accent: #f1f5f9;
  --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  
  /* Border and shadows */
  --border-color: #e2e8f0;
  --border-radius: 16px;
  --border-radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.12);
  --shadow-xl: 0 20px 64px rgba(15, 23, 42, 0.15);
  
  /* Transitions */
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-secondary);
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  color: var(--text-primary);
}

/* Header styling */
h1 {
  background: var(--bg-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2.5rem;
  font-weight: 800;
  text-align: center;
  margin: 2rem 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  animation: fadeInDown 0.8s ease-out;
}

h3 {
  color: var(--text-secondary);
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
}

h3::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--bg-gradient);
  border-radius: 2px;
}

/* Input area styling */
.inputarea {
  background: var(--bg-primary);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  width: min(95%, 700px);
  margin: 2rem auto;
  border: 1px solid var(--border-color);
  position: relative;
  backdrop-filter: blur(10px);
  animation: slideInUp 0.6s ease-out;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.inputarea::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--bg-gradient);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.inputarea::after {
  content: '';
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 6px;
  background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
  opacity: 0.4;
  border-radius: 3px;
}

/* Profile section in input area */
.inputarea > div:first-child {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.inputarea img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-light);
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
}

.inputarea img:hover {
  transform: scale(1.05);
  border-color: var(--primary-color);
}

.card {
  width: 280px;
  height: 60px;
  background: rgb(17, 4, 134);
  border-radius: 15px;
  box-shadow: rgb(0,0,0,0.7) 5px 5px 10px ,rgb(0,0,0,0.7) -5px 0px 10px;
  display: flex;
  color: white;
  justify-content: center;
  position: absolute; right: 30px; top: 21px;
  flex-direction: column;
  background: linear-gradient(to right, rgb(20, 30, 48), rgb(36, 59, 85));
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  overflow: hidden;
}

.card:hover {
  box-shadow: rgb(0,0,0) 5px 5px 10px ,rgb(0,0,0) -5px 0px 10px;
}

.time-text {
  font-size: 20px;
  margin-bottom: 0px;
  margin-left: 8px;
  font-weight: 600;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

.time-sub-text {
  font-size: 15px;
  margin-left: 5px;
}

.day-text {
  font-size: 15px;
  margin-top: 0px;
  margin-left: 15px;
  font-weight: 500;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

.moon {
  font-size: 20px;
  position: absolute;
  right: 15px;
  top: 15px;
  transition: all 0.3s ease-in-out;
}

.card:hover > .moon {
  font-size: 23px;
}


/* Input field styling */
.inputarea input {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition-normal);
  background: var(--bg-secondary);
  outline: none;
  resize: none;
}

.inputarea input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.inputarea input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  background: var(--bg-primary);
  transform: translateY(-1px);
}

/* Submit button styling */
#submitButton {
  background: var(--bg-gradient);
  color: white;
  padding: 0.875rem 2rem;
  border: none;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-normal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  align-self: flex-start;
}

#submitButton::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: var(--transition-normal);
}

#submitButton:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

#submitButton:hover::before {
  left: 100%;
}

#submitButton:active {
  transform: translateY(0);
}

/* Comment list container */
.comment {
  width: min(95%, 700px);
  margin: 0 auto 2rem;
}

.no-comments {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.25rem;
  margin-top: 2rem;
  animation: fadeInDown 0.5s ease-out;
}

#commentlist {
  padding: 0;
  margin: 0;
  list-style: none;
}

/* Individual comment item styling */
.comment-item {
  background: var(--bg-primary);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  position: relative;
  transition: var(--transition-normal);
  border-left: 4px solid var(--primary-light);
  animation: fadeInLeft 0.5s ease-out;
}

.comment-item:hover {
  transform: translateY(-3px) translateX(5px);
  box-shadow: var(--shadow-xl);
  border-left-color: var(--primary-color);
}

.comment-item::before {
  content: '';
  position: absolute;
  top: 1.5rem;
  left: -2px;
  width: 4px;
  height: 24px;
  background: var(--accent-color);
  border-radius: 2px;
  opacity: 0;
  transition: var(--transition-normal);
}

.comment-item:hover::before {
  opacity: 1;
}

/* Comment content layout */
.comment-item > div {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

/* Comment avatar */
.comment-avatar {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  object-fit: cover;
  border: 2px solid var(--primary-light) !important;
  box-shadow: var(--shadow-sm) !important;
  transition: var(--transition-normal) !important;
  flex-shrink: 0;
}

.comment-item:hover .comment-avatar {
  transform: scale(1.1);
  border-color: var(--primary-color) !important;
}

/* Comment content area */
.comment-content {
  flex: 1;
  margin-left: 0 !important;
}

/* Comment meta (username) */
.comment-meta {
  color: var(--text-secondary) !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  margin-bottom: 0.5rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.comment-meta::after {
  content: '•';
  color: var(--text-muted);
  font-size: 0.75rem;
}

.comment-date {
  color: var(--text-secondary) !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  margin-bottom: 0.5rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.comment-date::after {
  content: '•';
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Comment text */
.comment-content p {
  color: var(--text-primary) !important;
  margin: 0 !important;
  line-height: 1.7 !important;
  padding: 1rem !important;
  background: var(--bg-accent) !important;
  border-radius: var(--border-radius-sm) !important;
  position: relative !important;
  border: 1px solid var(--border-color);
  margin-left: 0 !important;
}

.comment-content p::before {
  content: '' !important;
  position: absolute !important;
  left: -6px !important;
  top: 1rem !important;
  width: 0 !important;
  height: 0 !important;
  border-style: solid !important;
  border-width: 6px 6px 6px 0 !important;
  border-color: transparent var(--bg-accent) transparent transparent !important;
}

#deleteButton {
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition-normal);
}

/* Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --bg-primary: #1e293b;
    --bg-secondary: #0f172a;
    --bg-accent: #334155;
    --border-color: #475569;
    --bg-gradient: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  }
  
  body {
    background-image: 
      radial-gradient(circle at 25% 25%, rgba(79, 70, 229, 0.1) 0%, transparent 50%),
      radial-gradient(circle at 75% 75%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
  }

  .inputarea input {
    background: var(--bg-accent);
  }

  .inputarea input:focus {
    background: var(--bg-primary);
  }
}

/* Responsive design */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }
  
  .inputarea {
    padding: 1.5rem;
    margin: 1rem auto;
    width: min(95%, 100%);
  }
  
  .comment {
    width: min(95%, 100%);
  }
  
  .comment-item {
    padding: 1rem;
  }
  
  .comment-item > div {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .comment-avatar {
    align-self: flex-start;
  }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    gap: 15px;
}

.pagination-controls button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background-color: #f8f8f8;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.pagination-controls button:hover:not(:disabled) {
    background-color: #e2e2e2;
}

.pagination-controls button:disabled {
    cursor: not-allowed;
    color: #ccc;
    background-color: #fdfdfd;
}

#page-info {
    font-size: 14px;
    color: #555;
}

.no-comments {
    text-align: center;
    color: #888;
    padding: 20px;
    font-style: italic;
}