/* --- DESIGN SYSTEM & TOKENS --- */
:root {
  --bg-primary: #080b11;
  --bg-secondary: #0f131f;
  --glass-bg: rgba(17, 22, 38, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-focus: rgba(99, 102, 241, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --primary-glow: rgba(99, 102, 241, 0.35);
  
  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.1);
  --color-error: #ef4444;
  --color-error-bg: rgba(239, 68, 68, 0.1);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.1);
  
  --font-family: 'Plus Jakarta Sans', 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-lg: 16px;
  --border-radius-md: 10px;
  --border-radius-sm: 6px;
}

/* --- RESET & BASIC STYLES --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Background glows */
.glow-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.15;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: #6366f1;
  top: -10%;
  right: -5%;
}

.glow-2 {
  width: 400px;
  height: 400px;
  background: #8b5cf6;
  bottom: 10%;
  left: -5%;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

p {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* --- HEADER --- */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: #8b5cf6;
}

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

.text-center {
  text-align: center;
}

.margin-top-md {
  margin-top: 1.5rem;
}

.btn-block {
  width: 100%;
}

.text-glow {
  text-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

/* --- CARDS & GLASSMORPHISM --- */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transition: var(--transition-smooth);
}

.card-header {
  margin-bottom: 1.5rem;
}

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

/* --- BUTTONS --- */
.btn {
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.8rem 1.5rem;
  border-radius: var(--border-radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

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

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: var(--border-radius-sm);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.05rem;
}

.btn-danger {
  background: var(--color-error-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--color-error);
}

.btn-icon {
  padding: 0.8rem;
  aspect-ratio: 1;
}

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

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  min-height: 48px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 1rem;
  transition: var(--transition-smooth);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--glass-border-focus);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

/* Password eye toggle wrapper */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.btn-toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
}

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

/* Checkbox alignment */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #6366f1;
  cursor: pointer;
}

.checkbox-wrapper label {
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-secondary);
  margin-bottom: 0;
  user-select: none;
}

/* --- DASHBOARD ROUTING (TABS) --- */
.dashboard-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  padding: 0.35rem;
  border-radius: var(--border-radius-lg);
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 0.75rem;
  border-radius: var(--border-radius-md);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: #fff;
  background: var(--primary-gradient);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

/* --- UPLOAD GRID & DRAG-AND-DROP --- */
.upload-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
}

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

.drop-zone {
  border: 2px dashed var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 3rem 1rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.01);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.03);
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.upload-big-icon {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.drop-zone:hover .upload-big-icon,
.drop-zone.dragover .upload-big-icon {
  color: #8b5cf6;
  transform: translateY(-4px);
}

.browse-link {
  color: #6366f1;
  text-decoration: underline;
  font-weight: 600;
}

.drop-file-info {
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-sm);
  word-break: break-all;
}

/* --- PROGRESS BAR --- */
.upload-progress-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 2rem 0;
  animation: fadeIn 0.3s ease;
}

.progress-status {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.progress-bar-wrapper {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  background: var(--primary-gradient);
  height: 100%;
  transition: width 0.1s linear;
}

.progress-percent {
  font-size: 0.8rem;
  font-weight: 700;
  align-self: flex-end;
}

/* --- RESULT PLACEHOLDER & BOX --- */
.result-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 250px;
  gap: 1rem;
  color: var(--text-muted);
}

.placeholder-icon {
  color: rgba(255, 255, 255, 0.05);
}

.link-result-container {
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 1rem 0;
}

.success-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.success-icon {
  color: var(--color-success);
}

.result-desc {
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.link-copy-box {
  display: flex;
  gap: 0.5rem;
}

.link-copy-box input {
  font-family: monospace;
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.2);
}

/* --- DATA TABLES --- */
.table-responsive {
  overflow-x: auto;
  margin-top: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.9rem;
}

.data-table th {
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.01);
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

.table-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem !important;
}

/* Settings badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-one-time {
  background: var(--color-warning-bg);
  color: #fbbf24;
}

.badge-persistent {
  background: rgba(99, 102, 241, 0.1);
  color: #818cf8;
}

.badge-expired {
  background: var(--color-error-bg);
  color: #f87171;
}

.badge-request {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

/* --- REQUEST LINKS LIST --- */
.requests-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 450px;
  overflow-y: auto;
}

.placeholder-text {
  color: var(--text-muted);
  text-align: center;
  padding: 3rem 0;
}

.request-item {
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.01);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: fadeIn 0.3s ease;
}

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

.request-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.request-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.request-url-row {
  display: flex;
  gap: 0.5rem;
}

/* --- PUBLIC PAGES STYLING --- */
.icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid var(--glass-border-focus);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem auto;
  color: #8b5cf6;
}

.shadow-pulse {
  box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
  animation: pulse 2s infinite;
}

.file-download-icon,
.file-upload-icon {
  width: 32px;
  height: 32px;
}

.file-info-badge {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 1.25rem;
  margin: 2rem 0;
  text-align: left;
}

.file-detail {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.file-detail:last-child {
  border-bottom: none;
}

.detail-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

.warning-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: var(--border-radius-sm);
  background: var(--color-warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  font-size: 0.8rem;
  line-height: 1.4;
}

.success-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--border-radius-md);
  background: var(--color-success-bg);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #34d399;
  font-size: 0.9rem;
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius-md);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 250px;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-success {
  border-left: 4px solid var(--color-success);
}

.toast-error {
  border-left: 4px solid var(--color-error);
}

.toast-info {
  border-left: 4px solid #6366f1;
}

/* --- FOOTER --- */
.app-footer {
  text-align: center;
  padding: 2.5rem 0;
  border-top: 1px solid var(--glass-border);
  margin-top: auto;
}

.app-footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- ANIMATIONS --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  70% { box-shadow: 0 0 0 12px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}
