/**
 * Semtix Shared CSS
 * =================
 * Common styles used across all pages (app.html, docs.html, etc.)
 * This includes header, navigation, mobile menu, and common components.
 */

:root {
    --primary: #1d4ed8;
    --primary-light: #e0f2fe;
    --bg-cream: #fffef9;
    --surface: #ffffff;
    --border: #e5e7eb;
    --text: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --radius: 8px;
    --radius-lg: 12px;
    --accent-red: #dc2626;
    --accent-green: #16a34a;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg-cream);
    color: var(--text);
    margin: 0;
    padding: 0;
    padding-top: 56px; /* Compensate for fixed header */
    font-size: 15px;
    line-height: 1.5;
}

/* ===== HEADER / NAV ===== */
.bc-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

/* Mobile-only elements - hidden on desktop */
.bc-mobile-burger,
.bc-mobile-menu,
.bc-sidebar-overlay,
.bc-mobile-search-toggle,
.bc-mobile-search-modal {
    display: none;
}

.bc-header-left {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.bc-header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.bc-header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

/* ===== AI/NEW BUTTON ===== */
.bc-ai-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #16a34a;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.35);
    transition: all 0.2s ease;
}

.bc-ai-btn:hover {
    background: #15803d;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.5);
}

/* ===== NAVIGATION ===== */
.bc-nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.bc-nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s;
}

.bc-nav-item:hover {
    background: #f3f4f6;
    color: #111827;
}

.bc-nav-item.active {
    background: #f3f4f6;
    color: #111827;
    font-weight: 600;
}

.bc-nav-item .nav-icon {
    font-size: 16px;
    line-height: 1;
}

.bc-nav-item.hey-menu {
    position: relative;
}

.bc-nav-item .hey-badge,
.hey-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #dc2626;
    color: white;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ===== SEARCH ===== */
.bc-search-container {
    width: 240px;
    transition: all 0.3s ease;
}

.bc-search-input-wrapper {
    position: relative;
    width: 100%;
}

.bc-search-input {
    width: 100% !important;
    background: #f3f4f6 !important;
    border: 1px solid transparent !important;
    padding: 6px 12px 6px 32px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    transition: all 0.2s !important;
}

.bc-search-input:focus {
    background: white !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1) !important;
    outline: none !important;
}

.bc-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    z-index: 1;
    font-size: 12px;
}

/* ===== ONLINE USERS INDICATOR ===== */
.bc-online-indicator {
    position: relative;
    display: flex;
    align-items: center;
}

.bc-online-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 28px;
    padding: 0 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s;
    text-decoration: none;
    color: inherit;
}

.bc-online-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.bc-online-btn .bc-online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse-online 2s infinite;
}

.bc-online-btn.online-green {
    color: #059669;
    border-color: #a7f3d0;
}
.bc-online-btn.online-green:hover {
    background: #ecfdf5;
    border-color: #6ee7b7;
}
.bc-online-btn.online-green .bc-online-dot {
    background: #10b981;
}

.bc-online-btn.online-orange {
    color: #d97706;
    border-color: #fcd34d;
}
.bc-online-btn.online-orange:hover {
    background: #fffbeb;
    border-color: #fbbf24;
}
.bc-online-btn.online-orange .bc-online-dot {
    background: #f59e0b;
}

.bc-online-btn.online-red {
    color: #dc2626;
    border-color: #fca5a5;
}
.bc-online-btn.online-red:hover {
    background: #fef2f2;
    border-color: #f87171;
}
.bc-online-btn.online-red .bc-online-dot {
    background: #ef4444;
}

@keyframes pulse-online {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== USER MENU ===== */
.bc-user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bc-user-dropdown {
    position: relative;
}

.bc-user-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.15s;
}

.bc-user-dropdown-trigger:hover {
    background: #f3f4f6;
}

.bc-user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    min-width: 260px;
    z-index: 1000;
    overflow: hidden;
}

.bc-user-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: #f9fafb;
}

.bc-user-dropdown-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}

.bc-user-dropdown-email {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.bc-user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 14px;
    color: var(--text);
    text-decoration: none;
}

.bc-user-dropdown-item:hover {
    background: #f3f4f6;
}

.bc-user-dropdown-item.danger {
    color: var(--accent-red);
}

.bc-user-dropdown-item.danger:hover {
    background: #fef2f2;
}

.bc-user-dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--text-secondary);
}

.bc-user-dropdown-item.danger i {
    color: var(--accent-red);
}

/* ===== AVATAR ===== */
.bc-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    color: white;
    overflow: hidden;
    flex-shrink: 0;
}

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

