/* Reset basics */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: sans-serif;
}

body {
    height: 100vh;
    overflow: hidden;
}

/* THE GRID SYSTEM */
.app-grid {
    display: grid;
    /* The requested 20% - 60% - 20% split */
    grid-template-columns: 20fr 60fr 20fr;
    height: 100vh;
    width: 100vw;
}

/* SIDEBAR STYLING */
.sidebar {
    background-color: #f5f5f5;
    border-right: 1px solid #ccc;
    border-left: 1px solid #ccc;
    display: flex;
    flex-direction: column;
}

/* Optional: Style for the User Badges in the right panel */
.user-badge {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-dot {
    width: 10px;
    height: 10px;
    background-color: #28a745;
    /* Green for online */
    border-radius: 50%;
}

.panel-header {
    background: #e0e0e0;
    padding: 10px;
    font-weight: bold;
    border-bottom: 1px solid #ccc;
}

.panel-content {
    padding: 10px;
    overflow-y: auto;
    /* Independent scroll for comments */
    flex-grow: 1;
}

.comment-card {
    background: white;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

/* PDF CONTAINER STYLING */
.pdf-container {
    background-color: #525659;
    /* Standard PDF Grey */
    overflow-y: auto;
    /* Enables vertical scrolling for the PDF only */
    display: flex;
    justify-content: center;
    padding: 20px;
    position: relative;
    /* Context for absolute positioning of highlights later */
}

/* The actual PDF pages will live here */
#viewer {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    /* <--- NEW: Force it to fill the space */
    align-items: center;
    /* <--- NEW: Center the pages if they are smaller than max width */
}

canvas {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    /* Drop shadow for the page */
}

/* FORM STYLING FOR SIDEBAR */
.comment-form {
    background: #fff;
    border: 1px solid #007bff;
    /* Blue border to show it's active */
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.comment-form textarea {
    width: 100%;
    height: 60px;
    margin-bottom: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 5px;
    resize: vertical;
}

.btn-save {
    background-color: #28a745;
    /* Green */
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.btn-cancel {
    background-color: #dc3545;
    /* Red */
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
}

/* VISUAL FEEDBACK FOR SELECTION */

/* When a card is active */
.comment-card.active {
    border-left: 5px solid #007bff;
    /* Thick blue bar on left */
    background-color: #f0f8ff;
    /* Light blue background */
    transition: all 0.2s;
}

/* When a dot is active */
.dot.active {
    background-color: #007bff !important;
    /* Turn blue */
    transform: translate(-50%, -50%) scale(1.5) !important;
    /* Grow bigger */
    z-index: 100;
    /* Bring to front */
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.3);
    /* Glow effect */
}

/* MODAL STYLES */
.modal-overlay {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    /* Dark background */
    z-index: 1000;
    /* Sit on top of everything */
    justify-content: center;
    align-items: center;
}

.modal-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    width: 300px;
}

.modal-box input {
    width: 100%;
    padding: 10px;
    margin: 15px 0;
    font-size: 16px;
}

.modal-box button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
}

/* THE NEW "PIN" STYLE */
.dot {
    position: absolute;
    /* Use 'transform' to center the bottom-left point on the click */
    transform: translate(0, -100%);

    background-color: #dc3545;
    /* Red background */
    color: white;
    padding: 4px 8px;
    border-radius: 12px 12px 12px 0;
    /* Makes it look like a speech bubble */
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    /* Keep name on one line */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;

    /* Optional: Add a small border to make it pop against dark images */
    border: 1px solid white;
}

/* Hover Effect */
.dot:hover {
    z-index: 100;
    transform: translate(0, -110%) scale(1.1);
}

/* Active State (Selected) */
.dot.active {
    background-color: #007bff !important;
    /* Blue */
    z-index: 100;
    transform: translate(0, -110%) scale(1.2) !important;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.3);
}