/**
 * Friday Design System
 * Bootstrap 5.3 Light/Dark Mode
 */

/* ============================================
   Typography
   ============================================ */

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
}

.dm-mono {
    font-family: 'DM Mono', 'Courier New', monospace;
}

/* ============================================
   Color Tokens - Light Mode
   ============================================ */

:root,
[data-bs-theme="light"] {
    --friday-bg: #f5f4f0;
    --friday-surface: #ffffff;
    --friday-surface-alt: #f0efe9;
    --friday-border: #e2e0d8;
    --friday-text: #1a1917;
    --friday-text-muted: #6b6960;
    --friday-accent: #2d6a4f;
    --friday-accent-light: #d8f3dc;
    --sidebar-bg: #1a1917;
}

/* ============================================
   Color Tokens - Dark Mode
   ============================================ */

[data-bs-theme="dark"] {
    --friday-bg: #141412;
    --friday-surface: #1e1d1a;
    --friday-surface-alt: #252420;
    --friday-border: #2e2d28;
    --friday-text: #eae8e0;
    --friday-text-muted: #7a7870;
    --friday-accent: #40916c;
    --friday-accent-light: #1b3a2d;
    --sidebar-bg: #0f0f0d;
}

/* ============================================
   Base Styles
   ============================================ */

body {
    background-color: var(--friday-bg);
    color: var(--friday-text);
    margin: 0;
    padding: 0;
}

/* ============================================
   Layout Structure
   ============================================ */

.friday-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar - 240px fixed width */
.friday-sidebar {
    width: 240px;
    background-color: var(--sidebar-bg);
    color: #eae8e0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.sidebar-header .logo i {
    font-size: 1.5rem;
    color: var(--friday-accent);
}

.sidebar-header .tagline {
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--friday-text-muted);
    padding-left: 36px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    color: #d0cfc8;
    text-decoration: none;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.sidebar-nav .nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-nav .nav-item.active {
    background-color: var(--friday-accent);
    color: #fff;
}

.sidebar-nav .nav-item i {
    font-size: 1.125rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--friday-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
}

.user-action {
    font-size: 0.75rem;
    color: var(--friday-text-muted);
    text-decoration: none;
}

.user-action:hover {
    color: #fff;
}

/* Main Content Area */
.friday-main {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Topbar - 56px height, sticky */
.friday-topbar {
    height: 56px;
    background-color: var(--friday-surface);
    border-bottom: 1px solid var(--friday-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--friday-text);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Content Area */
.friday-content {
    flex: 1;
    padding: 24px;
}

/* ============================================
   Messages
   ============================================ */

.friday-messages {
    margin: 16px 24px 0;
}

.friday-messages .alert {
    border-radius: 8px;
}

/* ============================================
   Auth Layout
   ============================================ */

.friday-auth-layout {
    min-height: 100vh;
    background-color: var(--friday-bg);
}

.friday-auth-layout .card {
    border: 1px solid var(--friday-border);
    background-color: var(--friday-surface);
}

/* ============================================
   Theme Toggle
   ============================================ */

.theme-toggle-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

#theme-toggle {
    border-color: var(--friday-border);
    color: var(--friday-text);
}

#theme-toggle:hover {
    background-color: var(--friday-surface-alt);
}

/* ============================================
   Error Pages
   ============================================ */

.error-page {
    max-width: 600px;
    margin: 0 auto;
}

.error-code {
    font-size: 6rem;
    line-height: 1;
}

/* ============================================
   Bootstrap Overrides
   ============================================ */

.card {
    background-color: var(--friday-surface);
    border-color: var(--friday-border);
}

.btn-primary {
    background-color: var(--friday-accent);
    border-color: var(--friday-accent);
}

.btn-primary:hover {
    background-color: var(--friday-accent);
    border-color: var(--friday-accent);
    opacity: 0.9;
}

.form-control,
.form-select {
    background-color: var(--friday-surface);
    border-color: var(--friday-border);
    color: var(--friday-text);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--friday-surface);
    border-color: var(--friday-accent);
    color: var(--friday-text);
}

/* Dark mode specific overrides */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: var(--friday-surface-alt);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: var(--friday-surface-alt);
}

/* ============================================
   Avatar Circle
   ============================================ */

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

