/* css/6-canvas.css */

/* === MAIN CANVAS CARD CONTAINER === */
.main-canvas {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: none; /* Outer shadow handled by layout.css */
    border-radius: 0; /* Parent handles radius */
    background: white;
    overflow: hidden;
    max-width: 100%;
}

/* Canvas Header Row */
.main-canvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 20px;
    background: white;
    flex-shrink: 0;
    border-bottom: 2px solid #e0e0e0;
    position: relative;
}

/* Left side timeline controls */
.timeline-header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

/* Inline zoom controls in header */
.zoom-controls-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Right side action buttons */
.canvas-action-buttons-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Divider between header and canvas */
.main-canvas-divider {
    display: none; /* Using border-bottom on header instead */
}

/* Canvas body (scrollable area with canvas) */
.main-canvas-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: white;
    padding: 3.75px 5px 5px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.timeline-canvas-wrapper {
    display: none; /* Hidden: replaced by main-canvas structure */
}

/* Fixes z-index clipping issue when dropdown is open */
.main-canvas.dropdown-active {
    overflow: visible;
}

canvas {
    display: block;
    background-color: #fefefe;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: auto;
}

canvas:active {
    cursor: grabbing !important;
}

/* --- Canvas Overlays (Headers, Zoom) --- */

.canvas-header-controls {
    display: none; /* Moved into main-canvas-header */
}

/* Show when sidebar is collapsed */
.main-container.sidebar-collapsed .canvas-header-controls {
    display: none;
}

/* NEW: Style for the collapsed kebab menu */
#canvas-timeline-options {
    flex-shrink: 0;
}
#canvas-timeline-options .profile-options-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    color: #555;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
#canvas-timeline-options .profile-options-btn:hover {
    background-color: #f0f0f0;
    color: #333;
    border-color: #b0b0b0;
}
#canvas-timeline-options .profile-options-btn svg {
    fill: #555;
    width: 18px;
    height: 18px;
}

/* === Canvas dropdown === */
#canvasTimelineFilter {
    height: 36px;
    padding: 6px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 500;
    color: #333;
    background: #f9f9f9;
    cursor: pointer;
    box-shadow: none;
    position: relative; 
    z-index: 6;
    flex: 0 1 240px;
    min-width: 150px;
}

#canvasTimelineFilter:hover {
    background: #f0f0f0;
    border-color: #b0b0b0;
}

#canvasTimelineFilter:focus {
    outline: none;
    background: white;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Container for buttons on the right - moved into header */
#canvas-action-buttons {
    display: flex;
    position: static;
    z-index: 5;
    gap: 8px;
}

/* Show when sidebar is collapsed */
.main-container.sidebar-collapsed #canvas-action-buttons {
    display: flex; 
}

/* In friend view, hide the default actions but show friend actions */
.main-container.friend-view-mode #canvas-default-actions {
    display: none !important;
}

.main-container.friend-view-mode #canvas-friend-actions {
    display: flex !important;
}

/* NEW: Style for the canvas Event+ button */
#canvas-event-btn {
    color: #555;
}
#canvas-event-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}


/* --- Zoom Controls --- */
/* OLD POSITIONING (removed - now inline in header) */
.zoom-controls {
    display: none; /* Moved to .zoom-controls-inline */
}

/* When sidebar is collapsed, same calculation applies */
.main-container.sidebar-collapsed .zoom-controls {
    display: none;
}

/* In level 2 focus, shift zoom buttons LEFT to account for events-without-time button taking space */
.zoom-controls.level-2-focus {
    display: none;
}

.main-container.sidebar-collapsed .zoom-controls.level-2-focus {
    display: none;
}

/* New zoom button styling for inline placement */
.zoom-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.zoom-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.zoom-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* --- Comparison Info Button --- */
.comparison-info-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 32px;
    height: 32px;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    color: #667eea;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 12;
    transition: all 0.2s;
}

.comparison-info-btn:hover {
    background: rgba(102, 126, 234, 0.25);
    border-color: rgba(102, 126, 234, 0.5);
    transform: scale(1.05);
}

/* --- Comparison Modal --- */
.comparison-modal {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11;
    max-width: 500px;
    width: auto;
    min-width: 300px;
}

.comparison-modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    padding: 16px 20px;
    position: relative;
    border: 2px solid #667eea;
}

/* Line connecting button to modal - removed */
.comparison-modal-content::before {
    display: none;
}

.comparison-modal-content::after {
    display: none;
}

.comparison-modal-close {
    display: none;
}

.comparison-modal-text {
    font-size: 0.95em;
    line-height: 1.5;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* --- Comparison / Focus Bar --- */
.difference-text {
    font-size: 0.9em;
    line-height: 1.2; 
    color: #333;
    text-align: center;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word; 
}

.focus-mode-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    background-color: #fff8e1; 
    border: 1px solid #ffe58f;
    border-radius: 8px;
    padding: 8px 20px;
    height: auto;
    white-space: nowrap;
}

.focus-mode-indicator span {
    font-weight: 600;
    color: #6d4c00;
}

.event-focus-btn {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(100, 100, 100, 0.4);
    color: #333;
    font-size: 13px;
    padding: 2px 8px;
    border-radius: 5px;
    cursor: pointer;
    z-index: 10;
    font-weight: 600;
}
.event-focus-btn:hover {
    background: rgba(255, 255, 255, 1);
}


/* --- Friend View (Canvas) --- */

/* By default, show default actions and hide friend actions */
#canvas-default-actions {
    display: flex;
    gap: 10px;
}
#canvas-friend-actions {
    display: none;
}

/* When in friend view mode, flip visibility */
.main-container.friend-view-mode #canvas-default-actions {
    display: none;
}
.main-container.friend-view-mode #canvas-friend-actions {
    display: flex;
    gap: 10px;
}

/* --- Fix for collapsed sidebar timeline menu --- */
#canvas-timeline-options #timeline-options-menu-canvas {
    right: auto; /* Undo the default 'right: 0' */
    left: 0;     /* Make it open from the left edge, (i.e., to the right) */
}