/* SeggWat Screenshot Annotation Styles */
/* Version: 1.5.0 */
/* Fullscreen mode with zoom/pan support */
/* Added: stroke width selector, selection mode, keyboard shortcuts overlay */
/* Added: text input modal, color presets, pan mode indicator, capturing overlay */
/* Added: opacity slider, drag-to-move annotations */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --seggwat-screenshot-color: #2563eb;
    --seggwat-screenshot-hover: #1e40af;
    --seggwat-screenshot-outline: rgba(37, 99, 235, 0.2);
    --seggwat-screenshot-bg: #0f172a;
    --seggwat-screenshot-surface: #1e293b;
    --seggwat-screenshot-border: #334155;
    --seggwat-screenshot-text: #f8fafc;
    --seggwat-screenshot-text-muted: #94a3b8;
    --seggwat-screenshot-danger: #ef4444;
    --seggwat-screenshot-selection: #fbbf24;
}

/* ========================================
   Fullscreen Overlay
   ======================================== */
.screenshot-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    background-color: var(--seggwat-screenshot-bg);
    animation: screenshotFadeIn 0.2s ease-out;
}

@keyframes screenshotFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================
   Modal Container (Fullscreen)
   ======================================== */
.screenshot-modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background-color: var(--seggwat-screenshot-bg);
    overflow: hidden;
}

/* ========================================
   Modal Header
   ======================================== */
.screenshot-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--seggwat-screenshot-border);
    background-color: var(--seggwat-screenshot-surface);
    flex-shrink: 0;
}

.screenshot-modal-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--seggwat-screenshot-text);
}

.screenshot-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.screenshot-close-btn,
.screenshot-help-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--seggwat-screenshot-text-muted);
    cursor: pointer;
    transition:
        background-color 0.2s,
        color 0.2s;
}

.screenshot-close-btn:hover,
.screenshot-help-btn:hover {
    background-color: var(--seggwat-screenshot-border);
    color: var(--seggwat-screenshot-text);
}

.screenshot-help-btn {
    font-size: 18px;
    font-weight: 600;
}

/* ========================================
   Toolbar
   ======================================== */
.screenshot-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--seggwat-screenshot-surface);
    border-bottom: 1px solid var(--seggwat-screenshot-border);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.screenshot-tools,
.screenshot-history-tools,
.screenshot-zoom-tools,
.screenshot-stroke-tools {
    display: flex;
    gap: 4px;
}

.screenshot-toolbar-divider {
    width: 1px;
    height: 28px;
    background-color: var(--seggwat-screenshot-border);
    margin: 0 8px;
}

.screenshot-tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--seggwat-screenshot-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

/* Tool buttons with labels */
.screenshot-tool-btn.with-label {
    padding: 0 12px;
}

.screenshot-tool-btn .tool-label {
    font-size: 12px;
    font-weight: 500;
    display: none;
}

/* Show labels on desktop by default for drawing tools */
@media (min-width: 1024px) {
    .screenshot-tools .screenshot-tool-btn .tool-label {
        display: inline;
    }

    .screenshot-tools .screenshot-tool-btn {
        padding: 0 12px;
    }
}

.screenshot-tool-btn:hover:not(:disabled) {
    background-color: var(--seggwat-screenshot-border);
    color: var(--seggwat-screenshot-text);
}

.screenshot-tool-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.screenshot-tool-btn.active {
    background-color: var(--seggwat-screenshot-color);
    color: white;
    border-color: var(--seggwat-screenshot-color);
}

/* Delete button for selection mode */
.screenshot-tool-btn.delete-btn {
    color: var(--seggwat-screenshot-danger);
}

.screenshot-tool-btn.delete-btn:hover:not(:disabled) {
    background-color: var(--seggwat-screenshot-danger);
    color: white;
}

.screenshot-tool-btn.delete-btn:disabled {
    opacity: 0.3;
}

/* Color picker */
.screenshot-color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.screenshot-color-label {
    font-size: 13px;
    color: var(--seggwat-screenshot-text-muted);
}