/* ============================================
   Kanban Board
   ============================================ */

.kanban-board {
    align-items: flex-start;
    min-height: calc(100vh - 240px);
}

.kanban-column {
    background: var(--friday-surface-alt);
    border-radius: 10px;
    padding: 12px;
}

.kanban-column-header {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--friday-text-muted);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--friday-border);
    font-weight: 600;
}

.kanban-cards {
    min-height: 100px;
}

.task-card {
    background: var(--friday-surface);
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.15s, transform 0.1s;
}

.task-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.kanban-card-ghost {
    opacity: 0.4;
    background: var(--friday-accent-light);
}

.kanban-quick-add button {
    border-style: dashed;
}

/* Slide-over styles */
.slide-over-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
}

.slide-over-backdrop.active {
    display: block;
}

.slide-over {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 600px;
    max-width: 100%;
    background: var(--friday-surface);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.slide-over.active {
    transform: translateX(0);
}

/* ============================================
   Dashboard Widgets - KPI Cards
   ============================================ */

.kpi-card {
    background: var(--friday-surface);
    border-radius: 10px;
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--friday-border);
    transition: all 0.2s ease;
}

.kpi-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.kpi-card-danger {
    border-color: #dc3545;
    background: linear-gradient(135deg, var(--friday-surface) 0%, rgba(220, 53, 69, 0.05) 100%);
}

.kpi-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--friday-text-muted);
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 36px;
    font-weight: 600;
    font-family: 'DM Mono', monospace;
    color: var(--friday-text);
    line-height: 1;
    margin-bottom: 8px;
}

.kpi-link {
    font-size: 12px;
    color: var(--friday-accent);
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
}

.kpi-link:hover {
    color: var(--friday-accent);
    text-decoration: underline;
}

.kpi-skeleton,
.widget-skeleton {
    height: 80px;
    background: linear-gradient(90deg,
        var(--friday-surface-alt) 25%,
        var(--friday-border) 50%,
        var(--friday-surface-alt) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   Dashboard Widgets - Content Widgets
   ============================================ */

.dashboard-widget {
    background: var(--friday-surface);
    border-radius: 10px;
    border: 1px solid var(--friday-border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.widget-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--friday-border);
    background: var(--friday-surface-alt);
}

.widget-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--friday-text);
    margin: 0;
}

.widget-body {
    padding: 20px;
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
}

/* Team Load specific styles */
.team-load-row {
    position: relative;
}

.team-name {
    font-weight: 500;
    color: var(--friday-text);
}

.team-count {
    font-size: 11px;
}

.team-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* Due Soon specific styles */
.task-title-col {
    width: 60%;
}

.assignee-col {
    width: 20%;
}

.due-date-col {
    width: 20%;
}

.project-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.task-link {
    color: var(--friday-text);
    text-decoration: none;
    font-weight: 500;
}

.task-link:hover {
    color: var(--friday-accent);
    text-decoration: underline;
}

/* Project Status specific styles */
.project-item {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--friday-border);
}

.project-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.project-name {
    color: var(--friday-text);
    text-decoration: none;
    font-weight: 500;
}

.project-name:hover {
    color: var(--friday-accent);
}

/* Activity Feed specific styles */
.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px;
    border-bottom: 1px solid var(--friday-border);
    transition: background-color 0.2s ease;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background-color: var(--friday-surface-alt);
}

.notification-unread {
    border-left: 3px solid var(--friday-accent);
    background-color: var(--friday-accent-light);
}

.notification-content {
    font-size: 14px;
}

.notification-text {
    margin-bottom: 4px;
}

/* Avatar styles */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--friday-accent);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 12px;
}

/* Shadow utility */
:root {
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --font-mono: 'DM Mono', 'Courier New', monospace;
}

/* ── Project List ── */
.project-row {
  background: var(--friday-surface);
  border-radius: 8px;
  border: 1px solid var(--friday-border);
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.1s, border-color 0.15s;
  color: var(--friday-text);
}

.project-row:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: var(--friday-accent);
  color: var(--friday-text);
}

.project-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--friday-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Progress bar in dark mode needs explicit track color */
.progress {
  background-color: var(--friday-border) !important;
}

/* User avatar — small variant */
.user-avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 10px;
  font-weight: 600;
}

