/* ===== CSS Variables & Reset ===== */
:root {
  --primary-hue: 260;
  --accent-hue: 320;
  
  --color-primary: hsl(var(--primary-hue), 85%, 65%);
  --color-primary-dark: hsl(var(--primary-hue), 75%, 55%);
  --color-accent: hsl(var(--accent-hue), 85%, 65%);
  --color-bg: hsl(240, 20%, 8%);
  --color-surface: hsl(240, 15%, 12%);
  --color-glass: hsla(240, 15%, 18%, 0.7);
  --color-text: hsl(0, 0%, 95%);
  --color-text-muted: hsl(0, 0%, 70%);
  --color-border: hsla(0, 0%, 100%, 0.1);
  
  --shadow-sm: 0 2px 8px hsla(0, 0%, 0%, 0.3);
  --shadow-md: 0 4px 16px hsla(0, 0%, 0%, 0.4);
  --shadow-lg: 0 8px 32px hsla(0, 0%, 0%, 0.5);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ===== Animated Background ===== */
.background-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: 
    radial-gradient(circle at 20% 30%, hsla(var(--primary-hue), 85%, 65%, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, hsla(var(--accent-hue), 85%, 65%, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, hsla(200, 85%, 65%, 0.1) 0%, transparent 50%);
  animation: gradientShift 15s ease infinite;
}

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

/* ===== Container ===== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
}

/* ===== Header ===== */
.header {
  text-align: center;
  margin-bottom: 3rem;
  animation: fadeInDown 0.6s ease;
}

.title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientFlow 3s ease infinite;
  background-size: 200% 200%;
}

@keyframes gradientFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.subtitle {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

/* ===== Glass Card ===== */
.glass-card {
  background: var(--color-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px hsla(0, 0%, 0%, 0.6);
}

/* ===== Form Section ===== */
.form-section {
  margin-bottom: 3rem;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.75rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.entry-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background: hsla(240, 15%, 15%, 0.8);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 1rem;
  font-family: inherit;
  transition: all var(--transition-base);
  outline: none;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px hsla(var(--primary-hue), 85%, 65%, 0.2);
  background: hsla(240, 15%, 18%, 0.9);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.char-counter {
  text-align: right;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: -0.25rem;
}

.btn-submit {
  position: relative;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.btn-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, hsla(0, 0%, 100%, 0.3), transparent);
  transition: left 0.5s;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px hsla(var(--primary-hue), 85%, 65%, 0.4);
}

.btn-submit:hover::before {
  left: 100%;
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Entries Section ===== */
.entries-section {
  animation: fadeInUp 0.6s ease 0.4s both;
}

.entries-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.entry-card {
  background: var(--color-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all var(--transition-base);
  animation: slideInUp 0.4s ease both;
}

.entry-card:hover {
  transform: translateX(4px);
  border-color: hsla(var(--primary-hue), 85%, 65%, 0.5);
  box-shadow: var(--shadow-md);
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.entry-author {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--color-primary);
}

.entry-time {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.entry-content {
  color: var(--color-text);
  line-height: 1.7;
  word-wrap: break-word;
}

.loading-state,
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
}

.spinner-large {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.footer strong {
  color: var(--color-primary);
  font-weight: 600;
}

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

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

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

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .container {
    padding: 1.5rem 1rem;
  }
  
  .glass-card {
    padding: 1.5rem;
  }
  
  .entry-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .entry-time {
    font-size: 0.8125rem;
  }
}
