/* ===== Tab ===== */
#sr-tab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    direction: rtl;
}

#sr-tab-handle {
    background: #E53935;
    color: #fff;
    padding: 18px 18px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 12px 0 0 12px;
    text-align: center;
    user-select: none;
    white-space: nowrap;
    transition: background 0.2s;
    box-shadow: -3px 3px 12px rgba(0,0,0,0.35);
}

#sr-tab-handle:hover {
    background: #C62828;
}

/* ===== Overlay ===== */
#sr-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 999998;
    cursor: crosshair;
    background: rgba(0,0,0,0.12);
}
#sr-overlay.sr-active { display: block; }

/* ===== Banner ===== */
#sr-banner {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000000;
    background: #E53935;
    color: #fff;
    text-align: center;
    padding: 16px;
    font-size: 20px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    direction: rtl;
    box-shadow: 0 3px 12px rgba(0,0,0,0.25);
}
#sr-banner.sr-active { display: block; }

/* ===== PIN — HUGE Google Maps style ===== */
.sr-pin {
    position: absolute;
    width: 100px;
    height: 140px;
    transform: translate(-50%, -100%);
    z-index: 999997;
    cursor: pointer;
    transition: transform 0.15s, filter 0.15s;
    animation: sr-pin-drop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sr-pin:hover {
    transform: translate(-50%, -100%) scale(1.15);
    filter: brightness(1.1);
    z-index: 999998;
}

.sr-pin-svg {
    width: 100px;
    height: 140px;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
}

.sr-pin-num {
    position: absolute;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 28px;
    font-weight: 900;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

@keyframes sr-pin-drop {
    0%   { opacity: 0; transform: translate(-50%, -300%); }
    50%  { opacity: 1; transform: translate(-50%, -85%); }
    70%  { transform: translate(-50%, -108%); }
    100% { transform: translate(-50%, -100%); }
}

/* ===== Add comment popup ===== */
#sr-popup {
    display: none;
    position: fixed;
    z-index: 1000001;
    background: #fff;
    border: 3px solid #E53935;
    border-radius: 14px;
    padding: 18px;
    width: 300px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    direction: rtl;
}
#sr-popup.sr-active { display: block; }

#sr-popup textarea,
.sr-edit-textarea {
    width: 100%;
    height: 90px;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    font-size: 15px;
    resize: vertical;
    direction: rtl;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
#sr-popup textarea:focus,
.sr-edit-textarea:focus {
    border-color: #E53935;
    outline: none;
}

#sr-popup-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

/* ===== Buttons ===== */
.sr-btn {
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    font-weight: 700;
    transition: opacity 0.2s;
    font-family: inherit;
}
.sr-btn:hover { opacity: 0.85; }
.sr-btn-save   { background: #E53935; color: #fff; }
.sr-btn-cancel { background: #f0f0f0; color: #555; }

/* ===== Pin mini-menu ===== */
.sr-pin-menu {
    position: absolute;
    z-index: 1000001;
    display: flex;
    gap: 6px;
    background: #fff;
    border-radius: 12px;
    padding: 8px 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
    left: 50%;
    bottom: 100%;
    margin-bottom: 10px;
    transform: translateX(-50%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    direction: rtl;
    animation: sr-menu-pop 0.2s ease;
}

.sr-pin-menu-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    font-family: inherit;
}

.sr-menu-edit {
    background: #E3F2FD;
    color: #1565C0;
}
.sr-menu-edit:hover { background: #BBDEFB; }

.sr-menu-delete {
    background: #FFEBEE;
    color: #C62828;
}
.sr-menu-delete:hover { background: #FFCDD2; }

@keyframes sr-menu-pop {
    from { opacity: 0; transform: translateX(-50%) scale(0.8); }
    to   { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* ===== Edit popup ===== */
.sr-edit-popup {
    position: fixed;
    z-index: 1000001;
    background: #fff;
    border: 3px solid #1565C0;
    border-radius: 14px;
    padding: 18px;
    width: 300px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    direction: rtl;
    animation: sr-menu-pop 0.2s ease;
}

.sr-edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

/* ===== Toast ===== */
#sr-toast {
    display: none;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    z-index: 1000002;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    direction: rtl;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
#sr-toast.sr-active {
    display: block;
    animation: sr-fade-in 0.3s ease;
}

@keyframes sr-fade-in {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== Screenshot hide ===== */
.sr-screenshot-hide { display: none !important; }

/* ===== Responsive ===== */
@media (max-width: 480px) {
    #sr-tab-handle { font-size: 15px; padding: 14px 14px; }
    #sr-popup, .sr-edit-popup { width: 260px; padding: 14px; }
    .sr-pin { width: 70px; height: 98px; }
    .sr-pin-svg { width: 70px; height: 98px; }
    .sr-pin-num { top: 22px; font-size: 20px; }
}
