/* SOLEX — True Dark Minimal Theme */

:root {
  --bg-main: #000000;
  --bg-elevated: #0f1115;
  --bg-card: #0a0a0c;
  
  --border: #1f2229;
  --border-focus: #2563EB;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #475569;
  
  --accent: #2563EB;
  --accent-hover: #1d4ed8;
  --accent-dim: rgba(37, 99, 235, 0.1);
  
  --priority-high: #ef4444;
  --priority-med: #eab308;
  --priority-low: #22c55e;
  
  --space-xs: 4px; --space-sm: 8px; --space-md: 16px; --space-lg: 24px; --space-xl: 32px;
  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; width: 100%; }
body { 
  font-family: 'Inter', -apple-system, sans-serif; 
  background: var(--bg-main); 
  color: var(--text-primary); 
  -webkit-font-smoothing: antialiased; 
  font-size: 14px; 
  line-height: 1.5;
  overflow: hidden; /* App takes over completely */
}

a { text-decoration: none; color: inherit; }
button { background: none; border: none; font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { 
  font: inherit; 
  background: var(--bg-main); 
  border: 1px solid var(--border); 
  color: var(--text-primary); 
  padding: 10px 14px; 
  border-radius: var(--radius-sm);
  outline: none; 
  width: 100%; 
  transition: all 0.2s; 
}
input:focus, textarea:focus, select:focus { 
  border-color: var(--accent); 
  box-shadow: 0 0 0 2px var(--accent-dim);
}

/* Auth View */
#auth-view {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-main);
  z-index: 1000;
}

/* Layout */
.app-container { 
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex; 
  flex-direction: row;
}

.sidebar { 
  width: 240px; 
  background: var(--bg-main); 
  border-right: 1px solid var(--border); 
  display: flex; 
  flex-direction: column; 
  z-index: 10; 
  flex-shrink: 0;
}

.main-content { 
  flex: 1; 
  display: flex; 
  flex-direction: column; 
  min-width: 0; 
  background: var(--bg-main);
}

.top-bar { 
  height: 64px; 
  background: var(--bg-main); 
  border-bottom: 1px solid var(--border); 
  display: flex; 
  align-items: center; 
  justify-content: flex-end; 
  padding: 0 var(--space-xl); 
  flex-shrink: 0; 
}

.content-area { 
  flex: 1; 
  overflow-y: auto; 
  padding: var(--space-xl); 
}

/* Branding */
.brand { 
  height: 64px; 
  display: flex; 
  align-items: center; 
  padding: 0 var(--space-lg); 
  border-bottom: 1px solid var(--border); 
}
.brand-text { 
  font-size: 18px; 
  font-weight: 700; 
  letter-spacing: 1px; 
  color: var(--text-primary); 
}
.brand-dot { color: var(--accent); }

/* Navigation */
.nav-menu { padding: var(--space-md) 0; flex: 1; overflow-y: auto; }
.nav-item { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  padding: 10px var(--space-lg); 
  color: var(--text-secondary); 
  margin: 4px var(--space-sm); 
  border-radius: var(--radius-sm); 
  transition: 0.2s; 
}
.nav-item:hover { color: var(--text-primary); background: var(--bg-elevated); }
.nav-item.active { color: var(--text-primary); background: var(--accent-dim); font-weight: 500; border-left: 3px solid var(--accent); }
.nav-label { font-size: 14px; }

/* Buttons */
.btn { 
  padding: 10px 18px; 
  border-radius: var(--radius-sm); 
  font-weight: 500; 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  gap: 8px; 
  font-size: 14px; 
  transition: all 0.2s; 
  border: 1px solid transparent; 
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-elevated); border-color: var(--border); color: var(--text-primary); }
.btn-secondary:hover { border-color: var(--text-secondary); }
.btn-danger { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); color: var(--priority-high); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); }

.btn-icon { 
  padding: 8px; 
  color: var(--text-secondary); 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  border-radius: var(--radius-sm);
  transition: 0.2s;
}
.btn-icon:hover { color: var(--text-primary); background: var(--bg-elevated); }

