/*
 * Year Planner — alle regler under .year-planner-module (null effekt når modul ikke er montert).
 * Host layout: base.css (#main-viewport-container.is-year-planner-active / #app-chrome.is-year-planner-active).
 * Frappe-Gantt: ingen CDN-CSS; speilet under .year-planner-module .year-planner-gantt-host.
 */

.year-planner-module .year-planner-page.main-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: visible;
}

.year-planner-module .planner-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin: 0 auto;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.year-planner-module .year-planner-gantt-host {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.year-planner-module .year-planner-gantt-host #year-planner-chart-root {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.year-planner-module .year-planner-gantt-host .gantt-container,
.year-planner-module .year-planner-gantt-host #year-planner-chart-root {
    overflow-x: auto;
}

.year-planner-module .planner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.year-planner-module .planner-controls {
    display: flex;
    gap: 10px;
}

.year-planner-module .btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    color: var(--text);
}

.year-planner-module .btn:hover {
    background: var(--bg-secondary);
}

.year-planner-module .btn.active {
    background: #2d3436;
    color: white;
    border-color: #2d3436;
}

.year-planner-module .btn-primary {
    background: var(--action);
    color: var(--white);
    border-color: var(--action);
}

.year-planner-module .btn-primary:hover {
    background: var(--action-hover);
}

/* Quarter markers (tidligere inline <style> i ReleasePlanner) */
.year-planner-module .bar-quarter-marker .bar {
    fill: #e2e8f0 !important;
    opacity: 0.8;
}
.year-planner-module .bar-quarter-marker .bar-label {
    fill: #64748b !important;
    font-weight: bold;
    font-size: 12px;
}

/* Frappe-Gantt bar / grid (scoped — erstatter CDN frappe-gantt.css) */
.year-planner-module .year-planner-gantt-host .gantt .grid-background {
    fill: none;
}
.year-planner-module .year-planner-gantt-host .gantt .grid-header {
    fill: #ffffff;
    stroke: #e0e0e0;
    stroke-width: 1.4;
}
.year-planner-module .year-planner-gantt-host .gantt .grid-row {
    fill: #ffffff;
}
.year-planner-module .year-planner-gantt-host .gantt .grid-row:nth-child(even) {
    fill: #f5f5f5;
}
.year-planner-module .year-planner-gantt-host .gantt .row-line {
    stroke: #ebeff2;
}
.year-planner-module .year-planner-gantt-host .gantt .tick {
    stroke: #e0e0e0;
    stroke-width: 0.2;
}
.year-planner-module .year-planner-gantt-host .gantt .tick.thick {
    stroke-width: 0.4;
}
.year-planner-module .year-planner-gantt-host .gantt .today-highlight {
    fill: #fcf8e3;
    opacity: 0.5;
}
.year-planner-module .year-planner-gantt-host .gantt .arrow {
    fill: none;
    stroke: #666;
    stroke-width: 1.4;
}
.year-planner-module .year-planner-gantt-host .gantt .bar {
    fill: #b8c2cc;
    stroke: #8D99A6;
    stroke-width: 0;
    transition: stroke-width 0.3s ease;
    user-select: none;
}
.year-planner-module .year-planner-gantt-host .gantt .bar-progress {
    fill: #a3a3ff;
}
.year-planner-module .year-planner-gantt-host .gantt .bar-invalid {
    fill: transparent;
    stroke: #8D99A6;
    stroke-width: 1;
    stroke-dasharray: 5;
}
.year-planner-module .year-planner-gantt-host .gantt .bar-invalid ~ .bar-label {
    fill: #555;
}
.year-planner-module .year-planner-gantt-host .gantt .bar-label {
    fill: #fff;
    dominant-baseline: central;
    text-anchor: middle;
    font-size: 12px;
    font-weight: lighter;
}
.year-planner-module .year-planner-gantt-host .gantt .bar-label.big {
    fill: #555;
    text-anchor: start;
}
.year-planner-module .year-planner-gantt-host .gantt .handle {
    fill: #ddd;
    cursor: ew-resize;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}
