/*
 * Kullanici konumu UI stili
 */

/* Buton — magnitude-legend paneli icinde */
.my-location-btn {
    width: 100%;
    margin-top: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #4285f4, #1a73e8);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
}

.my-location-btn:hover:not(.is-loading) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.35);
}

.my-location-btn:active {
    transform: translateY(0);
}

.my-location-btn.is-loading {
    opacity: 0.75;
    cursor: wait;
}

.my-location-btn i {
    font-size: 11px;
}

.my-location-btn.is-loading i {
    animation: my-loc-spin 1s linear infinite;
}

@keyframes my-loc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mavi nokta marker */
.user-location-marker {
    position: relative;
    width: 22px;
    height: 22px;
}

.user-location-marker__dot {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 14px;
    height: 14px;
    background: #4285f4;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.28);
    z-index: 2;
}

.user-location-marker__pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 22px;
    height: 22px;
    background: #4285f4;
    border-radius: 50%;
    opacity: 0.45;
    animation: user-loc-pulse 2s ease-out infinite;
    transform-origin: center;
    z-index: 1;
}

@keyframes user-loc-pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.55;
    }
    70% {
        transform: scale(2.2);
        opacity: 0;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

/* Popup */
.user-location-popup {
    padding: 4px;
    min-width: 180px;
    font-family: inherit;
}

.user-location-popup strong {
    color: #1a73e8;
    display: block;
    margin-bottom: 4px;
    font-size: 0.98rem;
}

.user-location-popup .accuracy {
    font-size: 0.8rem;
    color: #666;
    margin-top: 4px;
}

/* Toast */
.geo-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translate(-50%, -20px);
    background: #1f2937;
    color: #fff;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    max-width: min(420px, 90vw);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    line-height: 1.4;
}

.geo-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.geo-toast--error {
    background: #b91c1c;
}

.geo-toast--info {
    background: #1a73e8;
}

@media (max-width: 640px) {
    .geo-toast {
        top: auto;
        bottom: 24px;
        left: 12px;
        right: 12px;
        transform: translateY(20px);
        max-width: none;
    }
    .geo-toast.is-visible {
        transform: translateY(0);
    }
}

/* Night mode (varsa) */
@media (prefers-color-scheme: dark) {
    .user-location-popup strong { color: #8ab4f8; }
    .user-location-popup .accuracy { color: #bbb; }
}
