/* Global Styles */
html,
body {
    font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
    height: 100%;
    margin: 0;
    background-color: #f8f9fa;
}

h1:focus {
    outline: none;
}

a,
.btn-link {
    color: #8A57EA;
    text-decoration: none;
}

a:hover,
.btn-link:hover {
    color: #4D2D7A;
    text-decoration: underline;
}

.btn-primary {
    color: #fff;
    background-color: #8A57EA;
    border-color: #8A57EA;
}

.btn-primary:hover {
    background-color: #7044C4;
    border-color: #7044C4;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(138, 87, 234, 0.25);
}

/* Layout */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    /* Ensure it uses full width */
}

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

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

/* Blazor Error UI */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    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;
}

/* Loading Progress */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #8A57EA;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

code {
    color: #c02d76;
}

/* Form Styles */
.form-floating>.form-control-plaintext::placeholder,
.form-floating>.form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating>.form-control-plaintext:focus::placeholder,
.form-floating>.form-control:focus::placeholder {
    text-align: start;
}

/* Sticky Note Styles */
.draggable-note-wrapper {
    position: absolute;
    width: 200px;
}

.sticky-note {
    width: 200px;
    min-height: 150px;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.15);
    cursor: grab;
    transition: box-shadow 0.2s;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: white;
    /* Default background */
}

.sticky-note:hover {
    box-shadow: 3px 3px 12px rgba(0, 0, 0, 0.25);
}

.note-positive {
    background-color: #d4edda;
    border-left: 4px solid #28a745;
}

.note-negative {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
}

.note-neutral {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}

.note-being-dragged {
    opacity: 0.7;
    box-shadow: 4px 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.note-being-edited {
    border: 2px dashed #8A57EA;
}

.note-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.note-content p {
    margin: 0;
    word-wrap: break-word;
}

.note-textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.note-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    justify-content: flex-end;
}

.note-actions button {
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-save {
    background-color: #28a745;
    color: white;
}

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

.btn-delete {
    background-color: transparent;
    border: 1px solid #dc3545;
    color: #dc3545;
    font-size: 16px;
}

.btn-delete:hover {
    background-color: #dc3545;
    color: white;
}

.typing-indicator,
.dragging-indicator {
    font-size: 11px;
    color: #6c757d;
    font-style: italic;
}

.note-meta {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
}

.sticky-note {
    position: relative;
    /* Ensure absolute children are positioned relative to this */
}

.btn-delete-top-right {
    position: absolute;
    top: 5px;
    right: 5px;
    background: transparent;
    border: none;
    color: #999;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
    transition: all 0.2s;
}

.btn-delete-top-right:hover {
    color: #dc3545;
    background-color: rgba(255, 255, 255, 0.5);
}