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

/* ═══════════════════════════════════════════════════
   COLOR THEME — derived from the Syntex Sync logo
   Cyan / Teal / Deep Navy palette
   ═══════════════════════════════════════════════════ */
:root {
  /* Brand colors from logo */
  --brand-dark: #0d2137;
  --brand-navy: #1a3a5c;
  --brand-cyan: #00bcd4;
  --brand-teal: #00acc1;
  --brand-light: #4dd0e1;
  --brand-pale: #b2ebf2;
  --brand-glow: #00e5ff;

  /* UI tokens */
  --bg: #eef5f7;
  --bg-gradient-top: linear-gradient(180deg, #b2ebf2 0%, #eef5f7 100px);
  --card-bg: #ffffff;
  --card-shadow: 0 2px 20px rgba(0, 188, 212, 0.08), 0 1px 4px rgba(0,0,0,0.04);
  --card-radius: 16px;

  --text-primary: #1a2744;
  --text-secondary: #607d8b;
  --text-muted: #90a4ae;

  --border: #e0e0e0;
  --border-light: #f0f0f0;

  --accent: var(--brand-cyan);
  --accent-hover: var(--brand-teal);
  --accent-bg: rgba(0, 188, 212, 0.08);
  --accent-bg-hover: rgba(0, 188, 212, 0.14);

  --success: #26a69a;
  --danger: #ef5350;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Gradient accent bar at very top */
body::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-dark), var(--brand-cyan), var(--brand-light), var(--brand-glow));
}

/* ═══════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════ */
#header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-light);
}

.logo-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-img {
  height: 80px;
  width: auto;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brand-dark);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-accent {
  background: linear-gradient(135deg, var(--brand-cyan), var(--brand-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.network-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--accent-bg);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(0, 188, 212, 0.15);
}

.network-pill i {
  color: var(--brand-cyan);
  font-size: 0.8rem;
}

.net-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  background: rgba(0, 188, 212, 0.12);
  color: var(--brand-teal);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
}

.room-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f5f5f5;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  transition: border-color 0.3s;
}

.room-pill:focus-within {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1);
}

.room-pill i {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.room-pill input {
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text-primary);
  width: 100px;
}

.room-pill input::placeholder {
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════
   MAIN — centered card layout
   ═══════════════════════════════════════════════════ */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 20px 24px;
  min-height: 0;
}

.app-card {
  width: 100%;
  max-width: 860px;
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  display: flex;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════
   TAB SIDEBAR — vertical icon tabs like AirForShare
   ═══════════════════════════════════════════════════ */
.tab-sidebar {
  width: 72px;
  min-width: 72px;
  background: #fafafa;
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  gap: 4px;
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  position: relative;
}

.tab-btn i {
  font-size: 1.25rem;
  transition: color 0.2s;
}

.tab-btn:hover {
  color: var(--brand-cyan);
  background: var(--accent-bg);
}

.tab-btn.active {
  color: var(--brand-cyan);
  border-left-color: var(--brand-cyan);
  background: var(--accent-bg);
}

.tab-btn.active i {
  color: var(--brand-cyan);
}

/* ═══════════════════════════════════════════════════
   TAB CONTENT
   ═══════════════════════════════════════════════════ */
.tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tab-pane {
  display: none;
  flex-direction: column;
  flex: 1;
  padding: 24px 30px;
  gap: 16px;
  min-height: 0;
  overflow: auto;
}

.tab-pane.active {
  display: flex;
}

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

.pane-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.status-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.file-count-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════
   TEXT TAB
   ═══════════════════════════════════════════════════ */
textarea#text-input {
  flex: 1;
  width: 100%;
  min-height: 0;
  background: #fafcfd;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
  resize: none;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

textarea#text-input:focus {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1);
}

textarea#text-input::placeholder {
  color: var(--text-muted);
}

.pane-footer {
  display: flex;
  justify-content: flex-end;
}

.btn-save {
  padding: 10px 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-save:hover {
  background: var(--accent-bg);
  color: var(--brand-cyan);
  border-color: var(--brand-cyan);
}

.btn-save:active {
  transform: scale(0.97);
}

/* ═══════════════════════════════════════════════════
   FILES TAB — DROPZONE
   ═══════════════════════════════════════════════════ */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fafcfd;
  cursor: pointer;
  position: relative;
  transition: all 0.3s;
}

.dropzone:hover {
  border-color: var(--brand-pale);
  background: var(--accent-bg);
}

.dropzone.dragover {
  border-color: var(--brand-cyan);
  background: rgba(0, 188, 212, 0.06);
}

.dropzone-icon {
  font-size: 2.5rem;
  color: var(--brand-light);
}

.dropzone p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
  margin: 0;
}

.browse-link {
  color: var(--brand-cyan);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dropzone-hint {
  color: var(--text-muted) !important;
  font-size: 0.78rem !important;
}

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

/* ═══════════════════════════════════════════════════
   LOADER BAR
   ═══════════════════════════════════════════════════ */
.loader-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--brand-cyan), var(--brand-glow), var(--brand-cyan));
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border-radius: 4px;
  display: none;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════
   FILE LIST
   ═══════════════════════════════════════════════════ */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.file-list::-webkit-scrollbar {
  width: 5px;
}
.file-list::-webkit-scrollbar-track {
  background: transparent;
}
.file-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #fafcfd;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  transition: all 0.15s;
}

.file-item:hover {
  background: var(--accent-bg);
  border-color: rgba(0, 188, 212, 0.2);
}

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  min-width: 0;
}

.file-info i {
  color: var(--brand-light);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.file-name {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.file-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: all 0.15s;
  font-size: 0.85rem;
  text-decoration: none;
}

.icon-btn:hover {
  background: rgba(0,0,0,0.04);
  color: var(--text-primary);
}

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

.icon-btn.delete:hover {
  color: var(--danger);
}

/* ═══════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--brand-dark);
  color: #ffffff;
  padding: 12px 28px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(13, 33, 55, 0.25);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.68, -0.3, 0.265, 1.3);
  z-index: 100;
  white-space: nowrap;
}

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

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  body {
    height: auto;
    min-height: 100vh;
  }

  #header {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .logo-img {
    height: 55px;
  }

  .brand-name {
    font-size: 1.1rem;
  }

  .brand-tagline {
    font-size: 0.65rem;
  }

  .nav-right {
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
  }

  .network-pill {
    font-size: 0.75rem;
    padding: 4px 10px;
  }

  .room-pill {
    padding: 4px 10px;
  }

  .room-pill input {
    width: 70px;
    font-size: 0.75rem;
  }

  main {
    padding: 10px 10px;
    min-height: 0;
  }

  .app-card {
    flex-direction: column;
    min-height: 0;
  }

  .tab-sidebar {
    width: 100%;
    min-width: unset;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding: 0;
    gap: 0;
  }

  .tab-btn {
    flex: 1;
    flex-direction: row;
    gap: 8px;
    padding: 14px;
    border-left: none;
    border-bottom: 3px solid transparent;
    font-size: 0.75rem;
  }

  .tab-btn.active {
    border-left-color: transparent;
    border-bottom-color: var(--brand-cyan);
  }

  .tab-btn i {
    font-size: 1rem;
  }

  .tab-pane {
    padding: 20px 16px;
    overflow: visible;
  }

  .pane-header h1 {
    font-size: 1.3rem;
  }

  .dropzone {
    padding: 32px 16px;
  }

  .dropzone-icon {
    font-size: 2rem;
  }

  textarea#text-input {
    min-height: 200px;
  }
}

@media (max-width: 480px) {
  .network-pill {
    display: none;
  }
}
