body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #121212;
    color: #e0e0e0;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#canvas {
    width: 100%;
    height: 100vh;
    background-color: #1e1e1e;
    border: none;
    position: relative;
    overflow: auto;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#canvas.no-select * {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

.card {
    width: 200px;
    min-height: 100px;
    background-color: #2c2c2c;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 10px;
    position: absolute;
    cursor: move;
    user-select: none;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
    z-index: 10;
}

.delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    cursor: pointer;
    font-weight: bold;
    color: #ff6b6b;
    visibility: hidden;
}

.card:hover .delete-btn {
    visibility: visible;
}

.card.selected {
    box-shadow: 0 0 0 2px #666;
}

#selection-box {
    position: absolute;
    border: 2px dashed #666;
    background-color: rgba(102, 102, 102, 0.1);
    pointer-events: none;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 400px;
    background-color: #2c2c2c;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.close-modal {
    position: absolute;
    top: 5px;
    right: 7px;
    font-size: 20px;
    cursor: pointer;
    color: #e0e0e0;
    z-index: 1001;
}

.close-modal:hover {
    color: #ffffff;
}

#batchInput {
    width: 100%;
    height: calc(100% - 40px);
    background-color: #1e1e1e;
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 10px;
    font-family: inherit;
    resize: none;
    outline: none;
    box-sizing: border-box;
}

.user-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #2c2c2c;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 10px;
    z-index: 1001;
    display: flex;
    gap: 10px;
    align-items: center;
}

.user-panel button {
    background-color: #444;
    color: #e0e0e0;
    border: none;
    border-radius: 3px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
}

.user-panel button:hover {
    background-color: #555;
}

/* Login Modal Specific Styles */
#loginModal {
    width: 280px;
    height: auto;
    min-height: 280px;
}

#loginModal .modal-content {
    width: 100%;
    height: auto;
    padding: 32px 24px 16px 24px;
    position: relative;
    box-sizing: border-box;
}

#loginModal h2 {
    margin-top: 0;
    margin-bottom: 24px;
    text-align: center;
    color: #e0e0e0;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
}

.close-login {
    position: absolute;
    top: 10px;
    right: 11px;
    font-size: 16px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    z-index: 1002;
    line-height: 1;
}

.close-login:hover {
    color: #ff6b6b;
}

.auth-step {
    width: 100%;
    min-height: 180px;
}

.auth-step form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.auth-step input {
    background-color: #1e1e1e;
    border: 1px solid #444;
    color: #e0e0e0;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.auth-step input:focus {
    border-color: #666;
}

.auth-step input[readonly] {
    background-color: #2a2a2a;
    border-color: #555;
    color: #ccc;
}

.primary-btn {
    background-color: #444;
    color: #e0e0e0;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
    margin-top: 0;
}

.primary-btn:hover:not(:disabled) {
    background-color: #636363;
}

.primary-btn:hover:not(:disabled) .arrow-icon {
    filter: brightness(0) saturate(100%) invert(88%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
}

.primary-btn:active:not(:disabled) {
    background-color: #555;
}

.primary-btn:disabled {
    background-color: #333;
    color: #666;
    opacity: 0.5;
}

.arrow-icon {
    width: 16px;
    height: 16px;
    transform: scaleX(-1);
    filter: brightness(0) saturate(100%) invert(88%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(224%) contrast(224%);
}

.primary-btn:disabled .arrow-icon {
    filter: brightness(0) saturate(100%) invert(40%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(102%) contrast(102%);
}

.skip-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    width: 100%;
    padding: 14px 8px;
    margin-top: 0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.skip-btn:hover {
    color: #aaa;
    background-color: #333;
}

.error {
    color: #ff6b6b;
    font-size: 13px;
    text-align: center;
    margin-top: 12px;
    min-height: 16px;
}

.back-arrow {
    position: absolute;
    top: 10px;
    left: 15px;
    width: 12px;
    height: 12px;
    background-image: url('backArrow.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    z-index: 1002;
    color: #888;
    opacity: 1;
}

.back-arrow:hover {
    color: #aaa;
    opacity: 0.8;
}

#authForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#authForm input {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 10px;
    font-family: inherit;
    outline: none;
}

#authForm button {
    background-color: #444;
    color: #e0e0e0;
    border: none;
    border-radius: 5px;
    padding: 10px;
    cursor: pointer;
    font-family: inherit;
}

#authForm button:hover {
    background-color: #555;
}

.error {
    color: #ff6b6b;
    text-align: center;
    margin-top: 10px;
}

.success {
    color: #888;
    text-align: center;
    margin-top: 10px;
}

.card-text {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    max-width: 100%;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.card-text[contenteditable="true"] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    cursor: text !important;
}

.header {
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    color: #ccc;
    cursor: move;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    padding: 10px;
    z-index: 20;
    white-space: nowrap;
    overflow: visible;
}

.header-text[contenteditable="true"] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    cursor: text !important;
}

