:root {
  --bg-primary: #090d16;
  --bg-card: rgba(17, 24, 39, 0.7);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(29, 155, 240, 0.4);
  --primary-accent: #1d9bf0;
  --primary-hover: #1a8cd8;
  --purple-glow: #8b5cf6;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --success: #10b981;
  --error: #ef4444;
  --radius-lg: 18px;
  --radius-md: 12px;
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  padding: 2rem 1rem;
  position: relative;
}

/* Background Glow Effects */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(130px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.25;
}

.bg-glow-1 {
  width: 500px;
  height: 500px;
  background: var(--primary-accent);
  top: -100px;
  left: -100px;
}

.bg-glow-2 {
  width: 450px;
  height: 450px;
  background: var(--purple-glow);
  bottom: -100px;
  right: -100px;
}

/* Main Layout Container */
.app-container {
  width: 100%;
  max-width: 620px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Header */
.header {
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(29, 155, 240, 0.12);
  border: 1px solid rgba(29, 155, 240, 0.3);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--primary-accent);
  margin-bottom: 0.75rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--primary-accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--primary-accent);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(29, 155, 240, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(29, 155, 240, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(29, 155, 240, 0); }
}

h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.x-brand {
  color: #ffffff;
  background: linear-gradient(135deg, #ffffff 0%, #1d9bf0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Account Banner */
.account-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
}

.acc-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.x-logo-icon {
  width: 18px;
  height: 18px;
  fill: #ffffff;
}

.acc-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.acc-handle {
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 500;
}

.status-dot {
  width: 6px;
  height: 6px;
  background-color: var(--success);
  border-radius: 50%;
}

/* Server Config Box */
.server-config-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
}

.server-input-wrapper {
  display: flex;
  gap: 8px;
}

.server-input-wrapper input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
}

.server-input-wrapper input:focus {
  border-color: var(--primary-accent);
}

/* Dropzone */
.dropzone {
  position: relative;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 2.2rem 1.5rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.25s ease;
  cursor: pointer;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary-accent);
  background: rgba(29, 155, 240, 0.05);
  box-shadow: 0 0 20px var(--border-glow);
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-icon-wrapper {
  width: 52px;
  height: 52px;
  background: rgba(29, 155, 240, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem auto;
  color: var(--primary-accent);
}

.icon {
  width: 24px;
  height: 24px;
}

.dropzone h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.dropzone p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.browse-link {
  color: var(--primary-accent);
  font-weight: 500;
  text-decoration: underline;
}

.file-limits {
  font-size: 0.75rem;
  color: #6b7280;
}

/* Image Preview */
.image-preview-wrapper {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.image-preview-wrapper img {
  max-height: 240px;
  max-width: 100%;
  border-radius: var(--radius-md);
  object-fit: contain;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.remove-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid var(--bg-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.remove-btn svg {
  width: 14px;
  height: 14px;
}

.preview-filename {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Form Controls */
.input-group {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
}

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

textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--text-main);
  font-size: 0.92rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease;
}

textarea:focus {
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px rgba(29, 155, 240, 0.15);
}

.char-count {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  width: 100%;
  margin-top: 1.25rem;
  background: linear-gradient(135deg, #1d9bf0 0%, #1a8cd8 100%);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(29, 155, 240, 0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 25px rgba(29, 155, 240, 0.5);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-x-icon {
  width: 16px;
  height: 16px;
  fill: #ffffff;
}

.btn-secondary {
  background: rgba(29, 155, 240, 0.15);
  color: var(--primary-accent);
  border: 1px solid rgba(29, 155, 240, 0.3);
  padding: 10px 16px;
  font-size: 0.88rem;
}

.btn-secondary:hover {
  background: rgba(29, 155, 240, 0.25);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-ghost:hover {
  color: var(--text-main);
}

.btn-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Progress Section */
.progress-section {
  padding: 16px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1d9bf0, #8b5cf6);
  transition: width 0.4s ease;
}

.step-log {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Result Section */
.result-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  animation: fadeIn 0.4s ease;
}

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

.success-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.success-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-icon svg {
  width: 22px;
  height: 22px;
}

.success-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.success-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.link-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.link-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.link-input-wrapper {
  display: flex;
  gap: 8px;
}

.link-input-wrapper input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--primary-accent);
  font-weight: 500;
  font-size: 0.9rem;
  outline: none;
}

.action-buttons {
  display: flex;
  gap: 10px;
}

.action-buttons .btn {
  flex: 1;
}

/* Error Section */
.error-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-md);
  color: var(--text-main);
}

.error-icon {
  font-size: 1.5rem;
}

.error-content h4 {
  font-size: 0.95rem;
  color: var(--error);
}

.error-content p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Utility */
.hidden {
  display: none !important;
}

.footer {
  text-align: center;
  font-size: 0.8rem;
  color: #6b7280;
}
