/* Global Variable Custom Colors */
:root {
  --font-family: 'Inter', sans-serif;
  
  /* Modern Dark Palette */
  --bg-primary: #0b0c15;
  --bg-secondary: rgba(18, 20, 38, 0.65);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.4);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-inverse: #ffffff;
  
  /* Gradients */
  --grad-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --grad-btn: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --grad-btn-hover: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  
  /* Shadows & Highlights */
  --glow-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  /* System Status Colors */
  --color-green: #10b981;
  --color-red: #ef4444;
  --color-gray: #6b7280;
}

/* Reset and Core Layout */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Background Beams and Ambient Glow */
.background-beams {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.12) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(124, 58, 237, 0.08) 0px, transparent 50%);
  filter: blur(100px);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header styling */
header {
  border-bottom: 1px solid var(--border-glass);
  backdrop-filter: blur(10px);
  background-color: rgba(11, 12, 21, 0.7);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1.25rem 0;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.k8s-logo {
  font-size: 2.25rem;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
  animation: float 4s ease-in-out infinite;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.status-panel {
  display: flex;
  gap: 1rem;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.825rem;
  font-weight: 600;
}

/* Pulsing Dots for Badges */
.pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pulse.green {
  background-color: var(--color-green);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-green-anim 2s infinite;
}

.pulse.red {
  background-color: var(--color-red);
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: pulse-red-anim 2s infinite;
}

.pulse.gray {
  background-color: var(--color-gray);
}

/* Main Grid Layout */
main {
  padding-top: 3rem;
  padding-bottom: 5rem;
}

.grid {
  display: grid;
  gap: 2rem;
}

.grid-top {
  grid-template-columns: 1.3fr 1fr;
}

@media (max-width: 900px) {
  .grid-top {
    grid-template-columns: 1fr;
  }
}

/* Glassmorphism Card Design */
.card {
  border-radius: 1.25rem;
  padding: 2.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--card-shadow);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-shadow), var(--card-shadow);
}

.card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.section-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-main);
  opacity: 0.9;
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 0.75rem;
  padding: 0.85rem 1.15rem;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px var(--border-focus);
}

/* Emoji Selector Radio Buttons */
.emoji-selector {
  display: flex;
  gap: 0.75rem;
}

.emoji-option {
  cursor: pointer;
}

.emoji-option input[type="radio"] {
  display: none;
}

.emoji-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  font-size: 1.5rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.emoji-option input[type="radio"]:checked + .emoji-btn {
  background: rgba(99, 102, 241, 0.15);
  border-color: #6366f1;
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.emoji-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.05);
}

/* Submit Button */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  background: var(--grad-btn);
  color: var(--text-inverse);
  border: none;
  border-radius: 0.75rem;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
  transition: all 0.2s ease;
}

.btn-submit:hover {
  background: var(--grad-btn-hover);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

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

/* Analytics Stats Dashboard */
.stat-main {
  text-align: center;
  padding: 1.5rem 0;
}

.stat-number {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.divider {
  height: 1px;
  background: var(--border-glass);
  margin: 1.5rem 0;
}

.card-analytics h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.emoji-stats-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.emoji-stat-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.emoji-stat-icon {
  font-size: 1.25rem;
  width: 1.5rem;
  text-align: center;
}

.progress-bar-container {
  flex-grow: 1;
  height: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 9999px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.emoji-stat-count {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  min-width: 1.5rem;
  text-align: right;
}

/* Messages Section styling */
.messages-section {
  margin-top: 4rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
}

.section-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.btn-refresh {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-refresh:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Feed layout */
.messages-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 450px) {
  .messages-list {
    grid-template-columns: 1fr;
  }
}

.no-messages {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-glass);
  border-radius: 1rem;
  color: var(--text-muted);
}

/* Message Card styling */
.message-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.message-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.2);
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.message-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.author-emoji {
  font-size: 1.75rem;
  line-height: 1;
}

.message-content {
  font-size: 0.925rem;
  color: rgba(243, 244, 246, 0.85);
  word-break: break-word;
  flex-grow: 1;
}

/* Footer styling */
footer {
  border-top: 1px solid var(--border-glass);
  padding: 2rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

footer strong {
  color: var(--text-main);
}

/* Animations */
@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(5deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes pulse-green-anim {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes pulse-red-anim {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}