.screenshot-color-picker {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 2px solid var(--seggwat-screenshot-border);
    border-radius: 6px;
    cursor: pointer;
    background: none;
}

.screenshot-color-picker::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.screenshot-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

/* ========================================
   Stroke Width Selector
   ======================================== */
.screenshot-stroke-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.screenshot-stroke-label {
    font-size: 13px;
    color: var(--seggwat-screenshot-text-muted);
}

.screenshot-stroke-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--seggwat-screenshot-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.screenshot-stroke-btn:hover {
    background-color: var(--seggwat-screenshot-border);
    color: var(--seggwat-screenshot-text);
}

.screenshot-stroke-btn.active {
    background-color: var(--seggwat-screenshot-color);
    color: white;
    border-color: var(--seggwat-screenshot-color);
}

.screenshot-stroke-icon {
    border-radius: 2px;
    background-color: currentColor;
}

.screenshot-stroke-icon.thin {
    width: 16px;
    height: 2px;
}

.screenshot-stroke-icon.medium {
    width: 16px;
    height: 4px;
}

.screenshot-stroke-icon.thick {
    width: 16px;
    height: 6px;
}

/* ========================================
   Opacity Slider
   ======================================== */
.screenshot-opacity-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.screenshot-opacity-label {
    font-size: 13px;
    color: var(--seggwat-screenshot-text-muted);
    white-space: nowrap;
}

.screenshot-opacity-slider {
    width: 80px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--seggwat-screenshot-border);
    border-radius: 3px;
    cursor: pointer;
}

.screenshot-opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--seggwat-screenshot-color);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.screenshot-opacity-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.screenshot-opacity-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--seggwat-screenshot-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.screenshot-opacity-value {
    font-size: 12px;
    font-weight: 500;
    color: var(--seggwat-screenshot-text-muted);
    min-width: 36px;
    text-align: center;
}

/* Zoom level indicator */
.screenshot-zoom-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    height: 28px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--seggwat-screenshot-text-muted);
    background-color: var(--seggwat-screenshot-bg);
    border-radius: 4px;
    user-select: none;
}

/* ========================================
   Color Presets
   ======================================== */
.screenshot-color-presets-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.screenshot-color-presets {
    display: flex;
    gap: 4px;
}

.screenshot-color-preset {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.screenshot-color-preset:hover {
    transform: scale(1.1);
}

.screenshot-color-preset.active {
    border-color: white;
    box-shadow: 0 0 0 2px var(--seggwat-screenshot-color);
}

/* Hide color section when blackout tool is active */
.screenshot-toolbar.blackout-active .screenshot-color-picker-wrapper,
.screenshot-toolbar.blackout-active .screenshot-color-presets-wrapper {
    opacity: 0.3;
    pointer-events: none;
}

/* ========================================
   Pan Mode Indicator
   ======================================== */
.screenshot-pan-mode-indicator {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--seggwat-screenshot-text);
    background-color: var(--seggwat-screenshot-color);
    border-radius: 4px;
    margin-left: 8px;
}

.screenshot-pan-mode-indicator.visible {
    display: flex;
}

.screenshot-pan-mode-indicator svg {
    width: 14px;
    height: 14px;
}

/* ========================================
   Capturing Overlay
   ======================================== */
.screenshot-capturing-overlay {
    position: fixed;
    inset: 0;
    z-index: 10003;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background-color: rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.2s,
        visibility 0.2s;
}

.screenshot-capturing-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.screenshot-capturing-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--seggwat-screenshot-border);
    border-top-color: var(--seggwat-screenshot-color);
    border-radius: 50%;
    animation: screenshotSpin 1s linear infinite;
}

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

.screenshot-capturing-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--seggwat-screenshot-text);
}

/* ========================================
   Text Input Modal
   ======================================== */
.screenshot-text-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10004;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.2s,
        visibility 0.2s;
}

.screenshot-text-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.screenshot-text-modal {
    background-color: var(--seggwat-screenshot-surface);
    border: 1px solid var(--seggwat-screenshot-border);
    border-radius: 12px;
    padding: 20px;
    min-width: 320px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.screenshot-text-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.screenshot-text-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--seggwat-screenshot-text);
}

