/*
 * Taiga Platform — Liquid Glass Design System
 * Derived from Apple Design Resources & /Users/laarkin/Downloads/DESIGN KIT
 */

@import url("./liquid-glass.css");
@import url("./responsive.css");

:root {
  --accent-blue: #0088FF;
  --destructive-red: #FF383C;
  --success-green: #2CA462;
  --dark-surface: #1A1A1A;
  --glass-bg-light: rgba(255, 255, 255, 0.72);
  --glass-bg-dark: rgba(28, 28, 30, 0.72);
  --glass-border-light: rgba(255, 255, 255, 0.45);
  --glass-border-dark: rgba(255, 255, 255, 0.12);
  --glass-blur: 20px;
  --glass-saturate: 180%;
  --container-radius: 16px;
  --button-radius: 12px;
  --capsule-radius: 20px;
  --sidebar-width: 260px;
  --mobile-tabbar-height: 83px;
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.65);
  --bg-dark: #0D0D11;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Liquid Glass background glow */
body::before {
  content: "";
  position: fixed;
  top: -20%;
  left: 10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(0, 136, 255, 0.18) 0%, rgba(44, 164, 98, 0.1) 40%, transparent 70%);
  filter: blur(80px);
  z-index: 0;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  bottom: -20%;
  right: 5%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(162, 89, 255, 0.15) 0%, rgba(0, 136, 255, 0.08) 50%, transparent 70%);
  filter: blur(80px);
  z-index: 0;
  pointer-events: none;
}

/* -------------------------------------------------------------------------- */
/* Liquid Glass Components                                                    */
/* -------------------------------------------------------------------------- */

.glass-card {
  background: var(--glass-bg-dark);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border-dark);
  border-radius: var(--container-radius);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: all 0.25s ease;
  position: relative;
  z-index: 1;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 40px 0 rgba(0, 136, 255, 0.2);
}

.btn-primary {
  background: var(--accent-blue);
  color: #FFFFFF;
  border: none;
  border-radius: var(--button-radius);
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px 0 rgba(0, 136, 255, 0.4);
}

.btn-primary:hover {
  background: #2094FF;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 rgba(0, 136, 255, 0.6);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--button-radius);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

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

.btn-destructive {
  background: var(--destructive-red);
  color: #FFFFFF;
  border-radius: var(--button-radius);
  border: none;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
}

.badge-capsule {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--capsule-radius);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  background: rgba(0, 136, 255, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(0, 136, 255, 0.3);
}

.badge-capsule.success {
  background: rgba(44, 164, 98, 0.15);
  color: var(--success-green);
  border-color: rgba(44, 164, 98, 0.3);
}

.badge-capsule.pro {
  background: linear-gradient(135deg, rgba(255, 179, 64, 0.2), rgba(255, 87, 34, 0.2));
  color: #FFB340;
  border: 1px solid rgba(255, 179, 64, 0.4);
}

/* -------------------------------------------------------------------------- */
/* Layout: Desktop Sidebar, Tablet Split, Mobile Bottom Tab Bar               */
/* -------------------------------------------------------------------------- */

.app-wrapper {
  display: flex;
  width: 100vw;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Desktop Sidebar */
.desktop-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: rgba(18, 18, 22, 0.85);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border-right: 1px solid var(--glass-border-dark);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0088FF, #2CA462);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 136, 255, 0.4);
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.nav-link.active {
  background: rgba(0, 136, 255, 0.15);
  color: var(--accent-blue);
  font-weight: 600;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 32px 40px;
  max-width: var(--content-max-width, 1440px);
  margin: 0 auto;
  width: 100%;
}

/* Mobile Bottom Tab Bar */
.mobile-tab-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-tabbar-height);
  background: rgba(18, 18, 22, 0.88);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border-top: 1px solid var(--glass-border-dark);
  padding-bottom: env(safe-area-inset-bottom, 20px);
  z-index: 100;
  justify-content: space-around;
  align-items: center;
}

.mobile-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.mobile-tab-item.active {
  color: var(--accent-blue);
}

.mobile-tab-item svg {
  width: 22px;
  height: 22px;
}

/* -------------------------------------------------------------------------- */
/* Responsive Media Queries                                                   */
/* -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  .desktop-sidebar {
    display: none;
  }
  .mobile-tab-bar {
    display: flex;
  }
  .main-content {
    padding: 20px 16px;
    padding-bottom: calc(var(--mobile-tabbar-height) + 20px);
  }
  .grid-columns {
    grid-template-columns: 1fr !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .desktop-sidebar {
    width: 220px;
    min-width: 220px;
  }
  .main-content {
    padding: 24px 28px;
  }
}

@media (min-width: 1024px) {
  .desktop-sidebar {
    width: var(--sidebar-width);
  }
}

/* -------------------------------------------------------------------------- */
/* UI Elements: Upload Zone, Category Selector, Formats, Download Box         */
/* -------------------------------------------------------------------------- */

.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--container-radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.02);
}

.dropzone.dragover {
  border-color: var(--accent-blue);
  background: rgba(0, 136, 255, 0.08);
  transform: scale(1.01);
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 24px;
}

.category-tab {
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--capsule-radius);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.category-tab:hover, .category-tab.active {
  background: rgba(0, 136, 255, 0.2);
  color: #FFFFFF;
  border-color: var(--accent-blue);
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.format-pill {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--button-radius);
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.format-pill:hover, .format-pill.selected {
  background: rgba(0, 136, 255, 0.25);
  border-color: var(--accent-blue);
  color: #FFFFFF;
  font-weight: 600;
}

/* Progress bar */
.progress-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin: 16px 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--success-green));
  width: 0%;
  transition: width 0.3s ease;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--button-radius);
  color: #FFFFFF;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: slideIn 0.3s ease;
}

.toast.success {
  background: rgba(44, 164, 98, 0.9);
  border: 1px solid rgba(44, 164, 98, 0.4);
}

.toast.error {
  background: rgba(255, 56, 60, 0.9);
  border: 1px solid rgba(255, 56, 60, 0.4);
}

.toast.info {
  background: rgba(0, 136, 255, 0.9);
  border: 1px solid rgba(0, 136, 255, 0.4);
}

.toast.warning {
  background: rgba(255, 179, 64, 0.9);
  border: 1px solid rgba(255, 179, 64, 0.4);
  color: #1A1A1A;
}

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

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: #1C1C1E;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--container-radius);
  width: 100%;
  max-width: 480px;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
