/* ==========================================================================
   Image Annotator & Screenshot Markup Tool Styles
   Qukest ERP / Coconut.Core
   ========================================================================== */

#imageAnnotatorModal {
    z-index: 2147483647 !important;
}

#imageAnnotatorModal .modal-dialog {
    max-width: 95vw;
    width: 1200px;
    margin: 1.5vh auto;
    height: 97vh;
    display: flex;
    flex-direction: column;
}

#imageAnnotatorModal .modal-content {
    background: #0f172a;
    color: #f8fafc;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Modal Header */
#imageAnnotatorModal .modal-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#imageAnnotatorModal .modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Modal Body / Workspace */
#imageAnnotatorModal .modal-body {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #090d16;
    position: relative;
}

/* Top Toolbar */
.ia-toolbar {
    background: #1e293b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    z-index: 10;
}

.ia-toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(15, 23, 42, 0.6);
    padding: 3px 6px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ia-toolbar-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-right: 4px;
    padding-left: 2px;
}

/* Tool Buttons */
.ia-tool-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #cbd5e1;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.ia-tool-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.ia-tool-btn.active {
    background: #3b82f6;
    color: #ffffff;
    border-color: #60a5fa;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    font-weight: 600;
}

.ia-tool-btn i {
    font-size: 14px;
}

/* Stroke Width Selector */
.ia-width-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ia-width-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.ia-width-btn.active {
    background: rgba(59, 130, 246, 0.25);
    color: #38bdf8;
    border-color: #38bdf8;
    font-weight: 700;
}

.ia-width-indicator {
    display: inline-block;
    background-color: currentColor;
    border-radius: 50%;
}

/* Color Palette */
.ia-color-palette {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ia-color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    position: relative;
}

.ia-color-swatch:hover {
    transform: scale(1.2);
    border-color: #ffffff;
}

.ia-color-swatch.active {
    transform: scale(1.25);
    border-color: #ffffff;
    box-shadow: 0 0 8px currentColor;
}

.ia-color-swatch.active::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

.ia-color-picker-wrap {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.ia-color-picker-wrap:hover {
    transform: scale(1.15);
    border-color: #ffffff;
}

.ia-color-picker-input {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 44px;
    height: 44px;
    opacity: 0;
    cursor: pointer;
}

/* Canvas Viewport Area */
.ia-viewport {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: radial-gradient(#1e293b 1px, transparent 1px);
    background-size: 16px 16px;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

.ia-canvas-container {
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    overflow: hidden;
    background: #ffffff;
    cursor: crosshair;
    display: inline-block;
    max-width: 100%;
    max-height: 100%;
}

.ia-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    touch-action: none;
}

/* Bottom Footer Bar */
#imageAnnotatorModal .modal-footer {
    background: #1e293b;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ia-footer-hints {
    font-size: 11.5px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ia-footer-hints kbd {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 10px;
}

/* Annotate Button Overlay on Image Previews */
.ist-att-annotate-btn,
.att-annotate-badge-btn {
    position: absolute;
    bottom: 4px;
    left: 4px;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.85);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    z-index: 4;
    transition: all 0.15s ease;
    backdrop-filter: blur(2px);
}

.ist-att-annotate-btn:hover,
.att-annotate-badge-btn:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
    transform: scale(1.05);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #imageAnnotatorModal .modal-dialog {
        max-width: 100vw;
        width: 100vw;
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    #imageAnnotatorModal .modal-content {
        border-radius: 0;
        height: 100vh;
    }

    .ia-toolbar {
        padding: 6px 8px;
        gap: 6px;
    }

    .ia-toolbar-group {
        padding: 2px 4px;
        gap: 2px;
    }

    .ia-tool-btn {
        padding: 4px 6px;
        font-size: 11px;
    }

    .ia-tool-btn span {
        display: none;
    }

    .ia-tool-btn i {
        font-size: 13px;
    }

    .ia-width-btn {
        padding: 3px 6px;
        font-size: 10px;
    }

    .ia-color-swatch {
        width: 18px;
        height: 18px;
    }

    .ia-footer-hints {
        display: none;
    }

    #imageAnnotatorModal .modal-footer {
        padding: 8px 12px;
    }
}
