/* excel3.css - Styles specific to the 2048 game embedded in the Excel grid */

/* Excel Container */
#excel-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: white;
}

/* Toolbar */
.toolbar {
    background: #f3f2f1;
    padding: 4px;
    border-bottom: 1px solid #dfdfdf;
}

.toolbar button {
    background: transparent;
    border: none;
    padding: 4px 8px;
    margin: 0 2px;
    font-size: 13px;
    color: #444;
    cursor: pointer;
}

.toolbar button:hover {
    background: #e6e6e6;
}

/* Formula Bar */
.formula-bar {
    height: 22px;
    padding: 2px 4px;
    border-bottom: 1px solid #dfdfdf;
    display: flex;
    align-items: center;
}

.formula-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 12px;
    font-family: "Segoe UI", Arial, sans-serif;
}

/* Grid Container */
.grid-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Headers */
.column-headers {
    position: absolute;
    top: 0;
    left: 40px;
    right: 0;
    height: 21px;  /* Increased by 1px to account for border */
    display: flex;
    background: #f8f9fa;
    z-index: 2;
}

.row-headers {
    position: absolute;
    top: 21px;  /* Increased by 1px to account for border */
    left: 0;
    width: 40px;
    bottom: 0;
    background: #f8f9fa;
    z-index: 2;
    overflow: hidden;
}

.corner-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 21px;  /* Increased by 1px to account for border */
    background: #f8f9fa;
    border: 1px solid #dfdfdf;
    z-index: 3;
}

.column-header {
    width: 65px;  /* Increased by 1px to account for border */
    height: 21px;  /* Increased by 1px to account for border */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #666;
    border: 1px solid #dfdfdf;
    margin-left: -1px;
    flex-shrink: 0;
    background: #f8f9fa;
}

.row-header {
    height: 21px;  /* Increased by 1px to account for border */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #666;
    border: 1px solid #dfdfdf;
    margin-top: -1px;
    background: #f8f9fa;
}

/* Grid */
.grid {
    position: absolute;
    top: 21px;
    left: 40px;
    right: 0;
    bottom: 0;
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(52, 65px);
    grid-auto-rows: 21px;
    background: white;
}

.cell {
    border: 1px solid #dfdfdf;
    margin-top: -1px;
    margin-left: -1px;
    padding: 1px 4px;
    font-size: 11px;
    font-family: "Segoe UI", Arial, sans-serif;
    white-space: nowrap;
    overflow: hidden;
    background: white;
    height: 21px;  /* Increased by 1px to account for border */
    width: 65px;  /* Increased by 1px to account for border */
}

/* Ensure all cells have borders */
.grid::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-right: 1px solid #dfdfdf;
    border-bottom: 1px solid #dfdfdf;
    pointer-events: none;
    z-index: 1;
}

/* Basic Styles */
body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    overflow: hidden;
}

* {
    box-sizing: border-box;
}

/* Game container styles (should mostly inherit from parent grid cell) */
#game-grid-container {
    position: relative;
    /* Remove distinct background and border */
    /* background-color: #bbada0; */
    padding: 0; /* No extra padding inside the game area block */
    box-sizing: border-box;
    overflow: visible; /* Allow tile borders to maybe overlap slightly */

    /* Use CSS Grid for the background cells INSIDE */
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    /* Remove gap, use borders to separate */
    gap: 0;

    width: 100%;
    height: 100%;
}

/* Style for the static background cells INSIDE game container */
/* Make these look exactly like normal empty cells */
#game-grid-container .grid-cell {
    background-color: #ffffff; /* Standard cell white */
    border: 1px solid #dcdcdc; /* Standard cell border */
    border-radius: 0; /* No border radius */
    box-sizing: border-box;
    /* Ensure borders don't double up - slightly tricky with grid */
    /* Could remove top/left border on all but first row/col if needed */
}

/* Style for the moving game tiles */
.tile {
    position: absolute;
    /* Calculate size based on container size (no padding/gap anymore) */
    width: 25%;
    height: 25%;
    /* Base appearance like a standard cell */
    background-color: #ffffff;
    border: 1px solid #dcdcdc;
    border-radius: 0;
    box-sizing: border-box;

    /* Font like standard cells */
    font-family: 'Calibri', sans-serif;
    font-weight: normal; /* Standard weight */
    font-size: 11pt;
    color: #000000; /* Standard black text */

    /* Center content */
    display: flex;
    justify-content: center;
    align-items: center;

    /* Remove game-like transitions */
    /* transition: transform 0.1s ease-in-out, background-color 0.1s ease-in-out, color 0.1s ease-in-out, top 0.1s ease-in-out, left 0.1s ease-in-out; */
    transition: top 0.1s ease-in-out, left 0.1s ease-in-out; /* Keep movement smooth */

    z-index: 20;
}

