@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-color: #ffffff;
  --text-main: #111111;
  --text-muted: #6b6b6b;
  --border-color: #e5e5e5;
  --bg-hover: #f5f5f5;
  --primary: #4a90e2;
  --danger: #e53e3e;
  
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
  
  --transition: all 0.2s ease;

  /* Pill Colors */
  --pill-gray: #f1f1f1;
  --pill-gray-text: #5a5a5a;
  --pill-blue: #e8f3fb;
  --pill-blue-text: #1d72b8;
  --pill-purple: #f3e8fd;
  --pill-purple-text: #8e2de2;
  --pill-red: #fde8e8;
  --pill-red-text: #c53030;
  --pill-green: #e8fdf0;
  --pill-green-text: #2f855a;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
}

/* Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Notion-style Top Header Bar */
.top-nav {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.select-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Cover Image */
.cover-image {
  flex-shrink: 0;
  height: 200px;
  width: 100%;
  background: linear-gradient(135deg, #1f1c2c 0%, #928dab 100%);
  background-size: cover;
  background-position: center;
}

.cover-icon-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  height: 100%;
}

.cover-icon {
  position: absolute;
  bottom: -40px;
  left: 0;
  height: 90px;
  width: auto;
  min-width: 90px;
  max-width: 250px;
  padding: 8px;
  box-sizing: border-box;
  background: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  font-size: 2.5rem;
  color: #111;
  overflow: hidden;
}

.cover-icon img {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.main-content {
  padding: 3rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.page-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-top: 1rem;
  margin-bottom: 2.5rem;
}

/* Dashboard Widgets */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.widget-block {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  background: #fbfbfb;
}

.widget-block h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.widget-links {
  list-style: none;
  font-size: 0.95rem;
}
.widget-links li {
  padding: 0.4rem 0;
}
.widget-links a {
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.widget-links a:hover {
  color: var(--text-main);
}

.team-member {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.team-member i {
  margin-top: 3px;
}
.team-member strong {
  color: var(--text-main);
}

hr.divider {
  border: 0;
  border-top: 2px solid var(--border-color);
  margin: 2rem 0;
}

/* Task Tracker Section */
.section-header {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.view-tabs {
  display: flex;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
}

.view-tab {
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.view-tab.active {
  color: var(--text-main);
  font-weight: 500;
}

/* Kanban Board */
.board-container {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  align-items: flex-start;
  padding-bottom: 2rem;
}

.kanban-column {
  flex: 1;
  min-width: 150px;
  display: flex;
  flex-direction: column;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.column-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge-count {
  opacity: 0.6;
  font-size: 0.8rem;
}

/* Pillar colors */
.bg-gray { background: var(--pill-gray); color: var(--pill-gray-text); }
.bg-blue { background: var(--pill-blue); color: var(--pill-blue-text); }
.bg-purple { background: var(--pill-purple); color: var(--pill-purple-text); }
.bg-red { background: var(--pill-red); color: var(--pill-red-text); }
.bg-green { background: var(--pill-green); color: var(--pill-green-text); }

.task-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 100px;
}

/* Task Card */
.task-card {
  padding: 1rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: grab;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: var(--transition);
}

.task-card:hover {
  border-color: #d0d0d0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.task-card:active {
  cursor: grabbing;
}

.task-title {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.4;
}

.task-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  white-space: pre-wrap;
}

.task-desc a {
  color: var(--primary);
  text-decoration: underline;
  word-break: break-all;
}

.private-note {
  background: #fff5f5;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--pill-red-text);
  border: 1px solid #fed7d7;
}

.private-note-label {
  font-weight: 600;
  font-size: 0.7rem;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  text-transform: uppercase;
}

/* Buttons and Inputs */
.btn {
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: white;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-main);
}

.btn:hover {
  background: var(--bg-hover);
}

.btn-primary {
  background: var(--text-main);
  color: white;
  border-color: var(--text-main);
}

.btn-primary:hover {
  background: #333;
}

.btn-icon {
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  display: inline-flex;
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.select, .input {
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: white;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.select:focus, .input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(2px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  width: 90%;
  max-width: 500px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

/* View Toggle (Client/Admin) */
.view-toggle {
  display: flex;
  align-items: center;
  background: var(--pill-gray);
  padding: 0.2rem;
  border-radius: var(--radius-sm);
}

.view-option {
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
}

.view-option.active {
  background: white;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  color: var(--text-muted);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  margin-top: 2rem;
}

/* Spreadsheet List View */
.list-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: white;
  margin-top: 1rem;
}

.spreadsheet-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.spreadsheet-table th {
  padding: 0.75rem 1rem;
  background: var(--pill-gray);
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
}

.spreadsheet-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: top;
}

.spreadsheet-table tr:last-child td {
  border-bottom: none;
}

.spreadsheet-table tr:hover {
  background: var(--bg-hover);
}

.spreadsheet-table .title-cell {
  font-weight: 500;
  width: 25%;
}

.spreadsheet-table .desc-cell {
  color: var(--text-muted);
  width: 40%;
}

.spreadsheet-table .status-cell {
  width: 15%;
}

.spreadsheet-table .actions-cell {
  width: 20%;
  text-align: right;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #ccc;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .top-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
  }
  
  .top-nav .view-toggle {
    position: static !important;
    transform: none !important;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-left: 0 !important;
  }
  
  .top-nav #logout-btn {
    margin-left: 0 !important;
  }
  
  .controls {
    flex-wrap: wrap;
    width: 100%;
  }

  .select-group {
    flex: 1;
    min-width: 120px;
  }
  
  select.select-glass {
    width: 100%;
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .page-header .tabs {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }
  
  .board-container {
    padding: 1rem;
  }
  
  .kanban-board {
    scroll-snap-type: x mandatory;
  }
  
  .kanban-column {
    scroll-snap-align: start;
    min-width: 280px;
  }
  
  #list-container {
    overflow-x: auto;
  }
  
  .cover-image {
    height: 120px;
  }
  
  .cover-icon-wrapper {
    bottom: -20px;
    left: 1rem;
  }
  
  .cover-icon {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }
  
  .client-meta {
    margin-top: 3rem;
    padding: 0 1rem;
  }
  
  .client-title-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .client-title-container h1 {
    font-size: 1.5rem;
  }
  
  .quick-links {
    flex-wrap: wrap;
  }
  
  .modal-content {
    width: 95%;
    padding: 1.5rem;
    margin: 1rem;
  }
}

/* Sidebar Styles */
.sidebar {
  width: 340px;
  background: var(--card-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease, transform 0.3s ease;
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 20;
}

.sidebar.collapsed {
  width: 0;
  overflow: hidden;
  padding-left: 0;
  padding-right: 0;
  border-right: none;
}

.sidebar-section h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
  .app-layout {
    position: relative;
  }
  .sidebar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    transform: translateX(0);
    width: 340px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  }
  .sidebar.collapsed {
    transform: translateX(-100%);
    width: 340px;
  }
  .sidebar-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 15;
  }
  .sidebar-overlay.active {
    display: block;
  }
}

/* Sidebar Styles */
.sidebar {
  width: 340px;
  background: var(--card-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease, transform 0.3s ease;
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 20;
}

.sidebar.collapsed {
  width: 0;
  overflow: hidden;
  padding-left: 0;
  padding-right: 0;
  border-right: none;
}

.sidebar-section h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
  .app-layout {
    position: relative;
  }
  .sidebar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    transform: translateX(0);
    width: 340px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  }
  .sidebar.collapsed {
    transform: translateX(-100%);
    width: 340px;
  }
  .sidebar-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 15;
  }
  .sidebar-overlay.active {
    display: block;
  }
}

