/* ==========================================================================
   Vibe Theme (Monday.com inspired) Overrides
   ========================================================================== */

/* 1. Vibe Design Tokens */
:root {
    --vibe-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --vibe-font-serif: 'Times New Roman', Times, serif;
    --vibe-font-family: var(--vibe-font-sans); /* Default */
    
    --vibe-sidebar-bg: #292f4c;
    --vibe-sidebar-text: #ffffff;
    --vibe-sidebar-hover: rgba(255, 255, 255, 0.1);
    
    --vibe-surface: #ffffff;
    --vibe-surface-hover: #f5f6f8;
    --vibe-bg: #f5f6f8;
    
    --vibe-text-main: #323338;
    --vibe-text-secondary: #676879;
    
    --vibe-border: #d0d4e4;
    --vibe-border-light: #e6e9ef;
    
    --vibe-primary: #0073ea;
    --vibe-primary-hover: #0060b9;
    
    /* Vibe Status Colors */
    --vibe-status-done: #00c875;
    --vibe-status-working: #fdab3d;
    --vibe-status-stuck: #e2445c;
    --vibe-status-default: #c4c4c4;
    
    --vibe-radius-sm: 4px;
    --vibe-radius-md: 8px;
    --vibe-radius-lg: 16px;
    --vibe-radius-full: 999px;
    
    --vibe-shadow-sm: 0 4px 8px rgba(0,0,0,0.05);
    --vibe-shadow-md: 0 8px 16px rgba(0,0,0,0.08);
}

/* Color Mode Toggle (Minimalist) */
[data-vibe-color="minimal"] {
    --vibe-status-done: #e6e9ef;
    --vibe-status-working: #e6e9ef;
    --vibe-status-stuck: #e6e9ef;
    --vibe-status-default: #e6e9ef;
    --vibe-primary: #323338;
    --vibe-primary-hover: #000000;
}

[data-vibe-color="minimal"] .vibe-board-item .dot {
    background-color: var(--vibe-status-default) !important;
}

[data-vibe-color="minimal"] .fc-event,
[data-vibe-color="minimal"] [style*="background:"],
[data-vibe-color="minimal"] [style*="background-color:"] {
    background-color: var(--vibe-status-default) !important;
    border-color: var(--vibe-status-default) !important;
    color: var(--vibe-text-main) !important;
}

[data-vibe-color="minimal"] [style*="color:"]:not([style*="color: white"]):not(.btn-primary) {
    color: var(--vibe-text-main) !important;
}

[data-vibe-font="serif"] {
    --vibe-font-family: var(--vibe-font-serif);
}

body, h1, h2, h3, h4, h5, h6, p, span, div {
    font-family: var(--vibe-font-family) !important;
}

body {
    background-color: var(--vibe-bg) !important;
    color: var(--vibe-text-main) !important;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--vibe-text-main) !important;
}

.text-muted {
    color: var(--vibe-text-secondary) !important;
}

/* 2. App Shell Layout (Vibe Style) */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: var(--vibe-sidebar-bg) !important; /* The background behind the rounded main content */
}

/* The thin leftmost navigation (Monday style) */
.vibe-nav {
    width: 64px;
    background: var(--vibe-sidebar-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    z-index: 100;
}

.vibe-nav-item {
    width: 40px;
    height: 40px;
    border-radius: var(--vibe-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--vibe-sidebar-text);
    opacity: 0.7;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vibe-nav-item svg {
    width: 24px;
    height: 24px;
}

.vibe-nav-item:hover, .vibe-nav-item.active {
    opacity: 1;
    background: var(--vibe-sidebar-hover);
}

.vibe-nav-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* The secondary sidebar (Workspaces/Boards list) */
.vibe-sidebar {
    width: 260px;
    background: var(--vibe-surface);
    border-right: 1px solid var(--vibe-border);
    border-top-left-radius: var(--vibe-radius-lg);
    display: flex;
    flex-direction: column;
    z-index: 90;
    margin-top: 8px;
    transition: width 0.3s ease;
}

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

.vibe-sidebar-header {
    padding: 24px 24px 16px 24px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--vibe-text-main);
    border-bottom: 1px solid var(--vibe-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.vibe-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.vibe-board-item {
    padding: 8px 12px;
    border-radius: var(--vibe-radius-md);
    cursor: pointer;
    color: var(--vibe-text-main);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.vibe-board-item:hover, .vibe-board-item.active {
    background: var(--vibe-surface-hover);
    color: var(--vibe-primary);
}

/* Main Content Area */
.vibe-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--vibe-surface);
    border-top-left-radius: var(--vibe-sidebar-exists ? 0 : var(--vibe-radius-lg));
    margin: 8px 8px 0 0;
    overflow: hidden;
}

.vibe-header {
    height: 64px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--vibe-border-light);
}

.vibe-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--vibe-text-main);
}

