/*=====================================
BODY
=====================================*/

body.game-app {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
}

body.game-app main {
    min-height: calc(100vh - 48px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/*=====================================
EDITOR WINDOW
=====================================*/

#editor-window{

    width:1200px;

    height:950px;

    max-width:95%;

    /* background-image:url("../images/backgrounds/question_background.png");
    background-size:cover;
    background-position:center;
    background-repeat:no-repeat; */

    border-radius:20px;

    padding:40px;

    display:flex;

    flex-direction:column;

    gap:20px;

    box-shadow:0 20px 60px rgba(0,0,0,.45);

}

/*=====================================
TITLE
=====================================*/

#game-title{

    margin:0;

    text-align:center;

    font-size:2.5rem;

    color:white;

}

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

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 1rem;
}

.toolbar-section {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.toolbar-section-danger {
    margin-left: auto;
}

.toolbar-label {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@media (max-width: 768px) {

    .toolbar-section-danger {
        margin-left: 0;
    }

    .editor-toolbar {
        align-items: stretch;
    }
}

#grid-editor-container {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 15px;
    overflow-x: auto;
}

#speaking-grid-editor {
    border-collapse: separate;
    border-spacing: 8px;
    margin: 0 auto;
}

.grid-edit-cell {
    width: 140px;
    height: 140px;
    background: #2c3e50;
    border: 3px solid #34495e;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.grid-edit-cell:hover {
    border-color: #3498db;
    background: #34495e;
}

.grid-edit-cell.selected {
    border-color: #2ecc71;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.5);
}

.cell-content {
    color: white;
    font-size: 0.9rem;
    display: flex;
    padding: 5px;
    overflow: hidden;
    position: relative; /* Anchor for absolute objects */
    width: 100%;
    height: 100%;
    background: #1a252f;
}

.canvas-item {
    position: absolute;
    cursor: move;
    user-select: none;
}

.canvas-item.text {
    color: white;
    background: rgba(255,255,255,0.1);
    padding: 2px;
    min-width: 20px;
}

/* Style for the 6x6 non-editable area */
.empty-pool {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    pointer-events: none;
}

#canvas-editor-container {
    width: 100%;
    margin-top: 30px;
    display: flex;
    justify-content: center;
}


#editor-canvas-placeholder {
    position: absolute;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%);

    color: #777;
    font-size: 20px;

    text-align: center;

    pointer-events: none;
}

.canvas-object {
    position: absolute;

    box-sizing: border-box;

    cursor: move;
}

.canvas-object img {
    display: block;

    width: 100%;
    height: 100%;

    user-select: none;
    pointer-events: none;
}

.resize-handle {
    position: absolute;

    width: 12px;
    height: 12px;

    right: -6px;
    bottom: -6px;

    background: white;

    border: 2px solid #333;

    cursor: nwse-resize;
}

#editor-toolbar button:hover,
#navigation button:hover{

    transform:translateY(-2px);

}


.selected{

    outline: 3px solid #3b82f6;

    outline-offset: 3px;

}

.canvas-object{

    position:absolute;

}

.canvas-object.selected{

    outline:2px solid #3b82f6;

}

.resize-handle{

    position:absolute;

    width:14px;

    height:14px;

    right:-7px;

    bottom:-7px;

    background:#3b82f6;

    border:2px solid white;

    border-radius:50%;

    cursor:nwse-resize;

}

.canvas-image{

    width:100%;

    height:100%;

    user-select:none;

    pointer-events:none;

}

.canvas-textbox{

    width:100%;

    height:100%;

    overflow:hidden;

    color: black;

}

#editor-canvas{

    position:relative;

    width:100%;

    height:400px;

    border:3px dashed rgba(255,255,255,.35);

    border-radius:20px;

    overflow:hidden;

    background-color: white;

}

#font-smaller-btn,
#font-bigger-btn{

    min-width:60px;

    font-weight:bold;

}

#save-progress-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(3px);
}

.save-progress-card {
    width: min(100%, 420px);
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    background: #212529;
    color: white;
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.45);
}

.save-progress-card .progress {
    height: 0.85rem;
}
