:root {
  --bg-main: #0B0F17;
  --bg-card: #151C28;
  --bg-card-sub: #1E2738;
  --bg-zone-hover: #232F42;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #3B82F6;
  
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-glow: rgba(37, 99, 235, 0.35);
  --accent-green: #10B981;
  --accent-green-bg: rgba(16, 185, 129, 0.12);
  --accent-red: #EF4444;
  --accent-amber: #F59E0B;

  --text-main: #F3F4F6;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

[data-theme="light"] {
  --bg-main: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-card-sub: #F8FAFC;
  --bg-zone-hover: #F1F5F9;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: #2563EB;
  
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-glow: rgba(37, 99, 235, 0.2);
  --accent-green: #059669;
  --accent-green-bg: rgba(5, 150, 105, 0.12);
  --accent-red: #DC2626;
  --accent-amber: #D97706;

  --text-main: #0F172A;
  --text-muted: #475569;
  --text-dim: #64748B;
}

[data-theme="light"] body {
  background-color: var(--bg-main);
  color: var(--text-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
}

[data-theme="light"] .logo-text h1 {
  color: #0F172A;
}

[data-theme="light"] .main-card {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  background-image: 
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.08) 0px, transparent 50%);
}

.app-container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 8px 4px;
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.logo-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  line-height: 1.1;
}

.badge-ephemeral {
  font-size: 0.68rem;
  font-weight: 600;
  color: #60A5FA;
  letter-spacing: 0.02em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.network-status {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 10px;
  border-radius: 20px;
}

.btn-theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.btn-theme-toggle:hover {
  color: var(--text-main);
  border-color: var(--primary);
  background: var(--bg-card-sub);
}

.icon-sun {
  display: none;
}

.icon-moon {
  display: block;
}

[data-theme="light"] .icon-sun {
  display: block;
  color: #D97706;
}

[data-theme="light"] .icon-moon {
  display: none;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.status-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #34D399;
}

/* Main Card */
.main-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.intro h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #FFF;
  margin-bottom: 4px;
}

.intro p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed rgba(255, 255, 255, 0.16);
  background: var(--bg-card-sub);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--border-focus);
  background: var(--bg-zone-hover);
}

.file-input-hidden {
  display: none;
}

.zone-idle-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.zone-icon-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60A5FA;
}

.zone-primary-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #F3F4F6;
}

.zone-sub-text {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Preview Selected File */
.file-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px 10px 4px;
}

.file-list-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: #38BDF8;
}

.btn-clear-all {
  background: none;
  border: none;
  color: var(--accent-red);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-clear-all:hover {
  text-decoration: underline;
}

.file-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
}

.file-list-container::-webkit-scrollbar {
  width: 4px;
}
.file-list-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.file-list-actions {
  margin-top: 10px;
}

.btn-add-more {
  width: 100%;
  padding: 10px;
  background: rgba(37, 99, 235, 0.1);
  border: 1px dashed rgba(59, 130, 246, 0.4);
  border-radius: var(--radius-sm);
  color: #93C5FD;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-add-more:hover {
  background: rgba(37, 99, 235, 0.2);
}

.file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  text-align: left;
}

.file-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: #1E293B;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.file-type-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: #EF4444;
  letter-spacing: 0.05em;
}

.file-type-tag.img-tag {
  color: #3B82F6;
}

.file-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-details {
  flex: 1;
  min-width: 0;
}

.file-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #F8FAFC;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-clear-file {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.btn-clear-file:hover {
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.15);
}

/* Multi-ticket list */
.ticket-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 6px;
  padding-right: 2px;
}

.ticket-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #111827;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.ticket-item-left {
  text-align: left;
  overflow: hidden;
  padding-right: 10px;
}

.ticket-item-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #F8FAFC;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

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

.ticket-item-code {
  font-size: 1.15rem;
  font-weight: 800;
  color: #60A5FA;
  font-family: monospace;
  background: rgba(37, 99, 235, 0.15);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  white-space: nowrap;
}

/* Progress Bar */
.upload-progress-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: #1E293B;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #2563EB, #10B981);
  transition: width 0.2s ease;
}

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

/* Submit Button */
.btn-submit {
  width: 100%;
  padding: 14px 18px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-md);
  color: #FFFFFF;
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--primary-glow);
  transition: all 0.2s ease;
}

.btn-submit:not(:disabled):hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

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

.btn-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* Success Card */
.success-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 12px 0 6px 0;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.success-icon-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-green-bg);
  color: var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.success-panel h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #FFFFFF;
}

.success-msg {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.ticket-box {
  width: 100%;
  background: #111827;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.ticket-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.ticket-code {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #60A5FA;
  font-family: monospace;
}

.ticket-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-new-upload {
  margin-top: 8px;
  width: 100%;
  padding: 12px;
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #E2E8F0;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-new-upload:hover {
  background: var(--bg-zone-hover);
}

/* Error banner */
.error-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #FCA5A5;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.4;
}

/* Footer */
.footer {
  text-align: center;
  padding: 0 4px;
}

.security-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.3;
}
