/* ==========================================================================
   NEXTRA CLOUD - VERCEL & LINEAR-INSPIRED DESIGN SYSTEM
   Theme: Obsidian Dark, Glassmorphism, Laser Accents, Left Sidebar Layout
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-page: #000000;
  --bg-sidebar: #080808;
  --bg-card: #0c0c0c;
  --bg-card-hover: #141414;
  --bg-surface: #121212;
  --bg-glass: rgba(12, 12, 12, 0.85);
  --bg-input: #0e0e0e;
  
  /* Borders */
  --border-subtle: #1a1a1a;
  --border-default: #262626;
  --border-hover: #3e3e3e;
  --border-active: #ffffff;

  /* Typography */
  --text-primary: #ededed;
  --text-secondary: #a1a1a1;
  --text-muted: #666666;
  --text-inverse: #000000;

  /* Brand Accents */
  --accent-white: #ffffff;
  --accent-cyan: #0070f3;
  --accent-purple: #7928ca;
  --accent-pink: #ff0080;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-error: #ef4444;

  /* Geometry */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 150ms ease;
  --transition-normal: 250ms var(--ease-smooth);
}

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

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: 'Vazirmatn', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background Subtle Grid Effect */
.bg-grid-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.1) 80%);
  pointer-events: none;
  z-index: 0;
}

/* App Container */
.app-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ==========================================================================
   1. LANDING PAGE STYLES (HOME)
   ========================================================================== */
.landing-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.landing-nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.brand-logo img {
  height: 32px;
}

.landing-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.landing-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.landing-links a:hover {
  color: var(--text-primary);
}

/* Hero Section */
.hero-section {
  max-width: 1100px;
  margin: 4rem auto 3rem;
  padding: 0 1.5rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  background: rgba(0, 112, 243, 0.1);
  border: 1px solid rgba(0, 112, 243, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  color: #60a5fa;
  margin-bottom: 1.75rem;
}

.hero-title {
  font-size: 3.25rem;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 1.25rem;
  background: linear-gradient(180deg, #ffffff 0%, #a1a1a1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.1875rem;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 2.5rem;
  line-height: 1.75;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3.5rem;
}

/* Terminal Hero Preview */
.hero-terminal {
  max-width: 820px;
  margin: 0 auto;
  background: #080808;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  text-align: left;
  direction: ltr;
  font-family: 'Fira Code', monospace;
}

.terminal-header {
  background: #111111;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-body {
  padding: 1.25rem;
  font-size: 0.875rem;
  line-height: 1.7;
  color: #a1a1a1;
}

/* Feature Grid */
.features-section {
  max-width: 1200px;
  margin: 6rem auto;
  padding: 0 1.5rem;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.5px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 3.5rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition-normal);
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--accent-white);
}

.feature-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ==========================================================================
   2. DASHBOARD WITH LEFT SIDEBAR LAYOUT (VERCEL STYLE)
   ========================================================================== */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar on Left (fixed) */
.sidebar {
  width: 240px !important;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle) !important;
  border-left: none !important;
  display: flex !important;
  flex-direction: column;
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  right: auto !important;
  z-index: 90;
}

.sidebar-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.workspace-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.625rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0.75rem 1rem 0.375rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-pulse {
  width: 8px;
  height: 8px;
  background: var(--accent-success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-success);
}

.sidebar-menu {
  flex: 1;
  padding: 0.5rem 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  overflow-y: auto;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  width: 100%;
  text-align: right;
  transition: all var(--transition-fast);
  letter-spacing: -0.1px;
}

.sidebar-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.7;
}

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

.sidebar-item:hover svg {
  opacity: 1;
}

.sidebar-item.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-subtle);
  font-weight: 600;
}

.sidebar-item.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-profile-brief {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0070f3, #7928ca);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: #fff;
}

/* Main Workspace Area */
.main-workspace {
  flex: 1;
  margin-left: 240px !important;
  margin-right: 0 !important;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.workspace-topbar {
  height: 64px;
  padding: 0 2rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 80;
}

.workspace-content {
  flex: 1;
  padding: 2.5rem 2rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* Project & Server Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all var(--transition-normal);
}

.project-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

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

.project-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.project-domain {
  font-size: 0.8125rem;
  color: var(--accent-cyan);
  text-decoration: none;
}

.project-git-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: 'Fira Code', monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Status Pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.status-running { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.status-building { background: rgba(0, 112, 243, 0.15); color: #60a5fa; }
.status-stopped { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.status-setup { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-white);
  color: var(--text-inverse);
  border: 1px solid var(--accent-white);
}

.btn-primary:hover {
  background: #e1e1e1;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

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

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

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.9);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-input, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent-white);
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  .main-workspace {
    margin-right: 0;
  }
  .hero-title {
    font-size: 2.25rem;
  }
}