.header.selected {
    box-shadow: 0 0 0 2px #666;
    border-radius: 3px;
}

.header .delete-btn {
    font-size: 16px;
    visibility: hidden;
}

.header:hover .delete-btn {
    visibility: visible;
}

.minimize-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    color: #e0e0e0;
}

.agenda.minimized .agenda-scroll-container {
    display: none;
}

.agenda.minimized {
    height: auto !important;
}

.agenda.minimized .resize-handle {
    display: none;
}

.agenda-scroll-container {
    max-height: 400px;
    overflow-y: auto;
    position: relative; /* Add this for proper positioning of time indicator */
    /* Hide scrollbar for webkit browsers */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.agenda-scroll-container::-webkit-scrollbar {
    display: none;
}

.agenda.docking-preview {
    border: 2px solid #666;
    box-shadow: 0 0 10px rgba(102, 102, 102, 0.5);
}

.agenda.docked-left {
    border-radius: 0;
    border-left: none;
    border-top: none;
    border-bottom: none;
    max-height: 100vh;
}

.agenda.docked-left .agenda-scroll-container {
    max-height: calc(100vh - 50px);
}

.agenda.docked-left .resize-handle {
    display: none;
}

.agenda.docked-left .agenda-header {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* Agenda Styles */
.agenda {
    position: absolute;
    width: 300px;
    background-color: #2c2c2c;
    border: 1px solid #444;
    border-radius: 5px;
    cursor: move;
    user-select: none;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
    z-index: 5;
}

.resize-handle {
    position: absolute;
    background-color: transparent;
}

.resize-handle-top {
    top: -3px;
    left: 0;
    width: 100%;
    height: 6px;
    cursor: ns-resize;
}

.resize-handle-right {
    top: 0;
    right: -3px;
    width: 6px;
    height: 100%;
    cursor: ew-resize;
}

.resize-handle-bottom {
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 6px;
    cursor: ns-resize;
}

.resize-handle-left {
    top: 0;
    left: -3px;
    width: 6px;
    height: 100%;
    cursor: ew-resize;
}

.resize-handle-top-left {
    top: -3px;
    left: -3px;
    width: 12px;
    height: 12px;
    cursor: nw-resize;
}

.resize-handle-top-right {
    top: -3px;
    right: -3px;
    width: 12px;
    height: 12px;
    cursor: ne-resize;
}

.resize-handle-bottom-left {
    bottom: -3px;
    left: -3px;
    width: 12px;
    height: 12px;
    cursor: ne-resize;
}

.resize-handle-bottom-right {
    bottom: -3px;
    right: -3px;
    width: 12px;
    height: 12px;
    cursor: nw-resize;
}

.agenda-header {
    background: rgba(34, 34, 34, 0.9);
    padding: 12px 15px;
    border-bottom: 1px solid rgba(68, 68, 68, 0.3);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 20px;
}

.agenda-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.old-tasks-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 140, 0, 0.15);
    border: 1px solid rgba(255, 140, 0, 0.4);
    border-radius: 12px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
    color: #ff8c00;
    transition: all 0.2s ease;
}

.old-tasks-btn:hover {
    background: rgba(255, 140, 0, 0.25);
    border-color: rgba(255, 140, 0, 0.6);
}

.old-tasks-text {
    font-weight: 500;
}

