/* =====================================================
   ITE STARTUP LAUNCH PAD – MAIN CSS (Design System)
   ===================================================== */

/* ---- CSS Variables (Light Mode) ---- */
:root {
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-light: rgba(37,99,235,0.1);
  --accent-light-hover: rgba(37,99,235,0.18);
  --navy: #0D1B3E;
  --navy-light: #1E3A6E;

  --bg: #F8FAFC;
  --bg-secondary: #EFF2F7;
  --card: #FFFFFF;
  --card-hover: #FAFBFF;
  --text-primary: #0D1B3E;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --border-subtle: #F1F5F9;

  --shadow-xs: 0 1px 2px rgba(13,27,62,0.05);
  --shadow-sm: 0 1px 4px rgba(13,27,62,0.08), 0 1px 2px rgba(13,27,62,0.04);
  --shadow:    0 4px 16px rgba(13,27,62,0.09), 0 2px 6px rgba(13,27,62,0.05);
  --shadow-lg: 0 10px 40px rgba(13,27,62,0.13), 0 4px 12px rgba(13,27,62,0.07);
  --shadow-accent: 0 4px 20px rgba(37,99,235,0.28);

  --sidebar-bg: #0A1628;
  --sidebar-text: #7A8FA6;
  --sidebar-active-bg: rgba(37,99,235,0.14);
  --sidebar-active-text: #60A5FA;
  --sidebar-hover-bg: rgba(255,255,255,0.05);
  --sidebar-width: 256px;
  --sidebar-collapsed: 68px;

  --topbar-bg: rgba(248,250,252,0.92);
  --topbar-border: #E2E8F0;
  --topbar-height: 62px;

  --success: #10B981;  --success-light: rgba(16,185,129,0.1);
  --warning: #F59E0B;  --warning-light: rgba(245,158,11,0.1);
  --danger:  #EF4444;  --danger-light:  rgba(239,68,68,0.1);
  --info:    #3B82F6;  --info-light:    rgba(59,130,246,0.1);
  --purple:  #8B5CF6;  --purple-light:  rgba(139,92,246,0.1);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Outfit', 'Inter', sans-serif;

  --radius-xs: 1px;
  --radius-sm: 2px;
  --radius: 3px;
  --radius-lg: 4px;
  --radius-xl: 6px;
  --radius-full: 9999px;

  --transition: 0.18s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: 0.36s cubic-bezier(0.4,0,0.2,1);
}

/* ---- Dark Mode ---- */
[data-theme="dark"] {
  --bg: #0C0C14;
  --bg-secondary: #12121E;
  --card: #181828;
  --card-hover: #1E1E30;
  --text-primary: #F0F4FF;
  --text-secondary: #8899BB;
  --text-muted: #505A70;
  --border: #252540;
  --border-subtle: #1A1A2E;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.35);
  --shadow:    0 4px 16px rgba(0,0,0,0.45);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.6);
  --shadow-accent: 0 4px 20px rgba(59,130,246,0.35);

  --sidebar-bg: #070710;
  --sidebar-text: #505A70;
  --sidebar-active-bg: rgba(59,130,246,0.14);
  --sidebar-active-text: #60A5FA;
  --sidebar-hover-bg: rgba(255,255,255,0.04);

  --topbar-bg: rgba(12,12,20,0.92);
  --topbar-border: #252540;

  --accent: #3B82F6;
  --accent-hover: #2563EB;
  --accent-light: rgba(59,130,246,0.12);
  --accent-light-hover: rgba(59,130,246,0.2);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; width: 100%; overflow-x: hidden; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  transition: background var(--transition-slow), color var(--transition-slow);
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: 0.9375rem; }
ul { list-style: none; }

/* ---- App Shell ---- */
.app-shell { display: flex; min-height: 100vh; }

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left var(--transition-slow);
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--transition-slow), transform var(--transition-slow);
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,0.03);
}
.sidebar:not(.hidden) ~ .main-wrapper { margin-left: var(--sidebar-width); }
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed ~ .main-wrapper { margin-left: var(--sidebar-collapsed); }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  height: var(--topbar-height);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  flex-shrink: 0;
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.sidebar-title {
  font-family: var(--font-display); font-weight: 700; font-size: 0.9rem;
  color: #FFF; white-space: nowrap;
  transition: opacity var(--transition), width var(--transition);
}
.sidebar.collapsed .sidebar-title { opacity: 0; width: 0; pointer-events: none; }

.sidebar-toggle-btn {
  color: var(--sidebar-text); padding: 7px; border-radius: var(--radius-sm);
  transition: all var(--transition); flex-shrink: 0;
}
.sidebar-toggle-btn:hover { background: var(--sidebar-hover-bg); color: #FFF; }

.sidebar-nav { flex: 1; padding: 10px 8px; overflow-y: auto; overflow-x: hidden; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

.nav-section { margin-bottom: 6px; }
.nav-section-label {
  font-size: 0.625rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--sidebar-text);
  padding: 8px 10px 4px; white-space: nowrap;
  transition: opacity var(--transition);
}
.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
  white-space: nowrap; text-decoration: none; margin-bottom: 1px;
}
.nav-item:hover { background: var(--sidebar-hover-bg); color: #FFF; }
.nav-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); }
.nav-item svg { flex-shrink: 0; width: 17px; height: 17px; }
.nav-item .nav-label { overflow: hidden; transition: opacity var(--transition); }
.sidebar.collapsed .nav-item .nav-label { opacity: 0; width: 0; }