/* Subtle conditional formatting for tile values (using Excel-like colors) */
/* Low numbers - standard */
.tile[data-value="2"], .tile[data-value="4"] {
    /* Default styles */
}
/* Medium numbers - maybe slightly bolder or different background */
.tile[data-value="8"], .tile[data-value="16"] {
    background-color: #fcf8e3; /* Pending/Review yellow */
    font-weight: bold;
}
.tile[data-value="32"], .tile[data-value="64"] {
    background-color: #d9edf7; /* Light blue info */
    color: #31708f;
    font-weight: bold;
}
/* Higher numbers - more distinct */
.tile[data-value="128"], .tile[data-value="256"] {
    background-color: #dff0d8; /* Approved green */
    color: #3c763d;
    font-weight: bold;
}
.tile[data-value="512"], .tile[data-value="1024"] {
    background-color: #f2dede; /* Rejected red */
    color: #a94442;
    font-weight: bold;
}
/* 2048 and above */
.tile[data-value="2048"], .tile[data-value="4096"], .tile[data-value="8192"] {
    background-color: #e0e0e0; /* Header gray */
    color: #000000;
    font-weight: bold;
}


/* Game Over / Win / Initial Instruction Overlay */
.game-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(200, 200, 200, 0.75); /* Slightly more opaque for initial instruction */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #333;
    font-size: 1.5em;
    font-weight: bold;
    text-align: center;
    z-index: 100;
    visibility: hidden; /* Hidden by default, JS activates */
    opacity: 0;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    border-radius: 0;
    cursor: default; /* Default cursor */
}

/* Style specific to the initial instructions */
#initial-instructions-overlay {
    background-color: rgba(220, 220, 220, 0.85); /* Lighter background maybe */
    color: #111;
    font-size: 1.3em;
}

.game-overlay.active {
    visibility: visible;
    opacity: 1;
}
#game-over-message, #game-win-message { margin-bottom: 10px; }
#restart-button {
    padding: 5px 10px;
    font-size: 0.9em;
    background-color: #c0c0c0;
    color: #000;
    border: 1px solid #a0a0a0;
    border-radius: 3px;
    cursor: pointer;
}
#restart-button:hover { background-color: #d0d0d0; }

/* Styling for High Score display within overlay */
#game-overlay-scores {
    margin-top: 15px; /* Space above the list */
    font-size: 0.7em; /* Smaller font for the list */
    max-height: 150px; /* Limit height if many scores */
    overflow-y: auto; /* Add scroll if needed */
    text-align: left; /* Align list items left */
    width: 80%; /* Limit width slightly */
    border-top: 1px solid #bbb; /* Separator line */
    padding-top: 10px;
}

#game-overlay-scores h3 {
    margin: 0 0 5px 0;
    font-size: 1.1em;
    text-align: center;
}

#game-overlay-scores ol {
    margin: 0;
    padding-left: 25px;
}

#game-overlay-scores li {
    margin-bottom: 3px;
}

/* Formula bar */
#game-status-bar { font-weight: normal; color: #000; }

/* Inherited conditional formatting styles */
.status-approved { background-color: #dff0d8; color: #3c763d; }
.status-rejected { background-color: #f2dede; color: #a94442; }
.status-pending, .status-review { background-color: #fcf8e3; color: #8a6d3b; }
.status-onhold { background-color: #e0e0e0; color: #555; }

/* Ensure main grid cells have some basic style if needed */
.grid > .cell {
    /* Inherit styles from style.css, add overrides if necessary */
    /* e.g., ensure they don't collapse if empty */
    min-height: 25px; 
}

#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;
}

/* Sudoku specific styles */
.cell[data-sudoku-col="2"],
.cell[data-sudoku-col="5"] {
    border-right: 2px solid #666;
}

.cell[data-sudoku-row="2"],
.cell[data-sudoku-row="5"] {
    border-bottom: 2px solid #666;
}

/* Sudoku outer borders */
.cell[data-sudoku-row="0"] {
    border-top: 2px solid #666;
}

.cell[data-sudoku-row="8"] {
    border-bottom: 2px solid #666;
}

.cell[data-sudoku-col="0"] {
    border-left: 2px solid #666;
}

.cell[data-sudoku-col="8"] {
    border-right: 2px solid #666;
} 