/* ============================================================================
   SMART TEACHER — Image Editor Styles
   Canvas editor overlay for homework review annotations
   ============================================================================ */

.editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: #000;
    display: flex;
    flex-direction: column;
}

/* --------------------------------------------------------------------------
   Toolbar
   -------------------------------------------------------------------------- */
.editor-toolbar {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1001;
    /* Safe area for notched devices */
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
}

.editor-toolbar button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

.editor-toolbar button:active {
    background: rgba(255, 255, 255, 0.3);
}

.editor-toolbar button:disabled {
    opacity: 0.3;
    cursor: default;
}

.editor-toolbar button:disabled:active {
    background: rgba(255, 255, 255, 0.15);
}

.editor-toolbar button.editor-btn-save {
    background: #22C55E;
    color: white;
}

.editor-toolbar button.editor-btn-save:active {
    background: #16A34A;
}

.editor-toolbar button.editor-btn-close {
    background: rgba(255, 255, 255, 0.1);
}

.editor-toolbar .spacer {
    flex: 1;
}

/* --------------------------------------------------------------------------
   Canvas container
   -------------------------------------------------------------------------- */
.editor-canvas-container {
    flex: 1;
    overflow: hidden;
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    -webkit-user-select: none;
    user-select: none;
}

.editor-canvas {
    max-width: 100%;
    max-height: 100%;
}

/* --------------------------------------------------------------------------
   Dropdown menu
   -------------------------------------------------------------------------- */
.editor-menu {
    position: absolute;
    top: 60px;
    right: 12px;
    background: #333;
    border-radius: 8px;
    padding: 4px 0;
    z-index: 1002;
    min-width: 220px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    animation: editor-menu-in 0.15s ease-out;
}

@keyframes editor-menu-in {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.editor-menu-item {
    padding: 12px 16px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-family: var(--font-family, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    -webkit-tap-highlight-color: transparent;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.editor-menu-item:active,
.editor-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.editor-menu-item.active::after {
    content: '\2713';
    margin-left: auto;
    color: #22C55E;
}

.editor-menu-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
    margin: 4px 0;
}

.editor-menu-item .brush-preview {
    display: inline-block;
    border-radius: 50%;
    background: #E53E3E;
}

/* --------------------------------------------------------------------------
   Menu backdrop (click-to-close)
   -------------------------------------------------------------------------- */
.editor-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
}
