/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* === Site Header === */

.site-header {
  background: #1e1b4b;
  border-bottom: 2px solid #4f46e5;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.site-header-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-header-logo {
  text-decoration: none;
}

.site-header-logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ff6b9d, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav-link {
  color: #c7d2fe;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.site-nav-link:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #e0e7ff;
}

.site-nav-link.active {
  background: #4f46e5;
  color: #fff;
}

.site-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-header-user {
  color: #a5b4fc;
  font-size: 0.8125rem;
}

.site-header-logout {
  background: transparent;
  color: #a5b4fc;
  border: 1px solid #4338ca;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.site-header-logout:hover {
  background: #4338ca;
  color: #fff;
}

.site-nav-logout {
  display: none;
}

.site-nav-gemini {
  display: none;
}

.site-nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.site-nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #c7d2fe;
  border-radius: 1px;
}

@media (max-width: 768px) {
  .site-header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 0.75rem 1rem;
  }

  .site-header-left {
    flex: 1;
  }

  .site-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 0.5rem 0;
    gap: 0.125rem;
    order: 3;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav-link {
    padding: 0.5rem 0.75rem;
  }

  .site-nav-toggle {
    display: flex;
  }

  .site-header-right {
    display: none;
  }

  .site-nav-logout {
    display: block;
    border-top: 1px solid #4338ca;
    padding-top: 0.5rem;
    margin-top: 0.25rem;
  }

  .site-nav-gemini {
    display: block;
  }
}

/* === Page Comments (collapsible) === */

.page-comments-details summary {
  list-style: none;
}

.page-comments-details summary::-webkit-details-marker {
  display: none;
}

.page-comments-details summary::marker {
  display: none;
  content: "";
}

.page-comments-details .page-comments-expand-hint {
  transition: opacity 0.2s;
}

.page-comments-details[open] .page-comments-expand-hint {
  opacity: 0;
}

/* === Global overflow prevention === */

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

body {
  overflow-x: hidden;
}

.container {
  overflow-x: hidden;
}

pre {
  overflow-x: auto;
  max-width: 100%;
}

/* === Mobile padding optimization === */

@media (max-width: 768px) {
  .container {
    margin-top: 0.75rem !important;
    margin-bottom: 0.75rem !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  .container h1 {
    font-size: 1.5rem !important;
  }

  /* Card sections */
  .container > div > div[style*="padding: 2rem"],
  .container > div > div[style*="padding: 1.5rem"] {
    padding: 0.75rem !important;
  }

  /* Stats grid */
  .container div[style*="grid-template-columns"] {
    gap: 0.375rem !important;
  }

  .container div[style*="grid-template-columns"] > div {
    padding: 0.5rem !important;
  }

  .container div[style*="grid-template-columns"] > div > div:first-child {
    font-size: 1.25rem !important;
  }

  /* Task cards */
  .task-card {
    padding: 0.75rem !important;
  }

  .task-card-header {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  .task-card h3 {
    font-size: 1rem !important;
  }

  .task-badges {
    flex-wrap: wrap !important;
  }

  /* Manager chat grid to single column */
  .manager-grid {
    grid-template-columns: 1fr !important;
  }

  .manager-chat-section {
    padding: 0.75rem !important;
  }

  /* AI analysis section */
  .ai-analysis-section {
    padding: 0.75rem !important;
  }

  /* Header actions wrap */
  .tasks-page-header {
    flex-direction: column !important;
    gap: 0.25rem !important;
  }

  .tasks-header-actions {
    flex-wrap: wrap !important;
  }

  /* Activity timeline */
  .activity-task-row {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  /* Subtask items */
  .subtask-item {
    flex-direction: column !important;
    gap: 0.375rem !important;
    align-items: flex-start !important;
  }

  .subtask-badges {
    flex-wrap: wrap !important;
  }
}