.screenshot-text-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--seggwat-screenshot-text-muted);
    cursor: pointer;
    transition:
        background-color 0.2s,
        color 0.2s;
}

.screenshot-text-modal-close:hover {
    background-color: var(--seggwat-screenshot-border);
    color: var(--seggwat-screenshot-text);
}

.screenshot-text-modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.screenshot-text-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    background-color: var(--seggwat-screenshot-bg);
    border: 1px solid var(--seggwat-screenshot-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: var(--seggwat-screenshot-text);
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.screenshot-text-textarea:focus {
    border-color: var(--seggwat-screenshot-color);
}

.screenshot-text-textarea::placeholder {
    color: var(--seggwat-screenshot-text-muted);
}

.screenshot-text-options {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.screenshot-text-option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.screenshot-text-option-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--seggwat-screenshot-text-muted);
}

.screenshot-font-size-buttons {
    display: flex;
    gap: 4px;
}

.screenshot-font-size-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background-color: transparent;
    border: 1px solid var(--seggwat-screenshot-border);
    border-radius: 6px;
    font-size: 12px;
    color: var(--seggwat-screenshot-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.screenshot-font-size-btn:hover {
    background-color: var(--seggwat-screenshot-border);
    color: var(--seggwat-screenshot-text);
}

.screenshot-font-size-btn.active {
    background-color: var(--seggwat-screenshot-color);
    border-color: var(--seggwat-screenshot-color);
    color: white;
}

.screenshot-text-color-preview {
    display: flex;
    align-items: center;
    gap: 8px;
}

.screenshot-text-color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid var(--seggwat-screenshot-border);
}

.screenshot-text-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

/* ========================================
   Floating Done Button (Mobile)
   ======================================== */
.screenshot-floating-done {
    display: none;
    position: absolute;
    bottom: 100px;
    right: 20px;
    padding: 12px 24px;
    background-color: var(--seggwat-screenshot-color);
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    z-index: 10;
    transition: all 0.2s;
}

.screenshot-floating-done:hover {
    background-color: var(--seggwat-screenshot-hover);
    transform: translateY(-2px);
}

.screenshot-floating-done:active {
    transform: translateY(0);
}

/* ========================================
   Selected Tool Indicator
   ======================================== */
.screenshot-selected-tool-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    font-size: 12px;
    color: var(--seggwat-screenshot-text-muted);
    background-color: var(--seggwat-screenshot-bg);
    border-radius: 4px;
    margin-left: auto;
}

.screenshot-selected-tool-indicator .tool-name {
    color: var(--seggwat-screenshot-text);
    font-weight: 500;
}

/* Hide on smaller screens */
@media (max-width: 1024px) {
    .screenshot-selected-tool-indicator {
        display: none;
    }
}

/* ========================================
   Canvas Container
   ======================================== */
.screenshot-canvas-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--seggwat-screenshot-bg);
    overflow: hidden;
    touch-action: none;
}

/* Checkerboard pattern for transparency */
.screenshot-canvas-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(45deg, #1e293b 25%, transparent 25%),
        linear-gradient(-45deg, #1e293b 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1e293b 75%),
        linear-gradient(-45deg, transparent 75%, #1e293b 75%);
    background-size: 20px 20px;
    background-position:
        0 0,
        0 10px,
        10px -10px,
        -10px 0px;
    opacity: 0.3;
    pointer-events: none;
}

.screenshot-canvas-wrapper {
    position: relative;
    transform-origin: center center;
    transition: none;
    will-change: transform;
}

.screenshot-canvas-wrapper.animating {
    transition: transform 0.2s ease-out;
}

#screenshot-base-canvas,
#screenshot-annotation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

#screenshot-annotation-canvas {
    cursor: crosshair;
}

/* Cursor states for different tools/modes */
#screenshot-annotation-canvas.cursor-select {
    cursor: default;
}

#screenshot-annotation-canvas.cursor-select.cursor-move {
    cursor: move;
}

