body {
    font-family: 'Calibri', sans-serif; /* Excel-like font */
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: #f0f0f0; /* Light grey background */
}

.toolbar {
    background-color: #e0e0e0; /* Slightly darker grey for toolbar */
    padding: 5px;
    border-bottom: 1px solid #c0c0c0;
}

.toolbar button {
    padding: 5px 10px;
    margin-right: 2px;
    border: 1px solid transparent;
    background-color: transparent;
    cursor: pointer;
}

.toolbar button:hover {
    border: 1px solid #a0a0a0;
    background-color: #d0d0d0;
}

.formula-bar {
    padding: 5px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #c0c0c0;
}

.formula-bar input {
    width: 100%;
    border: 1px solid #c0c0c0;
    padding: 2px 5px;
    box-sizing: border-box; /* Include padding and border in width */
}

.grid-container {
    display: grid;
    grid-template-areas:
        ". col-headers"
        "row-headers grid";
    grid-template-columns: 50px 1fr; /* Width for row headers, rest for grid */
    grid-template-rows: 30px 1fr; /* Height for col headers, rest for grid */
    flex-grow: 1; /* Allow grid container to fill space */
    overflow: auto; /* Add scrollbars if needed */
    background-color: #ffffff; /* White background for grid area */
    border-top: 1px solid #c0c0c0;
    border-left: 1px solid #c0c0c0;
    position: relative; /* Needed for absolute positioning of charts */
}

.row-headers {
    grid-area: row-headers;
    background-color: #e0e0e0;
    border-right: 1px solid #c0c0c0;
    display: flex;
    flex-direction: column;
}

.column-headers {
    grid-area: col-headers;
    background-color: #e0e0e0;
    border-bottom: 1px solid #c0c0c0;
    display: flex;
}

.header-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 1px solid #c0c0c0;
    box-sizing: border-box;
}

.row-header-cell {
    height: 25px; /* Fixed height for row headers */
    width: 100%;
    border-top: none; /* Remove double borders */
    border-left: none;
}

.col-header-cell {
    width: 80px; /* Fixed width for column headers */
    height: 100%;
    border-top: none;
    border-left: none;
}

.grid {
    grid-area: grid;
    display: grid;
    /* Grid columns/rows will be set by JS */
    overflow: scroll; /* Enable scrolling within the grid */
}

.cell {
    border: 1px solid #dcdcdc; /* Light grid lines */
    padding: 2px 5px;
    min-width: 79px; /* Sync with col header width - border */
    min-height: 24px; /* Sync with row header height - border */
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    font-size: 11pt; /* Standard Excel font size */
}

.cell input {
    width: 100%;
    height: 100%;
    border: none;
    outline: 2px solid blue; /* Highlight active cell */
    box-sizing: border-box;
    padding: 1px 4px; /* Adjust for outline */
    font-family: inherit;
    font-size: inherit;
}

/* Style for draggable charts */
#surfaceChartDiv,
#quadrantChartDiv,
#heatmapChartDiv {
    position: absolute; /* Position absolutely within grid-container */
    width: 45%; /* Adjust width */
    height: 400px;
    background-color: rgba(255, 255, 255, 0.9); /* Slightly transparent background */
    border: 1px solid #aaa;
    box-sizing: border-box;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.2);
    z-index: 10; /* Ensure charts are above the grid */
    cursor: move; /* Indicate draggable */
    overflow: hidden; /* Hide plotly overflow */
    resize: both; /* Allow resizing */
}

/* Initial positions */
#surfaceChartDiv {
    top: 50px;
    left: 70px;
}

#quadrantChartDiv {
    top: 80px;
    left: calc(50% + 20px);
    width: 40%; /* Slightly different size */
}

#heatmapChartDiv {
    top: 480px;
    left: 100px;
    width: 80%;
    height: 500px;
}

/* Add styles for the chart header/drag handle */
.chart-header {
    background-color: #e0e0e0;
    padding: 5px 8px;
    cursor: move;
    border-bottom: 1px solid #ccc;
    font-weight: bold;
    font-size: 10pt;
    user-select: none; /* Prevent text selection during drag */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Adjust Plotly container inside the chart div */
.plotly-graph-div {
    position: absolute;
    top: 30px; /* Height of the header */
    left: 0;
    width: 100% !important; /* Override Plotly inline styles */
    height: calc(100% - 30px) !important; /* Override Plotly inline styles */
}

/* Style the fullscreen toggle button */
#fullscreen-toggle-btn {
    position: fixed;
    bottom: 10px;
    right: 10px; /* Position bottom-right */
    padding: 8px 12px;
    font-size: 10pt;
    cursor: pointer;
    background-color: #ddd;
    border: 1px solid #bbb;
    border-radius: 4px;
    z-index: 1000;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    display: block; /* Initially visible */
}

#fullscreen-toggle-btn:hover {
    background-color: #ccc;
}

/* Re-add pseudo-classes targeting html and body */
html:-webkit-full-screen #fullscreen-toggle-btn,
body:-webkit-full-screen #fullscreen-toggle-btn,
html:-moz-full-screen #fullscreen-toggle-btn,
body:-moz-full-screen #fullscreen-toggle-btn,
html:-ms-fullscreen #fullscreen-toggle-btn,
body:-ms-fullscreen #fullscreen-toggle-btn,
html:fullscreen #fullscreen-toggle-btn,
body:fullscreen #fullscreen-toggle-btn {
    display: none !important; /* Use !important to ensure override */
}

