/* Photo Tagger Pro - Public Frontend Styles */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&display=swap');

/* Container */
.pt-tagged-image-wrap {
    position: relative;
    display: block;
    width: 100%;
    line-height: 0;
}

.pt-tagged-image-inner {
    position: relative;
    display: inline-block;
    width: 100%;
}

.pt-base-image {
    display: block;
    width: 100%;
    height: auto;
}

.pt-markers-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* SVG lines */
.pt-line-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    z-index: 5;
}

/* ======================================
   MARKERS
   ====================================== */

.pt-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: all;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform;
}

.pt-marker:focus { outline: none; }

/* Pulse animation on hover */
.pt-marker:hover {
    transform: translate(-50%, -50%) scale(1.15);
    z-index: 20;
}

/* Sizes - responsive via clamp */
.pt-marker--small  .pt-icon-circle { --pt-icon-sz: clamp(22px, 3.5vw, 30px); }
.pt-marker--medium .pt-icon-circle { --pt-icon-sz: clamp(28px, 4.5vw, 40px); }
.pt-marker--large  .pt-icon-circle { --pt-icon-sz: clamp(36px, 6vw, 54px); }

.pt-icon-circle {
    width:  var(--pt-icon-sz, 36px);
    height: var(--pt-icon-sz, 36px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 3px 12px rgba(0,0,0,0.3),
        0 0 0 2px rgba(255,255,255,0.25);
    border: 2px solid rgba(255,255,255,0.35);
    transition: box-shadow 0.2s;
    position: relative;
}

/* Subtle pulse ring */
.pt-icon-circle::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0;
    animation: pt-pulse 2.4s ease-in-out infinite;
}

@keyframes pt-pulse {
    0%   { transform: scale(0.9); opacity: 0.6; }
    70%  { transform: scale(1.4); opacity: 0; }
    100% { transform: scale(1.4); opacity: 0; }
}

.pt-icon-circle svg {
    width: 55%;
    height: 55%;
}

/* Number badge */
.pt-number-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: clamp(24px, 4vw, 38px);
    height: clamp(24px, 4vw, 38px);
    border-radius: 50%;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(11px, 1.8vw, 16px);
    color: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3), 0 0 0 2px rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
}

/* Text label */
.pt-text-label {
    display: inline-flex;
    align-items: center;
    padding: clamp(4px, 1vw, 7px) clamp(8px, 1.5vw, 14px);
    border-radius: 20px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(11px, 1.6vw, 15px);
    white-space: nowrap;
    border: 2px solid;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    letter-spacing: 0.01em;
    line-height: 1;
}

/* ======================================
   POPUPS
   ====================================== */

.pt-popup {
    display: none;
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    max-width: min(320px, 80vw);
    background: #fff;
    border-radius: 14px;
    padding: 18px 18px 16px;
    box-shadow:
        0 8px 32px rgba(0,0,0,0.18),
        0 2px 8px rgba(0,0,0,0.1),
        0 0 0 1px rgba(0,0,0,0.06);
    z-index: 100;
    pointer-events: all;
    line-height: 1.5;
    text-align: left;
    animation: pt-popup-in 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

/* Arrow */
.pt-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #fff;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
}

/* Flip if near bottom of image */
.pt-popup.pt-popup--flip {
    bottom: auto;
    top: calc(100% + 14px);
}

.pt-popup.pt-popup--flip::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #fff;
}

@keyframes pt-popup-in {
    from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.95); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0)   scale(1); }
}

.pt-popup.pt-popup--visible {
    display: block;
}

.pt-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 14px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.pt-popup-close:hover { color: #333; background: #f0f0f0; }

.pt-popup-title {
    font-family: 'DM Sans', sans-serif !important;
    font-size: clamp(13px, 2.2vw, 16px) !important;
    font-weight: 600 !important;
    color: #111 !important;
    margin: 0 0 8px !important;
    padding-right: 20px;
    line-height: 1.3 !important;
    border: none !important;
}

.pt-popup-image {
    margin: 0 0 10px;
    border-radius: 8px;
    overflow: hidden;
}

.pt-popup-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.pt-popup-content {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(12px, 1.8vw, 14px);
    color: #444;
    line-height: 1.6;
    margin: 0;
}

.pt-popup-content p { margin: 0 0 8px; }
.pt-popup-content p:last-child { margin-bottom: 0; }
.pt-popup-content a { color: #6c63ff; }

/* ======================================
   DARK MODE SUPPORT
   ====================================== */

@media (prefers-color-scheme: dark) {
    .pt-popup {
        background: #1e1e2e;
        box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08);
    }
    .pt-popup::after { border-top-color: #1e1e2e; }
    .pt-popup.pt-popup--flip::after { border-bottom-color: #1e1e2e; }
    .pt-popup-title { color: #f0f0f0 !important; }
    .pt-popup-content { color: #aaa; }
    .pt-popup-close { color: #666; }
    .pt-popup-close:hover { color: #ddd; background: #333; }
    .pt-text-label { background: rgba(20,20,30,0.9); }
}

/* ======================================
   RESPONSIVE ADJUSTMENTS
   ====================================== */

/* Very small screens - reduce popups */
@media (max-width: 480px) {
    .pt-popup {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: 90vw;
        max-width: 340px;
        top: auto;
    }
    .pt-popup::after { display: none; }
    .pt-popup.pt-popup--flip {
        bottom: 20px;
        top: auto;
    }
    .pt-popup.pt-popup--flip::after { display: none; }
}