.old-tasks-indicator {
    width: 6px;
    height: 6px;
    background: #ff8c00;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

.date-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.nav-arrow {
    background-color: #555;
    border: none;
    color: #e0e0e0;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background-color 0.2s ease;
}

.nav-arrow:hover {
    background-color: #666;
}

.current-date {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
    min-width: 80px;
    text-align: center;
}

.current-date:hover {
    background-color: #555;
}

.date-picker {
    position: absolute;
    z-index: 1000;
    background-color: #2c2c2c;
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 3px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    padding: 4px 8px;
}

.date-picker::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.date-picker::-webkit-inner-spin-button {
    display: none;
}

.date-picker:focus {
    outline: none;
    border-color: #666;
    box-shadow: 0 0 0 2px rgba(102, 102, 102, 0.3);
}

/* Style the date picker dropdown when it opens */
.date-picker::-webkit-datetime-edit {
    color: #e0e0e0;
}

.date-picker::-webkit-datetime-edit-fields-wrapper {
    background-color: #2c2c2c;
}

.date-picker::-webkit-datetime-edit-text {
    color: #e0e0e0;
}

.date-picker::-webkit-datetime-edit-month-field,
.date-picker::-webkit-datetime-edit-day-field,
.date-picker::-webkit-datetime-edit-year-field {
    color: #e0e0e0;
}

/* Custom Calendar Dropdown */
.custom-calendar {
    position: absolute;
    background-color: #2c2c2c;
    border: 1px solid #444;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 1001;
    padding: 12px;
    min-width: 280px;
    display: none;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 4px;
}

.calendar-nav {
    background-color: #444;
    border: none;
    color: #e0e0e0;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background-color 0.2s ease;
}

.calendar-nav:hover {
    background-color: #555;
}

.calendar-month-year {
    color: #e0e0e0;
    font-weight: bold;
    font-size: 16px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day-header {
    text-align: center;
    padding: 8px 4px;
    font-size: 12px;
    color: #999;
    font-weight: bold;
}

.calendar-day {
    text-align: center;
    padding: 8px 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    color: #e0e0e0;
    font-size: 14px;
}

.calendar-day:hover {
    background-color: #3c3c3c;
}

.calendar-day.selected {
    background-color: #666;
    color: #ffffff;
}

.calendar-day.other-month {
    color: #666;
}

.calendar-day.today {
    background-color: #444;
    font-weight: bold;
}

.calendar-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #444;
}

.calendar-footer button {
    background-color: #444;
    color: #e0e0e0;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.calendar-footer button:hover {
    background-color: #555;
}

.time-slot {
    padding: 10px;
    border-bottom: 1px solid #444;
    min-height: 30px;
    display: flex;
}

.time-label {
    width: 60px;
}

.slot-content {
    flex-grow: 1;
    min-height: 20px;
}

.card-in-slot {
    width: auto;
    min-height: auto;
    position: relative;
    margin-bottom: 5px;
    padding: 5px;
    background-color: #3e3e3e;
    border-radius: 3px;
}

.card-in-slot .delete-btn {
    visibility: hidden;
}

.card-in-slot:hover .delete-btn {
    visibility: visible;
}

.time-indicator {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 100;
    pointer-events: none;
    display: none;
}

.time-indicator-line {
    height: 1px;
    background-color: #ff6b6b;
    margin-left: 0; /* Remove margin to extend full width */
    position: relative;
}

.time-indicator-dot {
    display: none; /* Hide the dot completely */
}

html {
    height: 100%;
    width: 100%;
}

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 6px;
    border: 2px solid #1e1e1e;
    transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

::-webkit-scrollbar-thumb:active {
    background: #666;
}

::-webkit-scrollbar-corner {
    background: #1e1e1e;
}

/* Firefox scrollbar styles */
* {
    scrollbar-width: thin;
    scrollbar-color: #444 #1e1e1e;
}

/* Drag Advance Indicators */
.drag-advance-indicator {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    background-color: rgba(102, 102, 102, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
    pointer-events: none;
}

.drag-advance-indicator.left {
    left: 0;
    border-radius: 5px 0 0 5px;
}

.drag-advance-indicator.right {
    right: 0;
    border-radius: 0 5px 5px 0;
}

.drag-advance-indicator.active {
    opacity: 1;
    background-color: rgba(102, 102, 102, 0.3);
    animation: pulse 0.8s ease-in-out;
}

@keyframes pulse {
    0%, 100% { 
        background-color: rgba(102, 102, 102, 0.3);
    }
    50% { 
        background-color: rgba(102, 102, 102, 0.5);
    }
}

.advance-arrow {
    font-size: 20px;
    color: #e0e0e0;
    margin-bottom: 5px;
}

.advance-text {
    font-size: 10px;
    color: #e0e0e0;
    text-align: center;
    writing-mode: vertical-lr;
    text-orientation: mixed;
    line-height: 1.2;
}

/* Help Button Styles */
.help-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
}

.help-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #555;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: normal;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: background-color 0.2s ease;
}

