/**
 * nearby-firms.css
 * Yakınımdaki Firmalar widget stilleri
 */

/* ── Widget Ana Kapsayıcı ─────────────────────────────── */
.nearby-widget {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e8e4f7;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(93, 62, 188, 0.08);
    transition: box-shadow 0.3s ease;
}

.nearby-widget:hover {
    box-shadow: 0 6px 28px rgba(93, 62, 188, 0.14);
}

/* ── Widget Başlık ─────────────────────────────────────── */
.nearby-widget-header {
    background: linear-gradient(135deg, #5D3EBC 0%, #7B5DD6 100%);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.nearby-widget-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}

.nearby-widget-header h3 .nearby-pulse-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    position: relative;
    flex-shrink: 0;
}

.nearby-widget-header h3 .nearby-pulse-icon::after {
    content: '';
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    animation: nearbyPulse 2s ease-out infinite;
}

@keyframes nearbyPulse {
    0%   { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.2); opacity: 0; }
}

.nearby-toggle-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
    opacity: 0.8;
}

.nearby-widget.open .nearby-toggle-arrow {
    transform: rotate(180deg);
}

/* ── Widget Gövde ──────────────────────────────────────── */
.nearby-widget-body {
    display: none;
    padding: 16px;
}

.nearby-widget.open .nearby-widget-body {
    display: block;
}

/* ── Konum Butonları ───────────────────────────────────── */
.nearby-location-btns {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.btn-locate-me {
    flex: 1;
    min-width: 140px;
    background: linear-gradient(135deg, #5D3EBC, #7B5DD6);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all 0.25s ease;
    box-shadow: 0 3px 12px rgba(93, 62, 188, 0.3);
}

.btn-locate-me:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(93, 62, 188, 0.4);
}

.btn-locate-me:active {
    transform: translateY(0);
}

.btn-locate-me.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn-locate-me .locate-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.btn-locate-me.loading .locate-spinner {
    display: block;
}

.btn-locate-me.loading .locate-icon {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-manual-address {
    flex: 1;
    min-width: 120px;
    background: #f5f3ff;
    color: #5D3EBC;
    border: 1.5px solid #d4caff;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all 0.25s ease;
}

.btn-manual-address:hover {
    background: #ede8ff;
    border-color: #b09ff4;
}

/* ── Yarıçap Seçici ────────────────────────────────────── */
.nearby-radius-selector {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.nearby-radius-selector label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6c757d;
    width: 100%;
    margin-bottom: 4px;
}

.radius-btn {
    flex: 1;
    min-width: 52px;
    padding: 6px 4px;
    border-radius: 8px;
    border: 1.5px solid #e0d8ff;
    background: #f8f6ff;
    color: #5D3EBC;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.radius-btn.active,
.radius-btn:hover {
    background: #5D3EBC;
    color: #fff;
    border-color: #5D3EBC;
}

/* ── Manuel Adres Formu ────────────────────────────────── */
.nearby-manual-form {
    display: none;
    margin-bottom: 12px;
    animation: slideDown 0.3s ease;
}

/* Her zaman dikey (input üstte, buton altta) — sidebar'da her genişlikte çalışır */
.nearby-manual-form.visible {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nearby-manual-form input {
    width: 100%;
    border: 1.5px solid #d4caff;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 0.85rem;
    outline: none;
    color: #333;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.nearby-manual-form input:focus {
    border-color: #5D3EBC;
    box-shadow: 0 0 0 3px rgba(93, 62, 188, 0.12);
}

.nearby-manual-form button {
    width: 100%;
    background: #5D3EBC;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.nearby-manual-form button:hover {
    background: #4a30a0;
}

/* ── Konum Durum Mesajı ────────────────────────────────── */
.nearby-status {
    font-size: 0.8rem;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: none;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: break-word;
}

.nearby-status.visible {
    display: block;
}

/* İkon her zaman metnin başına inline oturur */
.nearby-status i:first-child {
    margin-right: 5px;
    flex-shrink: 0;
}

.nearby-status.info    { background: #eff6ff; color: #1d4ed8; }
.nearby-status.success { background: #f0fdf4; color: #15803d; }
.nearby-status.warning { background: #fffbeb; color: #92400e; }
.nearby-status.error   { background: #fef2f2; color: #dc2626; }

/* ── Sonuç Listesi ─────────────────────────────────────── */
.nearby-results {
    display: none;
}

.nearby-results.visible {
    display: block;
}

.nearby-results-header {
    font-size: 0.78rem;
    color: #6c757d;
    margin-bottom: 10px;
    font-weight: 500;
}

.nearby-results-header span {
    font-weight: 700;
    color: #5D3EBC;
}

/* ── Tek Firma Kartı ───────────────────────────────────── */
.nearby-firm-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #f0ecff;
    background: #faf9ff;
    margin-bottom: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    position: relative;
}

.nearby-firm-card:hover {
    border-color: #c4b5fd;
    background: #f5f3ff;
    transform: translateX(3px);
    text-decoration: none;
    color: inherit;
}

.nearby-firm-logo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: contain;
    border: 1px solid #e8e4f7;
    background: #fff;
    flex-shrink: 0;
}

.nearby-firm-info {
    flex: 1;
    min-width: 0;
}

.nearby-firm-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e1b4b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.nearby-firm-cat {
    font-size: 0.75rem;
    color: #7c6db0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nearby-firm-distance {
    flex-shrink: 0;
    background: linear-gradient(135deg, #5D3EBC, #7B5DD6);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ── Boş Durum ─────────────────────────────────────────── */
.nearby-empty {
    text-align: center;
    padding: 20px 10px;
    color: #6c757d;
    font-size: 0.85rem;
    display: none;
}

.nearby-empty.visible {
    display: block;
}

.nearby-empty i {
    font-size: 2rem;
    color: #c4b5fd;
    margin-bottom: 8px;
    display: block;
}

/* ── Skeleton Loading ──────────────────────────────────── */
.nearby-skeleton {
    display: none;
}

.nearby-skeleton.visible {
    display: block;
}

.skeleton-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #f0ecff;
    background: #faf9ff;
    margin-bottom: 8px;
}

.skeleton-logo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(90deg, #e8e4f7 25%, #f3f0ff 50%, #e8e4f7 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    flex-shrink: 0;
}

.skeleton-lines {
    flex: 1;
}

.skeleton-line {
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg, #e8e4f7 25%, #f3f0ff 50%, #e8e4f7 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    margin-bottom: 7px;
}

.skeleton-line:last-child { width: 60%; }

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Responsive Uyumlar ────────────────────────────────── */

/* Genel liste sayfasında (firmalar.php) inline banner stili */
.nearby-widget-inline {
    margin-bottom: 24px;
}

.nearby-widget-inline .nearby-widget {
    border-radius: 16px;
}

/* Mobil tam genişlik */
@media (max-width: 767px) {
    .nearby-widget-header {
        padding: 14px 16px;
    }

    .nearby-widget-body {
        padding: 14px;
    }

    .nearby-location-btns {
        flex-direction: column;
    }

    .btn-locate-me,
    .btn-manual-address {
        min-width: unset;
        width: 100%;
    }

    .nearby-radius-selector {
        gap: 5px;
    }

    .nearby-firm-card {
        padding: 9px 10px;
    }
}

/* Tablet: sidebar'daki versiyonda daha kompakt */
@media (min-width: 768px) and (max-width: 991px) {
    .nearby-firm-name {
        font-size: 0.83rem;
    }
}
