/* Whiteboard App Styles */

html,
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* Whiteboard Styles */
.whiteboard-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px);
    /* Subtract navbar height */
}

.toolbar {
    background-color: #f8f9fa;
    padding: 10px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.tool-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-btn {
    padding: 8px 12px;
    margin: 0 5px;
    border: 1px solid #dee2e6;
    background-color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.tool-btn:hover {
    background-color: #e9ecef;
}

.tool-btn.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.tool-btn.premium {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.tool-btn.premium:hover {
    background-color: #e0a800;
    border-color: #d39e00;
}

/* Sidebar Tool Buttons */
.tool-btn-vertical {
    width: 50px;
    height: 50px;
    padding: 8px;
    margin-bottom: 5px;
    border: 1px solid #dee2e6;
    background-color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-btn-vertical:hover {
    background-color: #e9ecef;
}

.tool-btn-vertical.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.tool-sidebar-group {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
}

.tool-sidebar-group:last-child {
    border-bottom: none;
}

.sidebar {
    min-height: 100%;
}

.canvas-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f8f9fa;
    padding: 20px;
}

#whiteboard-canvas {
    border: 2px solid #dee2e6;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: crosshair;
}

/* Modal Styles */
.modal-backdrop {
    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: 1050;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #495057;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
}

.modal-body {
    padding: 20px;
}

.modal-body ul {
    list-style-type: none;
    padding: 0;
}

.modal-body li {
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
}

.modal-body li:before {
    content: "✓";
    color: #28a745;
    margin-right: 10px;
    font-weight: bold;
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

/* Navbar Overrides */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.75) !important;
}

.navbar-nav .nav-link:hover {
    color: white !important;
}

/* Form Styles */
input[type="color"] {
    width: 40px;
    height: 30px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
}

input[type="range"] {
    width: 80px;
}

label {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

/* Responsive Design */
@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .tool-group {
        justify-content: center;
    }

    #whiteboard-canvas {
        max-width: 100%;
        height: auto;
    }

    .canvas-area {
        padding: 10px;
    }
}

/* Error UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

/* Collaborator Cursors */
.collaborator-cursor {
    position: absolute;
    pointer-events: none;
    z-index: 1000;
    transition: left 0.05s ease-out, top 0.05s ease-out;
}

.collaborator-cursor .cursor-pointer {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 16px solid #ff6b6b;
    transform: rotate(-45deg);
    margin-bottom: -5px;
}

.collaborator-cursor .cursor-label {
    background-color: #ff6b6b;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    white-space: nowrap;
    margin-left: 12px;
    margin-top: -10px;
}

/* Different colors for different users */
.collaborator-cursor:nth-child(2) .cursor-pointer,
.collaborator-cursor:nth-child(2) .cursor-label {
    border-bottom-color: #4ecdc4;
    background-color: #4ecdc4;
}

.collaborator-cursor:nth-child(3) .cursor-pointer,
.collaborator-cursor:nth-child(3) .cursor-label {
    border-bottom-color: #9b59b6;
    background-color: #9b59b6;
}

.collaborator-cursor:nth-child(4) .cursor-pointer,
.collaborator-cursor:nth-child(4) .cursor-label {
    border-bottom-color: #f39c12;
    background-color: #f39c12;
}

.collaborator-cursor:nth-child(5) .cursor-pointer,
.collaborator-cursor:nth-child(5) .cursor-label {
    border-bottom-color: #3498db;
    background-color: #3498db;
}