.help-button:hover {
    background-color: #666;
}

.help-box {
    position: absolute;
    bottom: 50px;
    right: 0;
    width: 280px;
    background-color: #2c2c2c;
    border: 1px solid #444;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.help-box.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.help-header {
    background-color: #3c3c3c;
    padding: 12px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: #ccc;
}

.help-close {
    cursor: pointer;
    font-size: 18px;
    color: #e0e0e0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-close:hover {
    color: #ff6b6b;
}

.help-content {
    padding: 16px;
    line-height: 1.6;
}

.help-content div {
    margin-bottom: 8px;
    color: #e0e0e0;
}

.help-content div:last-child {
    margin-bottom: 0;
}

.help-content strong {
    color: #ccc;
}

/* Mobile Modal Styles */
.mobile-modal {
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.mobile-modal-content {
    width: 90%;
    max-width: 400px;
    text-align: center;
    padding: 30px 20px;
}

.mobile-modal-content h2 {
    margin-top: 0;
    font-size: 24px;
    color: #e0e0e0;
}

.mobile-modal-content p {
    color: #ccc;
    line-height: 1.5;
    margin-bottom: 20px;
}

.email-section {
    background-color: #1e1e1e;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #444;
}

.email-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #e0e0e0;
    font-size: 16px;
}

.email-section input {
    width: 100%;
    background-color: #2c2c2c;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 5px;
    padding: 12px;
    margin-bottom: 15px;
    font-size: 14px;
    box-sizing: border-box;
}

.email-section input:focus {
    outline: none;
    border-color: #666;
}

.email-section button {
    width: 100%;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.email-section button:hover {
    background-color: #45a049;
}

.email-section button:disabled {
    background-color: #666;
}

.mobile-actions {
    margin-top: 20px;
}

.secondary-btn {
    background-color: transparent;
    color: #999;
    border: 1px solid #555;
    border-radius: 5px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background-color: #333;
    color: #ccc;
}

/* Context Menu Styles */
.context-menu {
    position: fixed;
    background-color: #2c2c2c;
    border: 1px solid #444;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    min-width: 180px;
    padding: 4px 0;
    font-size: 13px;
}

.context-menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    color: #e0e0e0;
    transition: background-color 0.1s ease;
}

.context-menu-item:hover:not(.disabled) {
    background-color: #3c3c3c;
}

.context-menu-item.disabled {
    color: #666;
    cursor: default;
}

.context-menu-separator {
    height: 1px;
    background-color: #444;
    margin: 4px 0;
}

.menu-text {
    flex-grow: 1;
}

.menu-shortcut {
    color: #999;
    font-size: 11px;
    margin-left: 20px;
}

/* Eisenhower Matrix Styles */
.eisenhower-matrix {
    position: absolute;
    border: 2px solid #666;
    background-color: rgba(102, 102, 102, 0.05);
    z-index: 5;
    border-radius: 8px;
}

.eisenhower-matrix.drawing {
    pointer-events: none;
}

.eisenhower-matrix.matrix-object {
    pointer-events: none;
    cursor: default;
    user-select: none;
}

/* Cursor styles for selected items dragging */
.selected-drag-area {
    cursor: move !important;
}

.matrix-edge-drag {
    position: absolute;
    pointer-events: all;
    cursor: move;
    background-color: transparent;
    z-index: 6;
}

.eisenhower-matrix.matrix-object.selected {
    border-color: #888;
    box-shadow: 0 0 0 2px rgba(136, 136, 136, 0.3);
}

