/*
 * Alliance Grant Support — In-Page Admin & Live Editor Styles
 */

#ags-admin-dock {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    background: #09243f;
    border: 2px solid #df3128;
    border-radius: 50px;
    padding: 8px 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#ags-admin-dock .dock-title {
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

#ags-admin-dock .dock-title .status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    box-shadow: 0 0 8px #10b981;
}

#ags-admin-dock .dock-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#ags-admin-dock .dock-btn:hover {
    background: #df3128;
    border-color: #df3128;
    color: #ffffff;
}

#ags-admin-dock .dock-btn.save-btn {
    background: #df3128;
    border-color: #df3128;
}

#ags-admin-dock .dock-btn.save-btn:hover {
    background: #c4251e;
}

/* Editable element highlights */
body.ags-editing-active [data-ags-editable] {
    outline: 2px dashed rgba(223, 49, 40, 0.4);
    outline-offset: 4px;
    cursor: text;
    transition: outline 0.2s ease, background 0.2s ease;
}

body.ags-editing-active [data-ags-editable]:hover {
    outline: 2px solid #df3128;
    background: rgba(223, 49, 40, 0.05);
}

body.ags-editing-active [data-ags-editable]:focus {
    outline: 2px solid #0e69c9;
    background: rgba(14, 105, 201, 0.08);
}

/* Image replacement trigger */
.ags-img-wrapper {
    position: relative !important;
    display: inline-block !important;
}

.ags-img-replace-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(9, 36, 63, 0.92);
    backdrop-filter: blur(8px);
    border: 2px solid #df3128;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ags-img-wrapper:hover .ags-img-replace-btn {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.ags-img-replace-btn:hover {
    background: #df3128;
    transform: translate(-50%, -50%) scale(1.05);
}

/* Image Upload Modal */
#ags-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

#ags-image-modal.active {
    opacity: 1;
    pointer-events: auto;
}

#ags-image-modal .modal-box {
    background: #ffffff;
    border-radius: 20px;
    padding: 32px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a202c;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

#ags-image-modal.active .modal-box {
    transform: translateY(0);
}

#ags-image-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

#ags-image-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #09243f;
}

#ags-image-modal .modal-header .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #718096;
}

#ags-image-modal .dimension-badge {
    display: inline-block;
    background: #f0f6ff;
    border: 1px solid #0e69c9;
    color: #0e69c9;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 16px;
}

#ags-image-modal .preview-area {
    width: 100%;
    height: 200px;
    background: #f8fafc;
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
}

#ags-image-modal .preview-area img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#ags-image-modal .upload-label {
    display: block;
    background: #0e69c9;
    color: #ffffff;
    text-align: center;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-bottom: 12px;
}

#ags-image-modal .upload-label:hover {
    background: #0b57a8;
}

#ags-image-modal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

#ags-image-modal .btn-cancel {
    background: #edf2f7;
    border: none;
    color: #4a5568;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

#ags-image-modal .btn-confirm {
    background: #df3128;
    border: none;
    color: #ffffff;
    padding: 10px 22px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

#ags-image-modal .btn-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