/* Nav Tree Styles */
.tree-node {
  display: flex;
  flex-direction: column;
}

.tree-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
  user-select: none;
}

.tree-item:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.tree-item.active {
  background: var(--pill-blue);
  color: var(--pill-blue-text);
  font-weight: 500;
}

.tree-item-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  flex: 1;
  min-width: 0;
}

.tree-item-content i,
.tree-item-content svg {
  flex-shrink: 0;
}

.tree-item-content span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tree-item-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tree-item:hover .tree-item-actions {
  opacity: 1;
}

.tree-item-actions button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tree-item-actions button:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text-main);
}

.tree-item-actions button.delete-btn:hover {
  color: var(--danger);
}

.tree-children {
  display: flex;
  flex-direction: column;
  padding-left: 1.2rem;
  margin-top: 0.2rem;
  gap: 0.15rem;
}

.board-tab {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  border: 1px solid transparent;
}

.board-tab:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text-main);
}

.board-tab.active {
  background: var(--pill-blue);
  color: var(--pill-blue-text);
  font-weight: 500;
  border-color: rgba(59, 130, 246, 0.2);
}

.tree-item.drag-over {
  border-top: 2px solid var(--pill-blue);
}

.material-symbols-outlined {
  font-variation-settings:
  'FILL' 0,
  'wght' 400,
  'GRAD' 0,
  'opsz' 24;
  vertical-align: text-bottom;
}
