/* Animated Gradient Background */
body, html {
  height: 100%;
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(120deg, #a18cd1 0%, #fbc2eb 100%);
  background-size: 200% 200%;
  animation: gradientMove 8s ease-in-out infinite;
  color: #222;
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Container and Glassmorphism */
.container {
  display: grid;
  grid-template-areas:
    "header header"
    "sidebar main"
    "footer footer";
  grid-template-columns: 220px 1fr;
  grid-template-rows: 70px 1fr 48px;
  height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
  background: rgba(255,255,255,0.12);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.18);
  backdrop-filter: blur(6px);
  overflow: hidden;
}

/* Header */
header {
  grid-area: header;
  background: rgba(99,102,241,0.95);
  color: #fff;
  display: flex;
  align-items: center;
  padding-left: 32px;
  font-size: 1.7rem;
  letter-spacing: 1px;
  font-weight: 700;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  box-shadow: 0 2px 8px rgba(99,102,241,0.08);
}

header i {
  margin-right: 12px;
  color: #38bdf8;
  animation: spin 2.5s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}

/* Sidebar Navigation */
.sidebar {
  grid-area: sidebar;
  background: rgba(255,255,255,0.85);
  border-right: 1px solid #eee;
  padding: 0;
  box-shadow: 2px 0 8px rgba(99,102,241,0.04);
  z-index: 2;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  padding: 18px 24px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  font-size: 1.08rem;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #6366f1;
  font-weight: 500;
  border-radius: 0 16px 16px 0;
}

.sidebar li.active,
.sidebar li:hover {
  background: linear-gradient(90deg, #6366f1 0%, #38bdf8 100%);
  color: #fff;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(99,102,241,0.12);
  transform: translateY(-2px) scale(1.03);
}

/* Main Content */
.main-content {
  grid-area: main;
  padding: 40px 48px;
  background: rgba(255,255,255,0.85);
  min-height: 0;
  overflow-y: auto;
  border-bottom-right-radius: 24px;
  border-top-right-radius: 24px;
  animation: fadeInSection 0.7s;
}

@keyframes fadeInSection {
  from { opacity: 0; transform: translateY(20px);}
  to { opacity: 1; transform: none;}
}

/* Card Style */
.card, .tip-card {
  background: linear-gradient(90deg, #fbc2eb 0%, #a1c4fd 100%);
  color: #222;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 18px;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(99, 99, 99, 0.08);
  transition: background 0.5s;
  animation: fadeInSection 0.7s;
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(90deg, #6366f1 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Primary Button */
.primary-btn, button {
  padding: 10px 28px;
  background: linear-gradient(90deg, #6366f1 0%, #38bdf8 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.08rem;
  cursor: pointer;
  font-weight: 600;
  margin-top: 8px;
  box-shadow: 0 2px 8px rgba(99,102,241,0.08);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.primary-btn:hover, button:hover {
  background: linear-gradient(90deg, #38bdf8 0%, #6366f1 100%);
  color: #fff;
  transform: translateY(-2px) scale(1.04);
}

/* Animations */
.animate-fadein { animation: fadeInSection 0.7s; }
.animate-pop { animation: popBtn 0.4s; }
@keyframes popBtn {
  0% { transform: scale(0.95);}
  60% { transform: scale(1.08);}
  100% { transform: scale(1);}
}
.animate-slidein { animation: slideInForm 0.7s; }
@keyframes slideInForm {
  from { opacity: 0; transform: translateX(-40px);}
  to { opacity: 1; transform: none;}
}

/* Snippet Manager */
#snippet-form {
  margin-bottom: 24px;
}
#snippet-form textarea, #snippet-form input {
  width: 100%;
  margin-bottom: 8px;
  font-family: monospace;
  border-radius: 6px;
  border: 1px solid #e0e7ff;
  padding: 8px;
  background: #f3f4f6;
  font-size: 1rem;
  transition: border 0.2s;
}
#snippet-form textarea:focus, #snippet-form input:focus {
  border: 1.5px solid #6366f1;
  outline: none;
}

#snippet-list {
  list-style: none;
  padding: 0;
}
#snippet-list li {
  background: #fff;
  border: 1px solid #e0e7ff;
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 14px;
  font-size: 0.98rem;
  box-shadow: 0 1px 4px rgba(99,102,241,0.05);
  transition: box-shadow 0.2s;
}
#snippet-list li:hover {
  box-shadow: 0 4px 16px rgba(99,102,241,0.13);
}
#snippet-list pre {
  margin: 0 0 4px 0;
  background: #f3f4f6;
  padding: 8px;
  border-radius: 4px;
  overflow-x: auto;
}

/* Home recent snippets */
#recent-snippets {
  list-style: none;
  padding: 0;
}
#recent-snippets li {
  background: #f3f4f6;
  border-radius: 8px;
  margin-bottom: 10px;
  padding: 10px;
  font-size: 0.97rem;
  box-shadow: 0 1px 4px rgba(99,102,241,0.04);
}
#recent-snippets pre {
  margin: 0 0 4px 0;
  background: #e0e7ff;
  padding: 6px;
  border-radius: 4px;
  overflow-x: auto;
}

/* Stand-up section */
#standup-result {
  font-size: 1.1rem;
  color: #222;
}

/* Analytics section */
#analytics-section {
  max-width: 600px;
}
#analytics-summary {
  font-size: 1.1rem;
  margin-top: 16px;
}

/* Ask AI section */
#explain-form textarea {
  width: 100%;
  margin-bottom: 8px;
  font-family: monospace;
  border-radius: 6px;
  border: 1px solid #e0e7ff;
  padding: 8px;
  background: #f3f4f6;
  font-size: 1rem;
}
#explain-form button {
  padding: 10px 24px;
  background: linear-gradient(90deg, #10b981 0%, #38bdf8 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
#explain-form button:hover {
  background: linear-gradient(90deg, #38bdf8 0%, #10b981 100%);
  color: #fff;
  transform: translateY(-2px) scale(1.04);
}
#explain-result {
  font-size: 1.1rem;
  color: #222;
}

/* AI Tips */
.ai-tips {
  margin-top: 12px;
  color: #6366f1;
  font-size: 0.98rem;
}

/* Footer */
footer {
  grid-area: footer;
  background: rgba(99,102,241,0.95);
  color: #fff;
  text-align: center;
  line-height: 48px;
  font-size: 1.08rem;
  letter-spacing: 0.5px;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  box-shadow: 0 -2px 8px rgba(99,102,241,0.08);
}

footer i {
  color: #fbc2eb;
  margin-right: 6px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .container {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "main"
      "footer";
    border-radius: 0;
  }
  .sidebar {
    display: flex;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid #eee;
    overflow-x: auto;
    border-radius: 0;
  }
  .sidebar ul {
    display: flex;
    width: 100%;
  }
  .sidebar li {
    flex: 1 1 0;
    text-align: center;
    border-bottom: none;
    border-right: 1px solid #f0f0f0;
    padding: 12px 0;
    border-radius: 0;
  }
  .main-content {
    padding: 24px 8px;
    border-radius: 0;
  }
}
