/* ==========================================================================
   Modal — Pin Ekleme
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}

.modal-overlay--open {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
    transform: translateY(16px) scale(0.98);
    transition: transform 0.25s ease;
}

.modal-overlay--open .modal {
    transform: translateY(0) scale(1);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 0;
}

.modal__title {
    font-size: 18px;
    font-weight: 600;
}

.modal__close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background var(--transition);
}

.modal__close:hover {
    background: rgba(0, 0, 0, 0.06);
}

.modal__body {
    padding: 16px 20px 20px;
}

.modal__coords {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 16px;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--color-text-muted);
}

.modal__coords-icon {
    font-size: 16px;
}

/* Form */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
}

.form-group label .required {
    color: #ef4444;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-surface-solid);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-control--attention {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.form-control--attention:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.form-control--locked {
    background: #f1f5f9;
    color: #334155;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.form-control--locked:focus {
    border-color: #e2e8f0;
    box-shadow: none;
}

textarea.form-control {
    min-height: 90px;
    resize: vertical;
}

.form-hint {
    margin-top: 4px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

.form-optional {
    font-size: 12px;
    font-weight: 400;
    color: var(--color-text-muted);
}

/* Güvenli / Güvensiz seçimi */
.pin-type-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pin-type-toggle__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-solid);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.pin-type-toggle__icon {
    font-size: 24px;
    line-height: 1;
}

.pin-type-toggle__icon-img {
    width: 22px;
    height: 33px;
    object-fit: contain;
    display: block;
}

.pin-type-toggle__text {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

.pin-type-toggle__btn--safe.is-active {
    border-color: #006F69;
    background: #ecfdf8;
    box-shadow: 0 0 0 3px rgba(0, 111, 105, 0.15);
}

.pin-type-toggle__btn--unsafe.is-active {
    border-color: #C62828;
    background: #fef2f2;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.15);
}

.temp-pin-marker {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
    text-align: center;
}

/* Honeypot — görünmez */
.form-honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

.modal__footer {
    display: flex;
    gap: 10px;
    padding: 0 20px 20px;
}

.modal__footer .btn {
    flex: 1;
}

.btn--ghost {
    background: transparent;
    box-shadow: none;
    border: 1px solid var(--color-border);
}

.btn--ghost:hover {
    background: var(--color-bg);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Geçici pin marker */
.temp-pin-marker {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    animation: pinBounce 0.4s ease;
}

@keyframes pinBounce {
    0%   { transform: scale(0) translateY(-20px); }
    60%  { transform: scale(1.15) translateY(0); }
    100% { transform: scale(1) translateY(0); }
}

/* Kaydedilmiş pin marker */
.pin-marker-wrap {
    background: transparent !important;
    border: none !important;
}

.pin-marker-img {
    display: block;
    width: 36px;
    height: 54px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.28));
    pointer-events: none;
}

.pin-marker {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: var(--color-surface-solid);
    border: 2px solid var(--pin-color, #3388ff);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: var(--shadow-md);
}

.pin-marker span {
    transform: rotate(45deg);
    display: block;
    line-height: 1;
}

.pin-marker--pending {
    opacity: 0.75;
    border-style: dashed;
}

@media (max-width: 480px) {
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal {
        max-width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 85vh;
    }
}
