/* AODA Widget Base */
#aoda-widget {
    position: fixed;
    bottom: 20px;
    z-index: 999999;
}
#aoda-widget.aoda-pos-left { left: 20px; }
#aoda-widget.aoda-pos-right { right: 20px; }

@media (max-width: 767px) {
    #aoda-widget {
        bottom: 14px;
    }
    #aoda-widget.aoda-pos-left { left: 14px; }
    #aoda-widget.aoda-pos-right { right: 14px; }
}

/* The Toggle Button */
.aoda-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--primary-color, #2563eb);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
}
.aoda-btn:hover {
    transform: scale(1.05);
    background-color: var(--hover-color, #1d4ed8);
}

/* The Panel */
.aoda-panel {
    position: absolute;
    bottom: 60px;
    width: 250px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    display: none; /* toggled via JS */
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
}
#aoda-widget.aoda-pos-left .aoda-panel { left: 0; }
#aoda-widget.aoda-pos-right .aoda-panel { right: 0; }

.aoda-panel.aoda-active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.aoda-panel-header {
    background: #1e293b;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.aoda-panel-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}
#aoda-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
}

.aoda-panel-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Tool Buttons */
.aoda-tool-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.aoda-tool-btn:hover {
    background: #f3f4f6;
}
.aoda-tool-btn.aoda-on {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}
.aoda-tool-btn.aoda-on i {
    color: #2563eb;
}

.aoda-reset-btn {
    margin-top: 10px;
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}
.aoda-reset-btn:hover {
    text-decoration: underline;
}
.aoda-tool-hint {
    color: #6b7280;
    font-size: 12px;
    margin-top: -5px;
    margin-bottom: 5px;
    line-height: 1.2;
}

/* =========================================================
   3) GRAYSCALE (Monohromatski)
   (Applies only to content wrappers to protect fixed UI overlays, 
   then manually adds grayscale to the UI overlays themselves)
========================================================= */
body.aoda-grayscale main,
body.aoda-grayscale header,
body.aoda-grayscale footer,
body.aoda-grayscale section,
body.aoda-grayscale .back-to-top,
body.aoda-grayscale #aoda-toggle-btn,
body.aoda-grayscale #aoda-panel,
body.aoda-grayscale .chat-widget,
body.aoda-grayscale #logo {
    filter: grayscale(100%) !important;
}

/* Monochrome / High Contrast Mode */
body.aoda-monochrome::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 999900;
    pointer-events: none;
    backdrop-filter: contrast(150%) saturate(0%) brightness(110%);
    -webkit-backdrop-filter: contrast(150%) saturate(0%) brightness(110%);
}

/* Screen Reader Focus Outline */
body.aoda-screenreader * {
    /* Optional: make tab focus visually obvious everywhere */
}
body.aoda-screenreader *:focus {
    outline: 4px dashed #ef4444 !important;
    outline-offset: -4px !important;
    box-shadow: inset 0 0 0 4px rgba(239, 68, 68, 0.2); /* Extra visibility */
}

/* Fix for rounded images inside overflow: hidden wrappers */
body.aoda-screenreader img:focus {
    outline: none !important; 
}
body.aoda-screenreader *:has(> img:focus) {
    outline: 4px dashed #ef4444 !important;
    outline-offset: 4px !important;
}