#screenshot-annotation-canvas.cursor-select.dragging {
    cursor: grabbing;
}

#screenshot-annotation-canvas.cursor-arrow {
    cursor: crosshair;
}

#screenshot-annotation-canvas.cursor-rectangle {
    cursor: crosshair;
}

#screenshot-annotation-canvas.cursor-blackout {
    cursor: crosshair;
}

#screenshot-annotation-canvas.cursor-pen {
    cursor:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='3' fill='%23FF0000' stroke='white' stroke-width='1'/%3E%3C/svg%3E")
            12 12,
        crosshair;
}

#screenshot-annotation-canvas.cursor-text {
    cursor: text;
}

#screenshot-annotation-canvas.cursor-pan {
    cursor: grab;
}

#screenshot-annotation-canvas.cursor-pan.panning {
    cursor: grabbing;
}

/* ========================================
   Text Input
   ======================================== */
.screenshot-text-input {
    position: absolute;
    min-width: 100px;
    padding: 6px 10px;
    background-color: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--seggwat-screenshot-color);
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: 16px;
    outline: none;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.screenshot-text-input::placeholder {
    color: #9ca3af;
}

/* ========================================
   Modal Footer
   ======================================== */
.screenshot-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid var(--seggwat-screenshot-border);
    background-color: var(--seggwat-screenshot-surface);
    flex-shrink: 0;
}

.screenshot-powered-by {
    font-size: 12px;
    color: var(--seggwat-screenshot-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.screenshot-powered-by:hover {
    color: var(--seggwat-screenshot-text);
}

.screenshot-actions {
    display: flex;
    gap: 12px;
}

/* ========================================
   Buttons
   ======================================== */
.screenshot-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.screenshot-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.screenshot-btn-secondary {
    background-color: var(--seggwat-screenshot-border);
    color: var(--seggwat-screenshot-text);
}

.screenshot-btn-secondary:hover:not(:disabled) {
    background-color: #475569;
}

.screenshot-btn-primary {
    background-color: var(--seggwat-screenshot-color);
    color: white;
}

.screenshot-btn-primary:hover:not(:disabled) {
    background-color: var(--seggwat-screenshot-hover);
}

/* ========================================
   Zoom Controls (Floating)
   ======================================== */
.screenshot-zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background-color: var(--seggwat-screenshot-surface);
    border: 1px solid var(--seggwat-screenshot-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 5;
}

.screenshot-zoom-controls .screenshot-tool-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
}

.screenshot-zoom-controls .screenshot-zoom-indicator {
    font-size: 11px;
    min-width: 32px;
    height: 24px;
    padding: 0 4px;
    margin: 4px 0;
    background-color: transparent;
}

/* ========================================
   Mini Map (for zoomed view navigation)
   ======================================== */
.screenshot-minimap {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 150px;
    background-color: var(--seggwat-screenshot-surface);
    border: 1px solid var(--seggwat-screenshot-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    z-index: 5;
    opacity: 0;
    transform: translateY(10px);
    transition:
        opacity 0.2s,
        transform 0.2s;
    pointer-events: none;
}

.screenshot-minimap.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.screenshot-minimap canvas {
    display: block;
    width: 100%;
    height: auto;
}

.screenshot-minimap-viewport {
    position: absolute;
    border: 2px solid var(--seggwat-screenshot-color);
    background-color: rgba(37, 99, 235, 0.15);
    pointer-events: none;
}

/* ========================================
   Notification
   ======================================== */
.screenshot-notification {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    opacity: 0;
    transition:
        transform 0.3s ease-out,
        opacity 0.3s ease-out;
}

.screenshot-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.screenshot-notification-success {
    background-color: #059669;
}

.screenshot-notification-error {
    background-color: #dc2626;
}

.screenshot-notification-info {
    background-color: #2563eb;
}

/* ========================================
   Keyboard Shortcuts Overlay
   ======================================== */
.screenshot-shortcuts-overlay {
    position: fixed;
    inset: 0;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.2s,
        visibility 0.2s;
}

.screenshot-shortcuts-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.screenshot-shortcuts-modal {
    background-color: var(--seggwat-screenshot-surface);
    border: 1px solid var(--seggwat-screenshot-border);
    border-radius: 12px;
    padding: 24px;
    min-width: 320px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.screenshot-shortcuts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.screenshot-shortcuts-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--seggwat-screenshot-text);
}

.screenshot-shortcuts-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--seggwat-screenshot-text-muted);
    cursor: pointer;
    transition:
        background-color 0.2s,
        color 0.2s;
}