/* --- Gantt-in-Grid Specific Styles --- */
.cell.gantt-bar-cell {
    background-color: #3498db; /* Blue for task bars */
    color: white; /* Hide underlying text if any */
    border-left: 1px solid #2980b9; /* Slightly darker border start */
    border-right: 1px solid #2980b9; /* Slightly darker border end */
    padding: 0; /* Remove padding for full bleed */
}

.cell.gantt-bar-start {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.cell.gantt-bar-end {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.cell.gantt-milestone-cell {
    background-color: transparent; /* Base cell is clear */
    position: relative; /* Needed for pseudo-element */
    border: none; /* Remove grid border */
    padding: 0;
}

.cell.gantt-milestone-cell::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px; /* Size of diamond */
    height: 12px;
    background-color: #d35400; /* Orange diamond */
    transform: rotate(45deg) translate(-50%, -50%);
    border: 1px solid #a04000; /* Darker border */
}

.cell.gantt-summary-task {
    font-weight: bold;
    background-color: #f0f0f0;
}

.cell.weekend-cell {
    background-color: #f5f5f5; /* Light grey for weekend columns */
}

.col-header-cell.timeline-header {
    font-size: 8pt; /* Smaller font for dates */
    line-height: 1.2;
}

.col-header-cell.weekend-header {
     background-color: #e8e8e8; /* Darker grey for weekend headers */
}

.cell.grid-header-cell {
    background-color: #e0e0e0;
    font-weight: bold;
}

/* --- Excel2 Dynamic Status Styles --- */
.cell.status-approved {
    background-color: #c6efce !important; 
    color: #006100 !important;
    font-weight: bold;
    text-align: center;
}
.cell.status-rejected {
    background-color: #ffc7ce !important; 
    color: #9c0006 !important;
    font-weight: bold;
    text-align: center;
}
.cell.status-pending, .cell.status-review {
    background-color: #ffeb9c !important; 
    color: #9c6500 !important;
    font-weight: bold;
    text-align: center;
}
.cell.status-onhold {
     background-color: #d9d9d9 !important; 
     color: #3f3f3f !important;
     font-weight: bold;
     text-align: center;
}

/* --- Gantt Dynamic Highlight Style --- */
.gantt-highlight {
    outline: 3px dashed orange !important; /* Thicker outline */
    outline-offset: -3px; /* Adjust offset for thicker outline */
    transition: outline 0.1s linear;
}

/* --- Accessibility Styles --- */
.visually-hidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    white-space: nowrap; /* 1 */
    top: 0;
    left: 0;
    display: none; /* Add display: none to hide completely */
}

/* --- Media Queries for Responsiveness --- */

/* Tablets */
@media (max-width: 992px) {
    /* Allow charts to overlap more freely or stack */
    #surfaceChartDiv,
    #quadrantChartDiv,
    #heatmapChartDiv {
        width: 60%; /* Allow charts to be wider */
        height: 350px;
    }
    #quadrantChartDiv {
        left: calc(40% - 10px); /* Adjust overlap */
    }
    #heatmapChartDiv {
        top: 400px; /* Adjust vertical position */
        width: 80%;
        left: 50px;
    }
}

/* Phones */
@media (max-width: 767px) {
    .toolbar {
        /* Consider simplifying or hiding some buttons */
        overflow-x: auto; /* Allow scrolling if buttons overflow */
        white-space: nowrap;
    }
    .grid-container {
        /* Simplify grid for mobile - maybe just show grid, hide headers? */
        grid-template-areas:
            "grid grid"
            "grid grid";
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        border: none;
    }
    .row-headers, .column-headers {
        display: none; /* Hide headers on small screens */
    }
    #surfaceChartDiv,
    #quadrantChartDiv,
    #heatmapChartDiv {
        position: relative; /* Change from absolute to relative */
        width: 95%; /* Make charts take most of width */
        height: 300px;
        left: 2.5%; /* Center */
        top: auto; /* Remove fixed top positioning */
        margin-top: 15px; /* Add space between stacked charts */
        margin-bottom: 15px;
        float: none; /* Ensure no floating */
        resize: vertical; /* Allow vertical resize only */
    }
    #fullscreen-toggle-btn {
        display: none; /* Hide fullscreen button on mobile */
    }
}

/* --- Mobile Message Styles --- */
#mobile-message {
    background-color: #f0f0f0; /* Match body background */
    color: #333;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#mobile-message h1 {
    color: #00529b;
    font-size: 2em;
    margin-bottom: 15px;
}

#mobile-message h2 {
    color: #555;
    font-size: 1.2em;
    font-weight: normal;
    max-width: 80%;
}

#ezPrivacyCenter {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    top: auto !important;
    left: auto !important;
    display: block !important;
    margin: 0 !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
    writing-mode: horizontal-tb !important;
    transform: none !important;
    background-color: #5fa624 !important;
    color: white !important;
    border-radius: 5px !important;
    z-index: 2147483647 !important;
    box-shadow: 0 0 10px rgba(0,0,0,0.3) !important;
    cursor: pointer !important;
} 