/* ========================================================
   STREAMCAL - Ultra-lightweight Catbox-style CSS
   Zero-bloat, high-performance, responsive & smooth design
   ======================================================== */

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

:root {
  --bg-color: #0b0d14;
  --surface-color: #121520;
  --surface-alt: #1a1e2e;
  --border-color: #262b3d;
  --border-focus: #6366f1;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-primary: #6366f1;
  --accent-hover: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-brand: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="light"] {
  --bg-color: #f8fafc;
  --surface-color: #ffffff;
  --surface-alt: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #6366f1;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 10px -1px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 20px -3px rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  text-decoration: underline;
}

/* Container */
.container {
  max-width: 840px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

/* Streamcal Brand Text - Pure Crisp White with Stylish Typography */
.streamcal-brand {
  font-family: var(--font-brand);
  color: #ffffff !important;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: inline-block;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.35), 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, text-shadow 0.2s ease;
}

.streamcal-brand:hover {
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.55), 0 2px 6px rgba(0, 0, 0, 0.6);
  transform: translateY(-1px);
}

/* Navigation Header */
.site-nav {
  background-color: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  text-decoration: none !important;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.nav-links a:hover {
  color: var(--text-main);
}

.theme-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

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

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 40px 0 26px 0;
}

.mascot-large {
  width: 82px;
  height: 82px;
  margin-bottom: 14px;
  animation: floatBounce 3s ease-in-out infinite;
}

@keyframes floatBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hero-title {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 8px;
}

.hero-title .streamcal-brand {
  font-size: 2.6rem;
  vertical-align: middle;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 580px;
  margin: 0 auto;
}

/* Main Upload Card */
.main-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 30px;
}

/* Tabs */
.tabs-header {
  display: flex;
  background-color: var(--surface-alt);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 14px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

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

.tab-btn.active {
  color: #ffffff;
  border-bottom-color: var(--accent-primary);
  background-color: var(--surface-color);
}

.tab-content {
  display: none;
  padding: 24px;
}

.tab-content.active {
  display: block;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 48px 20px;
  text-align: center;
  background-color: var(--surface-alt);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-primary);
  background-color: rgba(99, 102, 241, 0.08);
  transform: scale(0.997);
}

.dropzone-icon {
  width: 54px;
  height: 54px;
  margin-bottom: 12px;
  color: var(--accent-primary);
}

.dropzone-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.dropzone-subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.file-input {
  display: none;
}

/* Upload Progress / Queue List */
.queue-container {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.queue-item {
  background: var(--surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.queue-name {
  font-weight: 600;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-size {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
  transition: width 0.15s ease;
}

/* Result Item (Catbox style link box) */
.result-card {
  margin-top: 20px;
  background: var(--surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
}

.result-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.result-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--success-color);
  font-size: 0.95rem;
}

.url-box {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.url-input {
  flex: 1;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.95rem;
  outline: none;
}

.url-input:focus {
  border-color: var(--border-focus);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

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

.btn-secondary {
  background: var(--surface-alt);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

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

.copy-btn {
  min-width: 100px;
}

/* Preview and code formats */
.preview-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 14px;
}

.thumb-preview {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #000;
}

.code-formats {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
}

.code-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.code-label {
  width: 70px;
  color: var(--text-dim);
  font-weight: 600;
}

.code-snippet {
  flex: 1;
  background: var(--surface-color);
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  font-family: monospace;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

/* URL Upload Tab */
.url-upload-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.input-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.url-upload-input-group {
  display: flex;
  gap: 10px;
}

/* History / Recent Uploads Table */
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.history-table th, .history-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.history-table th {
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.history-thumb {
  width: 38px;
  height: 38px;
  border-radius: 4px;
  object-fit: cover;
}

.empty-state {
  text-align: center;
  padding: 30px;
  color: var(--text-dim);
}

/* Info Section */
.info-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.info-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
}

.info-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.info-card p {
  color: var(--text-muted);
  font-size: 0.87rem;
  line-height: 1.5;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background: var(--surface-color);
  padding: 24px 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-dim);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .hero-title {
    font-size: 1.8rem;
  }
  .hero-title .streamcal-brand {
    font-size: 2rem;
  }
  .url-upload-input-group {
    flex-direction: column;
  }
  .preview-row {
    flex-direction: column;
    align-items: center;
  }
  .thumb-preview {
    width: 100%;
    max-width: 200px;
    height: 120px;
  }
  .code-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
