/* General page setup */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0;
    background-color: #f0f2f5;
    overflow: hidden; /* Prevents scrollbars */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* The main whiteboard canvas element */
#whiteboard {
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    cursor: crosshair;
    visibility: hidden; /* Hide canvas initially */
}

/* Board name text in the top right corner */
#board-name {
    position: absolute;
    top: 20px;
    right: 30px;
    padding: 8px 16px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s;
    z-index: 10;
}

#board-name:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Info button in the top left corner */
.info-button {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 10;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.info-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}


/* Container for the color palette on the left */
.color-palette {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background-color: white;
    padding: 8px;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Individual color circles */
.color-option {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.2s;
    position: relative;
}

.color-option[data-color="white"] {
    border-color: #e0e0e0;
}

.color-option:hover {
    transform: scale(1.1);
}

/* The dot inside the selected color */
.color-option.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: black;
}

/* Gray dot for black and white options for visibility */
.color-option[data-color="white"].active::after,
.color-option[data-color="black"].active::after {
    background-color: #888;
}

/* Main toolbar at the bottom */
.toolbar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Brush size controls */
.brush-size-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brush-size-control button {
    width: 28px;
    height: 28px;
    border: none;
    background-color: #f0f2f5;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
}

.brush-size-control input {
    width: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 4px;
}

/* Tool icons */
.tool-options {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tool {
    width: 24px;
    height: 24px;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.tool:hover {
    background-color: #f0f2f5;
}

.tool.active-tool {
    background-color: #e0e6ff;
}

/* --- Modal Styles --- */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-container.hidden {
    display: none;
}

/* --- Info Modal Styles --- */
#info-modal .modal-content {
    background: white;
    color: #333;
    padding: 24px 32px;
    border-radius: 16px;
    text-align: left;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 400px;
    max-width: 90%;
    position: relative;
}

#info-modal h2 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #0072ff;
}

#info-modal p {
    line-height: 1.6;
    margin-bottom: 20px;
}

#info-modal hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

.tutorial-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tutorial-list li {
    margin-bottom: 10px;
}

.tutorial-list b {
    display: inline-block;
    text-align: center;
    background-color: #f0f2f5;
    border-radius: 4px;
    padding: 2px 6px;
    margin-right: 8px;
    font-family: 'Courier New', Courier, monospace;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #888;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.close-button:hover {
    color: #333;
}


/* --- Download Modal Specific Styles --- */
#download-modal .modal-content {
    background: linear-gradient(135deg, #0072ff, #00c6ff);
    color: white;
    padding: 24px 32px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 300px;
}

#download-modal h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

#download-modal input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    margin-bottom: 20px;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
    font-size: 16px;
    text-align: center;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.modal-buttons button {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    background-color: #005fcc;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-buttons button:hover {
    background-color: #004c9e;
}