/* Matrix Resize Handles */
.matrix-resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: transparent;
    border: none;
    opacity: 0;
    z-index: 10;
    pointer-events: all;
}

.matrix-resize-top-left {
    top: -5px;
    left: -5px;
    cursor: nw-resize;
}

.matrix-resize-top-right {
    top: -5px;
    right: -5px;
    cursor: ne-resize;
}

.matrix-resize-bottom-left {
    bottom: -5px;
    left: -5px;
    cursor: ne-resize;
}

.matrix-resize-bottom-right {
    bottom: -5px;
    right: -5px;
    cursor: nw-resize;
}

/* Matrix Edge Drag Areas */
.matrix-edge-drag {
    position: absolute;
    pointer-events: all;
    cursor: move;
    background-color: transparent;
    z-index: 6;
}

.matrix-edge-drag.top {
    top: -15px;
    left: 10px;
    right: 10px;
    height: 20px;
}

.matrix-edge-drag.right {
    top: 10px;
    right: -15px;
    bottom: 10px;
    width: 20px;
}

.matrix-edge-drag.bottom {
    bottom: -15px;
    left: 10px;
    right: 10px;
    height: 20px;
}

.matrix-edge-drag.left {
    top: 10px;
    left: -15px;
    bottom: 10px;
    width: 20px;
}

.matrix-line {
    position: absolute;
    background-color: #666;
    pointer-events: all;
    cursor: move;
}

.matrix-line.vertical {
    width: 21px;
    height: 100%;
    top: 0;
    left: -10px;
    background: linear-gradient(to right, transparent 0%, transparent 10px, #666 10px, #666 11px, transparent 11px, transparent 100%);
}

.matrix-line.horizontal {
    height: 21px;
    width: 100%;
    left: 0;
    top: -10px;
    background: linear-gradient(to bottom, transparent 0%, transparent 10px, #666 10px, #666 11px, transparent 11px, transparent 100%);
}

.matrix-line.vertical:hover {
    background: linear-gradient(to right, transparent 0%, transparent 10px, #888 10px, #888 11px, transparent 11px, transparent 100%);
}

.matrix-line.horizontal:hover {
    background: linear-gradient(to bottom, transparent 0%, transparent 10px, #888 10px, #888 11px, transparent 11px, transparent 100%);
}

.matrix-label {
    position: absolute;
    font-size: 11px;
    font-weight: bold;
    color: #999;
    text-align: center;
    pointer-events: none;
    padding: 4px;
    line-height: 1.2;
    cursor: default;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    max-width: 120px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.matrix-label[contenteditable="true"] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    cursor: text;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.matrix-label.top-left {
    top: 8px;
    left: 8px;
    transform-origin: top left;
}

.matrix-label.top-right {
    top: 8px;
    right: 8px;
    transform-origin: top right;
}

.matrix-label.bottom-left {
    bottom: 8px;
    left: 8px;
    transform-origin: bottom left;
}

.matrix-label.bottom-right {
    bottom: 8px;
    right: 8px;
    transform-origin: bottom right;
}





/* Loading Spinner Styles */
.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(224, 224, 224, 0.3);
    border-radius: 50%;
    border-top-color: #e0e0e0;
    animation: spin 0.8s ease-in-out infinite;
    margin-left: 8px;
    vertical-align: middle;
}

.loading-spinner.hidden {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.auth-step .primary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
}

.auth-step .primary-btn:disabled {
    background-color: #555;
    cursor: default;
    opacity: 0.7;
}

/* Login Reminder Styles */
.login-reminder {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2c2c2c;
    border: 1px solid #666;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideUpFadeIn 0.3s ease-out;
}

@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.reminder-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #e0e0e0;
    font-size: 14px;
}

.reminder-login-btn {
    background-color: #666;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

.reminder-login-btn:hover {
    background-color: #777;
}

.reminder-close {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.reminder-close:hover {
    color: #e0e0e0;
}

/* Enhanced Help Box */
.help-section {
    margin-bottom: 15px;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-content strong {
    color: #ccc;
    display: block;
    margin-bottom: 8px;
}