/* Dashboard Tasks specific */
.dashboard-title { font-size: 24px; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; }
.dashboard-subtitle { font-size: 36px; font-weight: 700; margin-bottom: 40px; letter-spacing: -1px; color: var(--text-primary); }

.dt-list { display: flex; flex-direction: column; gap: var(--space-md); max-width: 800px; }
.dt-item { 
  display: flex; 
  align-items: center; 
  padding: 16px 20px; 
  background: var(--bg-card); 
  border: 1px solid var(--border); 
  border-radius: var(--radius-md);
  transition: all 0.2s; 
}
.dt-item:hover { border-color: var(--text-tertiary); box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
.dt-item-info { flex: 1; min-width: 0; }
.dt-item-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.dt-item-meta { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.dt-item-actions { display: flex; gap: 8px; margin-left: 16px; }

.dt-finish-btn { 
  background: var(--accent-dim); 
  border: 1px solid var(--accent); 
  color: var(--accent); 
  padding: 8px 20px; 
  border-radius: var(--radius-sm);
  font-size: 13px; 
  font-weight: 600; 
  transition: 0.2s; 
}
.dt-finish-btn:hover { background: var(--accent); color: #fff; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: center; z-index: 2000; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal { background: var(--bg-main); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; max-width: 500px; max-height: 90vh; display: flex; flex-direction: column; transform: translateY(10px); transition: transform 0.2s; box-shadow: 0 20px 40px rgba(0,0,0,0.8); margin: 16px; }
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 20px; }
.modal-footer { padding: 20px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; background: var(--bg-card); border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); }

.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }

/* Utility */
.page-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 32px; border-bottom: 1px solid var(--border); padding-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.page-title { font-size: 28px; font-weight: 600; color: var(--text-primary); }
.page-subtitle { color: var(--text-secondary); margin-top: 6px; font-size: 14px; }

.content-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.empty-state { text-align: center; padding: 64px 20px; color: var(--text-tertiary); background: var(--bg-card); border: 1px dashed var(--border); border-radius: var(--radius-md); font-size: 15px; }

.badge { display: inline-flex; align-items: center; padding: 4px 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.5px; border-radius: var(--radius-sm); background: var(--bg-elevated); color: var(--text-secondary); }

/* Channels */
.channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-md); }
.channel-card { background: var(--bg-card); border: 1px solid var(--border); padding: 20px; display: flex; align-items: center; gap: 16px; border-radius: var(--radius-md); transition: 0.2s; }
.channel-card:hover { border-color: var(--text-tertiary); }
.channel-logo { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: var(--text-secondary); flex-shrink: 0; }

/* Logo Upload */
.logo-upload-preview { width: 80px; height: 80px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; overflow: hidden; }
.logo-upload-preview img { width: 100%; height: 100%; object-fit: cover; }

/* Mobile Navigation Defaults */
.mobile-nav { display: none; }

/* Mobile View adjustments */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .top-bar { display: none; }
  
  .mobile-nav { 
    display: flex; 
    position: fixed; 
    bottom: 0; left: 0; right: 0; 
    background: var(--bg-elevated); 
    border-top: 1px solid var(--border); 
    height: 72px; 
    z-index: 100; 
    justify-content: space-around; 
    align-items: center; 
    padding-bottom: env(safe-area-inset-bottom);
  }
  
  .mobile-nav-item { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    gap: 4px; 
    color: var(--text-secondary); 
    padding: 8px; 
    flex: 1; 
    height: 100%;
    transition: 0.2s;
  }
  .mobile-nav-item.active { color: var(--accent); }
  .mobile-nav-item svg { width: 24px; height: 24px; }
  .mobile-nav-label { font-size: 11px; font-weight: 500; }
  
  .content-area { 
    padding: var(--space-md); 
    padding-bottom: 100px; /* Make room for mobile nav */
  }
  
  .dt-item { flex-direction: column; align-items: flex-start; gap: 16px; }
  .dt-item-actions { margin-left: 0; width: 100%; justify-content: space-between; }
  
  .page-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .page-header > div { width: 100%; }
  .page-header > button { width: 100%; }
}