.vibe-content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    background: var(--vibe-surface);
}

/* 3. Vibe Board (Table) Styles */
.vibe-board {
    width: 100%;
    margin-bottom: 32px;
}

.vibe-board-group-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--vibe-primary);
}

.vibe-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px; /* Space between rows */
}

.vibe-table th {
    text-align: left;
    padding: 8px 16px;
    color: var(--vibe-text-secondary);
    font-weight: 400;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--vibe-border-light);
}

.vibe-table td {
    padding: 8px 16px;
    background: var(--vibe-bg);
    border-top: 1px solid var(--vibe-border-light);
    border-bottom: 1px solid var(--vibe-border-light);
    font-size: 0.95rem;
    vertical-align: middle;
}

.vibe-table tr:hover td {
    background: #eef1f6;
}

.vibe-table td:first-child {
    border-left: 1px solid var(--vibe-border-light);
    border-top-left-radius: var(--vibe-radius-sm);
    border-bottom-left-radius: var(--vibe-radius-sm);
    border-left-width: 6px;
    border-left-color: var(--vibe-primary);
}

.vibe-table td:last-child {
    border-right: 1px solid var(--vibe-border-light);
    border-top-right-radius: var(--vibe-radius-sm);
    border-bottom-right-radius: var(--vibe-radius-sm);
}

/* Vibe Pills/Badges */
.vibe-pill {
    padding: 6px 12px;
    border-radius: 2px;
    color: white;
    font-weight: 500;
    text-align: center;
    font-size: 0.85rem;
    display: inline-block;
    min-width: 100px;
}
.vibe-pill.done { background: var(--vibe-status-done); }
.vibe-pill.working { background: var(--vibe-status-working); }
.vibe-pill.stuck { background: var(--vibe-status-stuck); }
.vibe-pill.default { background: var(--vibe-status-default); }

/* Overriding old base classes to map to Vibe */
.btn-primary, .fc-button-primary {
    background: var(--vibe-primary) !important;
    color: white !important;
    border-radius: var(--vibe-radius-sm) !important;
    border: none !important;
    box-shadow: none !important;
    padding: 8px 16px;
    font-weight: 500;
}
.btn-primary:hover, .fc-button-primary:hover {
    background: var(--vibe-primary-hover) !important;
}

.card {
    background: var(--vibe-surface) !important;
    border: 1px solid var(--vibe-border-light) !important;
    border-radius: var(--vibe-radius-md) !important;
    box-shadow: var(--vibe-shadow-sm) !important;
}

/* Hide old topbar and sidebar completely when vibe is active */
.sidebar, .topbar {
    display: none !important;
}

#single-fullcalendar, #group-fullcalendar {
    min-height: 600px;
    width: 100%;
}

/* ==========================================================================
   4. Accessibility & Focus Visible Rings (WCAG AA Compliance)
   ========================================================================== */
:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--vibe-primary) !important;
    outline-offset: 2px !important;
}

/* ==========================================================================
   5. Accessible Contextual Tooltips (Mouse Hover + Keyboard Focus)
   ========================================================================== */
[data-tooltip] {
    position: relative;
}
[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 5px 10px;
    border-radius: 6px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
[data-tooltip]:hover::before,
[data-tooltip]:focus-visible::before,
[data-tooltip]:focus::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Tooltip placement options */
[data-tooltip-pos="bottom"]::before {
    top: 125%;
    bottom: auto;
    transform: translateX(-50%) translateY(-4px);
}
[data-tooltip-pos="bottom"]:hover::before,
[data-tooltip-pos="bottom"]:focus-visible::before {
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   6. Guided Onboarding Tour Component
   ========================================================================== */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(3px);
    z-index: 9000;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: auto;
}
.onboarding-overlay.active {
    opacity: 1;
}

.onboarding-popover {
    position: fixed;
    z-index: 9001;
    width: 360px;
    max-width: 90vw;
    padding: 1.25rem;
    background: var(--vibe-surface);
    border: 1px solid var(--vibe-border-light);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    color: var(--vibe-text-main);
    font-family: var(--vibe-font-sans);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.onboarding-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.onboarding-step-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--vibe-primary-light);
    color: var(--vibe-primary);
}

.onboarding-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
    color: var(--vibe-text-main);
}

.onboarding-body {
    font-size: 0.875rem;
    color: var(--vibe-text-secondary);
    line-height: 1.45;
    margin-bottom: 1.25rem;
}

.onboarding-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.onboarding-dots {
    display: flex;
    gap: 6px;
}
.onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--vibe-border);
    transition: background 0.2s;
}
.onboarding-dot.active {
    background: var(--vibe-primary);
}

.onboarding-spotlight {
    position: relative !important;
    z-index: 9002 !important;
    box-shadow: 0 0 0 4px var(--vibe-primary), 0 0 0 8px rgba(37, 99, 235, 0.2) !important;
    border-radius: 6px;
}

