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

:root {
  --bg-color: #06060c;
  --panel-bg: rgba(18, 18, 30, 0.6);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(124, 92, 252, 0.2);
  --text-primary: #ffffff;
  --text-secondary: #a3a3c2;
  --primary: #7c5cfc;
  --primary-glow: rgba(124, 92, 252, 0.4);
  --accent: #9d4edd;
  --accent-glow: rgba(157, 78, 221, 0.4);
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --font-title: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  background-color: var(--bg-color);
  background-image: radial-gradient(circle at 50% 0%, #16162d 0%, #06060c 60%);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px;
  overflow-x: hidden;
}

#app {
  width: 100%;
  max-width: 540px;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px var(--border-glow);
  display: flex;
  flex-direction: column;
  min-height: 720px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Header Component */
header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: var(--font-title);
  box-shadow: 0 0 10px var(--primary-glow);
}

.logo-text {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#user-header {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 12px 4px 6px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
}

#user-pfp {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--primary);
}

#user-name {
  font-size: 13px;
  font-weight: 500;
}

/* Tab Navigation */
nav.tabs-nav {
  display: flex;
  padding: 4px;
  background: rgba(0, 0, 0, 0.2);
  margin: 16px 24px 8px 24px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--primary);
  color: var(--text-primary);
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* Main Container */
main {
  flex: 1;
  padding: 16px 24px 24px 24px;
}

.hidden {
  display: none !important;
}

/* Views Styles */
section {
  width: 100%;
}

h1, h2 {
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: -0.5px;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 8px;
  background: linear-gradient(to right, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

p.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Welcome View */
.welcome-hero {
  text-align: center;
  padding: 40px 10px;
}

.welcome-hero h1 {
  font-size: 32px;
}

.hero-glow-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  margin: 0 auto 24px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  box-shadow: 0 0 30px var(--primary-glow);
  animation: pulse 3s infinite alternate;
}

.welcome-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
  text-align: left;
}

.feature-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.feature-bullet {
  color: var(--primary);
  font-size: 18px;
  font-weight: bold;
}

.feature-text h4 {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.feature-text p {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.textarea-container {
  position: relative;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  overflow: hidden;
}

.textarea-container:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(124, 92, 252, 0.3);
}

textarea#cast-text {
  width: 100%;
  height: 120px;
  background: transparent;
  border: none;
  resize: none;
  padding: 16px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  outline: none;
}

.textarea-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.1);
  border-top: 1px solid var(--border-color);
}

.char-counter {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.char-counter.warning {
  color: var(--warning);
}

.char-counter.danger {
  color: var(--error);
}

/* Custom Select, Input, DateTime pickers */
.select-wrapper, .input-wrapper {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 14px;
  transition: all 0.2s ease;
}

.select-wrapper:focus-within, .input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(124, 92, 252, 0.3);
}

.select-wrapper select, .input-wrapper input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  height: 44px;
  outline: none;
}

.select-wrapper select option {
  background-color: #12121a;
  color: var(--text-primary);
}

.input-wrapper input[type="datetime-local"] {
  color-scheme: dark;
}

.tz-info {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
  font-style: italic;
}

/* Queue List View */
.queue-stats-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  justify-content: space-around;
  font-size: 12px;
  color: var(--text-secondary);
}

.stat-item span {
  font-weight: 700;
  color: var(--primary);
}

.queue-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-queue {
  text-align: center;
  padding: 60px 20px;
  border: 2px dashed rgba(255, 255, 255, 0.05);
  border-radius: 16px;
}

.empty-queue-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-queue h3 {
  margin-bottom: 6px;
  font-weight: 600;
}

.empty-queue p {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Cast Schedule Card */
.cast-card {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
  position: relative;
}

.cast-card:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
  border-color: var(--primary-glow);
}

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

.cast-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}

.cast-badge.pending {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.cast-badge.published {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.cast-badge.failed {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.cast-badge.cancelled {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cast-channel {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(124, 92, 252, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.cast-card-content {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.cast-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  padding-top: 10px;
}

.cast-time {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cast-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.action-btn.danger-btn:hover {
  background: var(--error);
  border-color: var(--error);
}

/* Settings View */
.settings-box {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.settings-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.settings-value {
  font-weight: 600;
}

.settings-value.pro-badge {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  box-shadow: 0 0 10px var(--primary-glow);
}

/* Signer Authorization Deep Link Overlay / QR Code */
.signer-auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
  background: rgba(124, 92, 252, 0.05);
  border-radius: 16px;
  border: 1px dashed var(--primary);
  margin-bottom: 24px;
}

.deeplink-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: 12px;
  box-shadow: 0 4px 15px var(--primary-glow);
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.deeplink-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.qr-code-placeholder {
  width: 150px;
  height: 150px;
  background: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0;
  padding: 8px;
}

.qr-code-placeholder img {
  width: 100%;
  height: 100%;
}

.polling-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--warning);
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite ease-in-out;
}

/* Elegant Buttons & Loading loaders */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--text-primary);
  border: none;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  height: 48px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow), 0 0 10px var(--accent-glow);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-secondary {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-secondary);
}

/* Loading Spinner */
.loader-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 10px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(124, 92, 252, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

/* Animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0% { box-shadow: 0 0 20px var(--primary-glow); }
  100% { box-shadow: 0 0 40px rgba(157, 78, 221, 0.6); }
}

@keyframes pulse-dot {
  0% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0.5; }
}

/* Toast Notification */
.toast-notif {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(18, 18, 30, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-notif.show {
  transform: translateX(-50%) translateY(0);
}

.toast-success { border-color: var(--success); color: var(--success); }
.toast-error { border-color: var(--error); color: var(--error); }
.toast-info { border-color: var(--primary); color: white; }

/* Responsive adjustments */
@media (max-width: 480px) {
  body {
    padding: 0;
  }
  #app {
    border-radius: 0;
    border: none;
    min-height: 100vh;
    box-shadow: none;
  }
}