.year-planner-module .year-planner-gantt-host .gantt .bar-wrapper {
    cursor: pointer;
    outline: none;
}
.year-planner-module .year-planner-gantt-host .gantt .bar-wrapper:hover .bar {
    fill: #a9b5c1;
}
.year-planner-module .year-planner-gantt-host .gantt .bar-wrapper:hover .bar-progress {
    fill: #8a8aff;
}
.year-planner-module .year-planner-gantt-host .gantt .bar-wrapper:hover .handle {
    visibility: visible;
    opacity: 1;
}
.year-planner-module .year-planner-gantt-host .gantt .bar-wrapper.active .bar {
    fill: #a9b5c1;
}
.year-planner-module .year-planner-gantt-host .gantt .bar-wrapper.active .bar-progress {
    fill: #8a8aff;
}
.year-planner-module .year-planner-gantt-host .gantt .lower-text,
.year-planner-module .year-planner-gantt-host .gantt .upper-text {
    font-size: 12px;
    text-anchor: middle;
}
.year-planner-module .year-planner-gantt-host .gantt .upper-text {
    fill: #555;
}
.year-planner-module .year-planner-gantt-host .gantt .lower-text {
    fill: #333;
}
.year-planner-module .year-planner-gantt-host .gantt .hide {
    display: none;
}

.year-planner-module .year-planner-gantt-host .gantt-container {
    position: relative;
    overflow: auto;
    font-size: 12px;
}
.year-planner-module .year-planner-gantt-host .gantt-container .popup-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.8);
    padding: 0;
    color: #959da5;
    border-radius: 3px;
}
.year-planner-module .year-planner-gantt-host .gantt-container .popup-wrapper .title {
    border-bottom: 3px solid #a3a3ff;
    padding: 10px;
}
.year-planner-module .year-planner-gantt-host .gantt-container .popup-wrapper .subtitle {
    padding: 10px;
    color: #dfe2e5;
}
.year-planner-module .year-planner-gantt-host .gantt-container .popup-wrapper .pointer {
    position: absolute;
    height: 5px;
    margin: 0 0 0 -5px;
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
}

/* App-specific Gantt tweaks */
.year-planner-module .year-planner-gantt-host .gantt .bar-label {
    fill: #fff;
    font-weight: 500;
    font-size: 12px;
}

.year-planner-module .bar-blue .bar { fill: #3498db; }
.year-planner-module .bar-red .bar { fill: #e74c3c; }
.year-planner-module .bar-green .bar { fill: #2ecc71; }
.year-planner-module .bar-yellow .bar { fill: #f1c40f; }
.year-planner-module .bar-purple .bar { fill: #9b59b6; }
.year-planner-module .bar-gray .bar { fill: #95a5a6; }

.year-planner-module .bar-hidden .bar { fill: transparent; }
.year-planner-module .bar-hidden .bar-label { fill: transparent; }
.year-planner-module .bar-hidden .bar-wrapper:hover { opacity: 0; cursor: default; }

.year-planner-module .no-resize .handle-group {
    display: none !important;
}

.year-planner-module .toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 20px;
    font-size: 14px;
}

.year-planner-module .modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.year-planner-module .modal-overlay.active { display: flex; }

.year-planner-module .modal-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: var(--radius);
    width: 400px;
    box-shadow: var(--shadow-md);
}

.year-planner-module .form-group { margin-bottom: 15px; }
.year-planner-module .form-control {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    box-sizing: border-box;
    background: var(--bg);
    color: var(--text);
}

.year-planner-module .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.year-planner-module .btn-danger {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}

.year-planner-module .year-planner-gantt-host .gantt .grid-row {
    background-image: linear-gradient(to right, #f5f5f5 1px, transparent 1px);
    background-size: 25px 100%;
}
