/* ==============================
   GLOBAL LOOK & FEEL (Google-like)
   ============================== */

body {
    background: #f8f9fa;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 13px;
    overflow: hidden;
    height: 100vh;
}


/* Container full height */
.container {
    max-width: 100%;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}


/* =====================
   HEADER & TOP UI
   ===================== */

h2 {
    font-size: 22px;
    font-weight: 400;
    padding: 16px 24px;
    background:#fff;
    margin:0;
}

.text-muted {
    color:#555;
    background:#fff;
    padding: 4px 24px 12px;
}


/* =====================
   TOOLBAR
   ===================== */

.toolbar {
    background:white;
    border-bottom:1px solid #ddd;
    padding:8px 24px;
    display:flex;
    gap:6px;
}

.toolbar button {
    border:1px solid #ccc;
    padding:6px 12px;
    border-radius:4px;
    cursor:pointer;
}

.toolbar .divider {
    width:1px;
    background:#ddd;
}


/* =====================
   FORMULA BAR
   ===================== */

.formula-bar{
    background:#fff;
    padding:8px 24px;
    border-bottom:1px solid #ddd;
    display:flex;
    align-items:center;
    gap:8px;
}

.formula-input{
    flex:1;
    border:1px solid #ccc;
    border-radius:4px;
    padding:6px;
}


/* =====================
   TABLE AREA
   ===================== */

.table-container{
    flex:1;
    overflow:auto;
    background:white;
    padding:24px;
}

#sheetTable{
    border-collapse:collapse;
    border-spacing:0;
    width:100%;
}


/* column headers */
#sheetTable thead th{
    background:#f0f0f0;
    position:sticky;
    top:0;
    border:1px solid #ddd;
}


/* row headers */
#sheetTable tbody th{
    background:#f0f0f0;
    position:sticky;
    left:0;
    border:1px solid #ddd;
}


/* cells */
#sheetTable td{
    border:1px solid #ddd;
    min-width:100px;
    padding:4px;
    cursor:text;
}

#sheetTable td:hover{ background:#f8f8f8; }

#sheetTable td.selected-cell{
    outline:2px solid dodgerblue;
}


/* STATUS POPUP */
#statusBox{
    position:fixed;
    bottom:20px;
    right:20px;
    background:white;
    border:1px solid #ddd;
    padding:8px 12px;
    border-radius:4px;
    display:none;
}


/* CONTEXT MENU */
.context-menu{
    display:none;
    position:absolute;
    background:white;
    border:1px solid #ddd;
    padding:4px 0;
}

.context-menu-item{
    padding:6px 20px;
    cursor:pointer;
}
.context-menu-item:hover{
    background:#eee;
}


.sheet-tabs {
  display: flex;
  gap: 6px;
  margin: 10px 0;
  border-bottom: 1px solid #ccc;
}

.sheet-tab {
  padding: 6px 14px;
  cursor: pointer;
  background: #f1f3f4;
  border-radius: 6px 6px 0 0;
  font-size: 14px;
}

.sheet-tab.active {
  background: #ffffff;
  border-bottom: 2px solid #1a73e8;
  font-weight: 500;
}


/* LOADING SPINNER */
.sheet-loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 50;
  font-size: 14px;
  font-weight: 500;
}

.sheet-loading.show {
  display: flex;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #ddd;
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
#sheetTable td {
  user-select: none;
}

#sheetTable td.cell-selected {
  user-select: text;
  /* outline: 2px solid #1a73e8; */
  background-color: #e8f0fe;
}