.sidebar-footer { padding: 10px 8px; border-top: 1px solid rgba(255,255,255,0.05); flex-shrink: 0; }
.sidebar-user { padding: 8px 10px; overflow: hidden; }
.sidebar-user-info { display: flex; align-items: center; gap: 9px; }
.sidebar-avatar {
  width: 31px; height: 31px; border-radius: var(--radius-full);
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #FFF; flex-shrink: 0; letter-spacing: 0;
}
.sidebar-user-name { font-size: 0.8125rem; font-weight: 600; color: #FFF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 0.6875rem; color: var(--sidebar-text); white-space: nowrap; }
.sidebar.collapsed .sidebar-user-info > *:not(.sidebar-avatar) { opacity: 0; width: 0; overflow: hidden; }

.sidebar-logout-btn {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); font-size: 0.85rem; font-weight: 500;
  transition: all var(--transition); white-space: nowrap;
}
.sidebar-logout-btn:hover { background: rgba(239,68,68,0.1); color: #EF4444; }
.sidebar.collapsed .sidebar-logout-btn .nav-label { opacity: 0; width: 0; overflow: hidden; }

/* ---- Topbar ---- */
.topbar {
  height: var(--topbar-height); background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex; align-items: center; padding: 0 22px; gap: 14px;
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: background var(--transition-slow), border-color var(--transition-slow);
}
.topbar-title {
  flex: 1; font-family: var(--font-display); font-size: 1rem;
  font-weight: 600; color: var(--text-primary);
}
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.mobile-menu-btn {
  display: none; color: var(--text-primary); padding: 8px;
  border-radius: var(--radius-sm); transition: all var(--transition);
}
.mobile-menu-btn:hover { background: var(--bg-secondary); }
.theme-toggle-btn {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); background: var(--bg-secondary);
  transition: all var(--transition); border: 1px solid var(--border);
}
.theme-toggle-btn:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

/* ---- Page Content ---- */
#page-content { flex: 1; padding: 26px; overflow-y: auto; }
.page-header { margin-bottom: 26px; }
.page-title { font-family: var(--font-display); font-size: 1.625rem; font-weight: 800; color: var(--text-primary); margin-bottom: 3px; }
.page-subtitle { font-size: 0.9rem; color: var(--text-secondary); }

/* ---- Utilities ---- */
.hidden { display: none !important; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.relative { position: relative; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- Animations ---- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideOutRight { to { opacity: 0; transform: translateX(110%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--accent-light); }
  50% { box-shadow: 0 0 0 8px rgba(37,99,235,0.04); }
}
@keyframes blobFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(18px,-18px) scale(1.04); }
  66% { transform: translate(-10px,14px) scale(0.96); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-width) !important; }
  .sidebar.mobile-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar:not(.hidden) ~ .main-wrapper { margin-left: 0 !important; }
  .mobile-menu-btn { display: flex; }
  #page-content { padding: 16px; }
}

/* ---- Page Transitions & Header Offsets ---- */
:root {
  --nav-height: 68px; /* Default height */
}

.page-fade {
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}
.page-fade.fade-in {
  opacity: 1;
}

/* AGGRESSIVE MOBILE FIXES FOR 414px VIEWPORT */
@media (max-width: 768px) {
  html, body { overflow-x: hidden !important; width: 100% !important; max-width: 100% !important; }
  * { box-sizing: border-box !important; }
  p, div, span, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word !important; word-wrap: break-word !important; }
  
  .my-team-hero { 
    width: 100% !important; 
    padding: 16px !important; 
    display: flex !important; 
    flex-direction: column !important; 
    align-items: stretch !important; 
    box-sizing: border-box !important; 
  }
  
  .card-header { 
    flex-direction: column !important; 
    align-items: stretch !important; 
    gap: 12px !important; 
    white-space: normal !important;
  }
  
  .card-header .btn, .invite-actions .btn { 
    width: 100% !important; 
    white-space: normal !important; 
    text-align: center !important; 
  }
  
  .btn { 
    white-space: normal !important; 
    height: auto !important; 
    padding: 10px 14px !important; 
  }
  
  .invite-card > div { 
    flex-wrap: wrap !important; 
  }
  
  .progress-tracker {
    flex-wrap: wrap !important;
    row-gap: 36px !important;
    column-gap: 8px !important;
    justify-content: center !important;
    padding-bottom: 20px !important;
  }
  
  .table-wrapper { 
    width: 100% !important; 
    overflow-x: auto !important; 
    -webkit-overflow-scrolling: touch !important; 
  }
  
  .stats-grid, .two-col, .cards-grid { 
    grid-template-columns: 1fr !important; 
    display: grid !important; 
    width: 100% !important; 
  }
}
