@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-tertiary: #1a1a24;
  --accent-primary: #00d9ff;
  --accent-secondary: #7c3aed;
  --accent-tertiary: #f59e0b;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #6b6b7a;
  --border-color: rgba(255, 255, 255, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);

  /* Form Status Variables */
  --success: #00ff9d;
  --danger: #ff4d6d;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
  min-height: 100%;
}

/* Custom Cursor */
.cursor-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease;
}

.cursor-outline {
  width: 40px;
  height: 40px;
  border: 2px solid var(--accent-primary);
  border-radius: 50%;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: all 0.15s ease;
  opacity: 0.5;
}

/* Sidebar Navigation */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 80px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}

.logo {
  margin-top: 2rem;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

.side-nav a {
  text-decoration: none;
}

.nav-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  position: relative;
  transition: all 0.3s ease;
  display: block;
  cursor: none;
}

.nav-dot.active {
  background: var(--accent-primary);
  box-shadow: 0 0 20px rgba(0, 217, 255, 0.5);
  transform: scale(1.3);
}

.nav-label {
  position: absolute;
  left: 30px;
  white-space: nowrap;
  background: var(--bg-tertiary);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.nav-dot:hover .nav-label {
  opacity: 1;
  left: 35px;
}

/* Hide legacy elements */
#menuToggle,
#drawer {
  display: none !important;
}

/* Main Layout Setup */
.main-content {
  margin-left: 80px;
  min-height: 100vh;
  padding: 24px 60px 60px;
  max-width: 1400px;
  margin-right: auto;
}

/* Header */
.app-header {
  background: transparent !important;
  border-bottom: none !important;
  backdrop-filter: none !important;
  padding: 16px 0 40px !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 10;
}

.auth-box {
  display: flex;
  align-items: center;
  gap: 15px;
}

#authStatus {
  color: var(--text-secondary);
  font-size: 14px;
  font-family: 'JetBrains Mono', monospace;
}

.app-header h1 {
  font-size: 2rem;
  margin: 0;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Hide old tabs container entirely but keep HTML footprint since profile.js binds it */
.tabs {
  display: none;
}

/* Panels (Tab switching targets) */
.panel {
  display: none;
}

.panel.is-active {
  display: block;
  background-color: transparent !important;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Root Header Texts adjustments */
.panel h2 {
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.panel>p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
}

/* Core Component - Glass Cards */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

/* Grid Layout for Products and similar */
.grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Project Tiles (for the product grid mapping) */
.product-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.4s ease;
}

.product-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-primary);
  box-shadow: 0 15px 30px rgba(0, 217, 255, 0.15);
}

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.product-card .category {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent-secondary);
  margin-bottom: 0.5rem;
}

.product-card .price {
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 1.2rem;
  margin-top: 0.5rem;
}

/* Forms */
.form-field {
  margin-bottom: 20px;
}

.form-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'JetBrains Mono', monospace;
}

.form-field input:not([type="file"]) {
  width: 100%;
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'Space Grotesk', sans-serif;
  transition: all 0.3s ease;
  cursor: none;
}

.form-field input:focus {
  outline: none;
  border-color: var(--accent-primary) !important;
  background: rgba(0, 217, 255, 0.05) !important;
  box-shadow: 0 0 15px rgba(0, 217, 255, 0.1);
}

.hint {
  display: block;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hint.error {
  color: var(--danger);
}

/* Buttons */
.button,
.project-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.8rem 1.6rem;
  background: var(--glass-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px;
  color: var(--accent-primary) !important;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  cursor: none;
  /* Required for custom cursor */
}

.button:hover,
.project-btn:hover {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--bg-primary);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 217, 255, 0.3);
}

.button.ghost {
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
  border-color: transparent;
}

.button.ghost:hover {
  color: var(--accent-primary);
  background: var(--glass-bg);
  border-color: var(--border-color);
}

.button.secondary {
  border-color: var(--accent-secondary);
  color: var(--accent-secondary);
}

.button.secondary:hover {
  background: var(--accent-secondary);
  color: var(--text-primary);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3);
}

/* Actions block for forms */
.actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* Profile Specific Layout */
.profile-header {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px dashed var(--border-color);
}

.avatar-container {
  position: relative;
}

.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--accent-primary);
  box-shadow: 0 0 25px rgba(0, 217, 255, 0.3);
  object-fit: cover;
  background: var(--bg-tertiary);
}

.avatar-upload-label {
  position: absolute;
  bottom: -5px;
  right: -5px;
  background: var(--bg-tertiary);
  border: 2px solid var(--accent-primary);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
  transition: transform 0.2s;
  color: var(--text-primary);
}

.avatar-upload-label:hover {
  transform: scale(1.15);
  background: var(--accent-primary);
}

#displayName {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

#displayEmail {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-secondary);
  font-size: 1rem;
}

/* Integrations & Video */
.source-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

video {
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  margin-top: 1rem;
}

/* Responsive Overrides */
@media (max-width: 1024px) {
  .sidebar {
    width: 60px;
  }

  .main-content {
    margin-left: 60px;
    padding: 20px 30px;
  }

  .nav-label {
    display: none;
  }
}

@media (max-width: 768px) {
  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .main-content {
    margin-left: 0;
    padding-bottom: 100px;
  }

  .sidebar {
    width: 100%;
    height: 60px;
    top: auto;
    bottom: 0;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--border-color);
    padding: 0 20px;
    justify-content: space-between;
  }

  .sidebar-content {
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
    gap: 0;
  }

  .side-nav {
    flex-direction: row;
    gap: 1.5rem;
  }

  .logo {
    margin-top: 0;
  }

  /* Disable custom cursor entirely on mobile since it feels buggy */
  .cursor-dot,
  .cursor-outline {
    display: none !important;
  }

  body,
  a,
  button,
  input {
    cursor: auto !important;
  }
}