/* ===== ROLE BADGES ===== */
.bc-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.bc-role-badge.superadmin {
    background: #fef3c7;
    color: #92400e;
}

.bc-role-badge.admin {
    background: #dbeafe;
    color: #1e40af;
}

.bc-role-badge.user {
    background: #f3f4f6;
    color: #4b5563;
}

.bc-role-badge.client {
    background: #dcfce7;
    color: #166534;
}

/* ===== MOBILE MENU ITEMS (base styles, shown via mobile.css) ===== */
.bc-mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-size: 16px;
    transition: background 0.2s;
}

.bc-mobile-menu-item:hover,
.bc-mobile-menu-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.bc-mobile-menu-item i {
    width: 24px;
    text-align: center;
    font-size: 18px;
}

.bc-mobile-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}

/* ===== PROJECT PROGRESS BAR ===== */
.bc-project-progress-bar {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0;
}

.bc-progress-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.bc-progress-link:hover {
    background: #f9fafb;
}

.bc-progress-content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 20px;
    width: 100%;
}

.bc-progress-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.bc-progress-label i {
    font-size: 14px;
}

.bc-progress-track {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    min-width: 100px;
}

.bc-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.bc-progress-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    white-space: nowrap;
}

.bc-progress-hours {
    font-weight: 600;
    color: var(--text);
}

.bc-progress-budget {
    color: var(--text-secondary);
}

.bc-progress-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* Progress bar color states */
.bc-project-progress-bar.bc-progress-green .bc-progress-fill {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}
.bc-project-progress-bar.bc-progress-green .bc-progress-status {
    background: #dcfce7;
    color: #166534;
}

.bc-project-progress-bar.bc-progress-orange .bc-progress-fill {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}
.bc-project-progress-bar.bc-progress-orange .bc-progress-status {
    background: #fef3c7;
    color: #92400e;
}

.bc-project-progress-bar.bc-progress-red .bc-progress-fill {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}
.bc-project-progress-bar.bc-progress-red .bc-progress-status {
    background: #fee2e2;
    color: #991b1b;
}

.bc-progress-link-icon {
    color: var(--text-muted);
    font-size: 12px;
    margin-left: 8px;
}

/* Mobile progress summary (hidden on desktop) */
.bc-progress-mobile-summary {
    display: none;
}

/* ===== COMMON BUTTONS ===== */
.bc-btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    transition: all 0.15s;
}

.bc-btn-primary:hover {
    background: #1e40af;
}

.bc-btn-new {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
}

.bc-btn-new:hover {
    background: #1e40af;
}

.bc-btn-new:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* ===== FORMS ===== */
.bc-form-group {
    margin-bottom: 16px;
}

.bc-form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text);
}

.bc-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.bc-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

/* ===== MODALS ===== */
.bc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.bc-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.bc-modal h2 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== VISIBILITY GROUPS ===== */
.bc-visibility-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bc-visibility-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    border: 2px solid transparent;
}

.bc-visibility-group.selected {
    border-color: currentColor;
}

.bc-visibility-group i {
    font-size: 12px;
}

/* Group color variants */
.bc-group-blue, .bc-badge-blue {
    background: #dbeafe;
    color: #1e40af;
}
.bc-group-green, .bc-badge-green {
    background: #dcfce7;
    color: #166534;
}
.bc-group-orange, .bc-badge-orange {
    background: #ffedd5;
    color: #9a3412;
}
.bc-group-red, .bc-badge-red {
    background: #fee2e2;
    color: #991b1b;
}
.bc-group-purple, .bc-badge-purple {
    background: #f3e8ff;
    color: #6b21a8;
}
.bc-group-pink, .bc-badge-pink {
    background: #fce7f3;
    color: #9d174d;
}
.bc-group-yellow, .bc-badge-yellow {
    background: #fef3c7;
    color: #92400e;
}
.bc-group-gray, .bc-badge-gray {
    background: #f3f4f6;
    color: #4b5563;
}

.bc-group-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-right: 4px;
}

.bc-internal-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background: #fef3c7;
    color: #92400e;
}

/* ===== LANGUAGE SELECTOR ===== */
.bc-user-dropdown-lang {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border);
}

.bc-user-dropdown-lang:hover {
    background: #f3f4f6;
}

.bc-user-dropdown-lang-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.bc-user-dropdown-lang-label i {
    width: 18px;
    text-align: center;
    color: var(--text-secondary);
}

.bc-user-dropdown-lang-value {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.bc-user-dropdown-lang-value img {
    height: 12px;
}
