@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-gradient: linear-gradient(135deg, #080710 0%, #120e2e 50%, #05040a 100%);
  --glass-bg: rgba(20, 16, 38, 0.65);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-glow: rgba(123, 44, 191, 0.15);
  
  --color-primary: #8a2be2;
  --color-primary-glow: rgba(138, 43, 226, 0.4);
  --color-secondary: #00f5d4;
  --color-secondary-glow: rgba(0, 245, 212, 0.4);
  
  --text-main: #f3f0fc;
  --text-muted: #a5a1b8;
  
  --status-success: #00f5d4;
  --status-failed: #ff007f;
  --status-pending: #ffb703;
}

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

body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 1rem;
  overflow-x: hidden;
}

/* App Container */
.app-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.glow-text {
  font-size: 2.8rem;
  font-weight: 700;
  background: linear-gradient(to right, #ffffff, #dcd1ff, var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(138, 43, 226, 0.3);
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
}

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

/* Grid Layout */
.grid-container {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: start;
}

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

/* Glassmorphic Card */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2.2rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 0 20px var(--glass-glow);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(138, 43, 226, 0.25);
}

.card-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.8rem;
  background: linear-gradient(to right, #fff, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Sleek Form styling */
.sleek-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.form-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.form-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text-main);
  padding: 1rem 1.2rem;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.form-input:focus {
  border-color: var(--color-primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 15px var(--color-primary-glow), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

/* Premium Button */
.submit-btn {
  background: linear-gradient(135deg, var(--color-primary) 0%, #b5179e 100%);
  border: none;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px var(--color-primary-glow);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(181, 23, 158, 0.6);
  filter: brightness(1.1);
}

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

/* Flash Messages */
.flash {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.flash-notice {
  background: rgba(0, 245, 212, 0.12);
  border: 1px solid rgba(0, 245, 212, 0.3);
  color: #a3ffeb;
}

.flash-alert {
  background: rgba(255, 0, 127, 0.12);
  border: 1px solid rgba(255, 0, 127, 0.3);
  color: #ffb3d1;
}

.flash-icon {
  font-size: 1.4rem;
}

/* Error validation summary */
.error-summary {
  background: rgba(255, 0, 127, 0.08);
  border: 1px solid rgba(255, 0, 127, 0.25);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  color: #ffb3d1;
  font-size: 0.95rem;
}

.error-summary h3 {
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.error-summary ul {
  list-style-position: inside;
}

/* History List styles */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* Custom scrollbar for history list */
.history-list::-webkit-scrollbar {
  width: 6px;
}

.history-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.history-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

/* Glow line matching status */
.history-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: 2px;
}

.history-item.status-success::before {
  background: var(--status-success);
  box-shadow: 0 0 10px var(--status-success);
}

.history-item.status-failed::before {
  background: var(--status-failed);
  box-shadow: 0 0 10px var(--status-failed);
}

.history-item.status-pending::before {
  background: var(--status-pending);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-sender {
  font-weight: 600;
  color: var(--text-main);
  font-size: 1rem;
}

.item-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.item-body {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  border-left: 2px solid rgba(255, 255, 255, 0.03);
}

.item-message {
  font-size: 0.95rem;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

.item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

.status-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.75rem;
}

.badge-success {
  background: rgba(0, 245, 212, 0.15);
  color: var(--status-success);
  border: 1px solid rgba(0, 245, 212, 0.3);
}

.badge-failed {
  background: rgba(255, 0, 127, 0.15);
  color: var(--status-failed);
  border: 1px solid rgba(255, 0, 127, 0.3);
}

.badge-pending {
  background: rgba(255, 183, 3, 0.15);
  color: var(--status-pending);
  border: 1px solid rgba(255, 183, 3, 0.3);
}

.error-detail {
  color: var(--text-muted);
  cursor: help;
  font-size: 0.75rem;
  max-width: 70%;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.no-history {
  text-align: center;
  padding: 3rem 0;
  color: var(--text-muted);
  font-weight: 300;
}

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