.screenshot-shortcuts-close:hover {
    background-color: var(--seggwat-screenshot-border);
    color: var(--seggwat-screenshot-text);
}

.screenshot-shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.screenshot-shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.screenshot-shortcut-keys {
    display: flex;
    gap: 4px;
}

.screenshot-shortcut-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    background-color: var(--seggwat-screenshot-bg);
    border: 1px solid var(--seggwat-screenshot-border);
    border-radius: 6px;
    font-family:
        ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    font-weight: 500;
    color: var(--seggwat-screenshot-text);
}

.screenshot-shortcut-desc {
    font-size: 14px;
    color: var(--seggwat-screenshot-text-muted);
    text-align: right;
}

/* ========================================
   Mobile Toolbar (Top-positioned)
   ======================================== */
@media (max-width: 768px) {
    .screenshot-modal-header {
        padding: 10px 16px;
    }

    .screenshot-modal-header h2 {
        font-size: 14px;
    }

    /* Mobile toolbar at top, inline with content flow */
    .screenshot-toolbar {
        position: relative;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 4px;
        padding: 8px 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .screenshot-toolbar::-webkit-scrollbar {
        display: none;
    }

    .screenshot-toolbar-divider {
        margin: 0 4px;
        height: 24px;
        flex-shrink: 0;
    }

    /* Ensure 44px minimum touch targets */
    .screenshot-tool-btn {
        min-width: 44px;
        height: 44px;
        flex-shrink: 0;
        padding: 0;
    }

    .screenshot-tool-btn .tool-label {
        display: none;
    }

    .screenshot-stroke-btn {
        min-width: 44px;
        height: 44px;
    }

    .screenshot-color-label,
    .screenshot-stroke-label {
        display: none;
    }

    .screenshot-color-picker {
        width: 40px;
        height: 40px;
    }

    /* Color presets on mobile */
    .screenshot-color-presets-wrapper {
        gap: 4px;
    }

    .screenshot-color-preset {
        width: 32px;
        height: 32px;
    }

    /* Opacity slider on mobile */
    .screenshot-opacity-wrapper {
        gap: 4px;
    }

    .screenshot-opacity-label {
        display: none;
    }

    .screenshot-opacity-slider {
        width: 60px;
    }

    .screenshot-opacity-value {
        min-width: 30px;
        font-size: 11px;
    }

    /* Show floating done button on mobile */
    .screenshot-floating-done {
        display: block;
    }

    /* Hide zoom controls since they're in toolbar */
    .screenshot-zoom-controls {
        display: none;
    }

    /* Pan mode indicator adjustments */
    .screenshot-pan-mode-indicator {
        padding: 4px 8px;
        font-size: 11px;
    }

    .screenshot-modal-footer {
        padding: 10px 16px;
    }

    .screenshot-actions {
        width: 100%;
        justify-content: stretch;
    }

    .screenshot-btn {
        flex: 1;
        padding: 12px 16px;
    }

    .screenshot-powered-by {
        display: none;
    }

    /* Move zoom controls to left side on mobile */
    .screenshot-zoom-controls {
        bottom: auto;
        top: 60px;
        right: 12px;
        padding: 6px;
    }

    .screenshot-zoom-controls .screenshot-tool-btn {
        min-width: 40px;
        width: 40px;
        height: 40px;
    }

    /* Hide minimap on mobile */
    .screenshot-minimap {
        display: none;
    }

    /* Shortcuts modal adjustments */
    .screenshot-shortcuts-modal {
        margin: 16px;
        padding: 16px;
    }

    .screenshot-shortcuts-header h3 {
        font-size: 16px;
    }

    .screenshot-shortcut-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .screenshot-shortcut-desc {
        text-align: left;
    }

    /* Text modal adjustments */
    .screenshot-text-modal {
        margin: 16px;
        min-width: auto;
        width: calc(100% - 32px);
    }

    .screenshot-text-options {
        flex-direction: column;
    }

    .screenshot-font-size-btn {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .screenshot-toolbar {
        gap: 2px;
        padding: 6px 8px;
    }

    /* Maintain 44px touch targets even on smallest screens */
    .screenshot-tool-btn {
        min-width: 44px;
        height: 44px;
    }

    .screenshot-stroke-btn {
        min-width: 44px;
        height: 44px;
    }

    .screenshot-toolbar-divider {
        margin: 0 2px;
    }
}

/* ========================================
   Touch Feedback
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    .screenshot-tool-btn:active:not(:disabled) {
        background-color: var(--seggwat-screenshot-border);
        transform: scale(0.95);
    }

    .screenshot-btn:active:not(:disabled) {
        transform: scale(0.98);
    }

    .screenshot-stroke-btn:active {
        transform: scale(0.95);
    }

    .screenshot-color-preset:active {
        transform: scale(0.9);
    }

    .screenshot-floating-done:active {
        transform: scale(0.95);
    }
}

/* ========================================
   Accessibility
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .screenshot-modal-overlay,
    .screenshot-canvas-wrapper,
    .screenshot-notification,
    .screenshot-minimap,
    .screenshot-shortcuts-overlay {
        animation: none;
        transition: none;
    }

    .screenshot-canvas-wrapper.animating {
        transition: none;
    }
}

/* Focus visible styles */
.screenshot-tool-btn:focus-visible,
.screenshot-btn:focus-visible,
.screenshot-close-btn:focus-visible,
.screenshot-help-btn:focus-visible,
.screenshot-stroke-btn:focus-visible,
.screenshot-shortcuts-close:focus-visible,
.screenshot-color-preset:focus-visible,
.screenshot-font-size-btn:focus-visible,
.screenshot-text-modal-close:focus-visible,
.screenshot-floating-done:focus-visible {
    outline: 2px solid var(--seggwat-screenshot-color);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .screenshot-tool-btn {
        border: 1px solid var(--seggwat-screenshot-text-muted);
    }

    .screenshot-tool-btn.active {
        border: 2px solid white;
    }

    .screenshot-stroke-btn {
        border: 1px solid var(--seggwat-screenshot-text-muted);
    }

    .screenshot-stroke-btn.active {
        border: 2px solid white;
    }

    .screenshot-modal-header,
    .screenshot-toolbar,
    .screenshot-modal-footer {
        border-width: 2px;
    }

    .screenshot-shortcuts-modal {
        border-width: 2px;
    }
}

/* ========================================
   Pinch-to-Zoom Hint (shown briefly)
   ======================================== */
.screenshot-gesture-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 16px 24px;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    color: white;
    font-size: 14px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 20;
}

.screenshot-gesture-hint.visible {
    opacity: 1;
}

.screenshot-gesture-hint svg {
    display: block;
    margin: 0 auto 8px;
}

/* ========================================
   Keyboard Shortcuts Help (inline hint)
   ======================================== */
.screenshot-shortcuts-hint {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background-color: var(--seggwat-screenshot-surface);
    border: 1px solid var(--seggwat-screenshot-border);
    border-radius: 6px;
    font-size: 12px;
    color: var(--seggwat-screenshot-text-muted);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 5;
}

.screenshot-shortcuts-hint.visible {
    opacity: 1;
}

.screenshot-shortcuts-hint kbd {
    display: inline-block;
    padding: 2px 6px;
    margin: 0 2px;
    background-color: var(--seggwat-screenshot-bg);
    border: 1px solid var(--seggwat-screenshot-border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 11px;
}

/* Hide shortcuts hint on mobile */
@media (max-width: 768px) {
    .screenshot-shortcuts-hint {
        display: none;
    }
}
