/* =====================================================
   MAIN-LOCATIONS.CSS
   Premium Lokasyonlar Sayfası
   Masaüstü + Mobil Genişletilmiş Liste
===================================================== */

.devices-page {
    padding: 60px 0 100px;
    background: var(--ss-bg);
    min-height: calc(100vh - 70px);
}

.devices-container {
    max-width: 1320px;
}

/* =====================================================
   HEADER
===================================================== */

.devices-header {
    text-align: center;
    margin-bottom: 40px;
}

.devices-title {
    font-size: clamp(42px, 5vw, 64px);
    font-weight: 700;
    letter-spacing: -3px;
    color: var(--ss-black);
    margin-bottom: 16px;
    line-height: 1.1;
}

.devices-subtitle {
    font-size: 18px;
    color: var(--ss-gray);
    max-width: 600px;
    margin: 0 auto;
}

/* =====================================================
   SEARCH & LOCATION CONTROLS
===================================================== */

.devices-controls {
    display: flex;
    gap: 16px;
    max-width: 800px;
    margin: 0 auto 40px;
}

.search-box {
    flex: 1;
    min-width: 0;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 20px;
    color: var(--ss-gray);
    font-size: 18px;
}

.search-box input {
    width: 100%;
    height: 60px;
    padding: 0 20px 0 54px;
    border-radius: 999px;
    border: 1px solid var(--ss-line);
    background: #fff;
    font-size: 16px;
    color: var(--ss-black);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.search-box input:focus {
    border-color: var(--ss-black);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.btn-use-location {
    height: 60px;
    padding: 0 28px;
    border-radius: 999px;
    background: var(--ss-black);
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
}

.btn-use-location:hover {
    opacity: 0.9;
}

.btn-use-location:active {
    transform: scale(0.97);
}

/* =====================================================
   MOBILE TABS
===================================================== */

.devices-mobile-tabs {
    display: none;
    background: #fff;
    padding: 6px;
    border-radius: 999px;
    border: 1px solid var(--ss-line);
    margin-bottom: 24px;
}

.mobile-tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    border-radius: 999px;
    padding: 12px;
    font-weight: 700;
    font-size: 15px;
    color: var(--ss-gray);
    transition: all 0.2s ease;
    cursor: pointer;
}

.mobile-tab-btn.active {
    background: var(--ss-black);
    color: #fff;
}

/* =====================================================
   MAIN GRID & PANELS
===================================================== */

.devices-main-grid {
    display: grid;
    grid-template-columns: 420px minmax(0, 1fr);
    gap: 24px;

    /* Masaüstünde liste ve harita yüksekliği */
    height: 1000px;
    min-height: 1000px;

    align-items: stretch;
}

/* =====================================================
   LEFT: LOCATION LIST PANEL
===================================================== */

.devices-list-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    min-width: 0;

    background: #fff;
    border: 1px solid var(--ss-line);
    border-radius: 34px;
    overflow: hidden;
}

/* List summary */

.list-summary {
    flex-shrink: 0;
    padding: 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ss-gray);
    border-bottom: 1px solid var(--ss-line-soft);
    background: #fafafa;
}

.list-summary span {
    color: var(--ss-black);
}

/* Scrollable location list */

.devices-scroll-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;

    scrollbar-width: thin;
    scrollbar-color: #d1d1d1 transparent;

    overscroll-behavior-y: contain;
}

.devices-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.devices-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.devices-scroll-area::-webkit-scrollbar-thumb {
    background-color: #d1d1d1;
    border-radius: 10px;
}

.devices-scroll-area::-webkit-scrollbar-thumb:hover {
    background-color: #a8a8a8;
}

/* =====================================================
   LOCATION CARD
===================================================== */

.modern-device-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    border-radius: 24px;
    border: 1px solid var(--ss-line-soft);
    background: #fff;
    margin-bottom: 16px;

    cursor: pointer;

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease,
        transform 0.25s ease;
}

.modern-device-card:last-child {
    margin-bottom: 0;
}

.modern-device-card:hover,
.modern-device-card.active {
    border-color: var(--ss-black);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.modern-device-card.active {
    background: #fafafa;
}

/* Card icon */

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: var(--ss-bg);
    color: var(--ss-black);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 20px;
    flex-shrink: 0;
}

/* Card details */

.card-details {
    flex: 1;
    min-width: 0;
}

.d-name {
    font-weight: 700;
    font-size: 17px;
    margin-bottom: 4px;
    color: var(--ss-black);
    overflow-wrap: anywhere;
}

.d-city {
    font-size: 13px;
    font-weight: 600;
    color: var(--ss-gray);
    margin-bottom: 8px;
}

.d-address {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
    margin-bottom: 12px;
    overflow-wrap: anywhere;
}

/* Card actions */

.card-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    font-weight: 700;
}

.d-direction-link {
    color: #111;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.d-direction-link:hover {
    text-decoration: underline;
}

.d-show-map-link {
    color: var(--ss-gray);
    cursor: pointer;
}

.d-show-map-link:hover {
    color: var(--ss-black);
}

/* =====================================================
   RIGHT: MAP PANEL
===================================================== */

.devices-map-panel {
    height: 100%;
    min-height: 0;
    min-width: 0;

    border-radius: 34px;
    overflow: hidden;
    border: 1px solid var(--ss-line);
    background: var(--ss-bg-soft);
}

.modern-map-box {
    width: 100%;
    height: 100%;
    min-height: 0;
}

/* =====================================================
   TABLET
===================================================== */

@media (min-width: 768px) and (max-width: 1199px) {
    .devices-container {
        max-width: 100%;
    }

    .devices-main-grid {
        grid-template-columns: 360px minmax(0, 1fr);
        height: 900px;
        min-height: 900px;
        gap: 18px;
    }

    .devices-list-panel {
        border-radius: 28px;
    }

    .devices-map-panel {
        border-radius: 28px;
    }

    .devices-scroll-area {
        padding: 16px;
    }

    .modern-device-card {
        padding: 16px;
        gap: 12px;
    }
}

/* =====================================================
   MOBILE & SMALL TABLET
===================================================== */

@media (max-width: 991px) {
    .devices-page {
        padding: 40px 0 60px;
    }

    .devices-header {
        margin-bottom: 30px;
    }

    .devices-title {
        font-size: clamp(32px, 7vw, 46px);
        letter-spacing: -1.5px;
    }

    .devices-subtitle {
        font-size: 16px;
        padding: 0 10px;
    }

    .devices-controls {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 24px;
    }

    .search-box input {
        height: 56px;
        font-size: 15px;
    }

    .btn-use-location {
        width: 100%;
        height: 56px;
        justify-content: center;
    }

    .devices-mobile-tabs {
        display: flex;
    }

    /* Mobilde tek sütun */
    .devices-main-grid {
        grid-template-columns: minmax(0, 1fr);
        height: auto;
        min-height: 0;
        gap: 16px;
    }

    /* Mobilde de yüksek lokasyon paneli */
    .devices-list-panel {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 1000px;
        min-height: 1000px;
        min-width: 0;
        border-radius: 26px;
        overflow: hidden;
    }

    .list-summary {
        padding: 18px 20px;
    }

    /* Panelin içindeki liste kaydırılabilir */
    .devices-scroll-area {
        flex: 1;
        height: auto;
        min-height: 0;
        max-height: none;
        padding: 16px;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .modern-device-card {
        padding: 16px;
        gap: 12px;
        border-radius: 20px;
    }

    .card-icon {
        width: 42px;
        height: 42px;
        border-radius: 14px;
        font-size: 18px;
    }

    .d-name {
        font-size: 16px;
    }

    .d-address {
        font-size: 13px;
    }

    /* Harita mobilde sekme ile gösterilir */
    .devices-map-panel {
        display: none;
        height: 60vh;
        min-height: 350px;
        border-radius: 26px;
    }

    .modern-map-box {
        height: 100%;
    }
}

/* =====================================================
   SMALL MOBILE
===================================================== */

@media (max-width: 480px) {
    .devices-page {
        padding: 30px 0 45px;
    }

    .devices-title {
        font-size: 32px;
        line-height: 1.15;
    }

    .devices-subtitle {
        font-size: 14px;
    }

    .devices-controls {
        gap: 10px;
    }

    .search-box input {
        padding-left: 46px;
        font-size: 14px;
    }

    .search-icon {
        left: 17px;
        font-size: 16px;
    }

    /* Küçük mobilde de 1000px panel yüksekliği */
    .devices-list-panel {
        height: 1000px;
        min-height: 1000px;
    }

    .devices-scroll-area {
        max-height: none;
        padding: 12px;
    }

    .modern-device-card {
        padding: 14px;
        gap: 10px;
        border-radius: 18px;
        margin-bottom: 12px;
    }

    .card-icon {
        width: 38px;
        height: 38px;
        font-size: 16px;
        border-radius: 12px;
    }

    .d-name {
        font-size: 15px;
    }

    .d-city {
        font-size: 12px;
    }

    .d-address {
        font-size: 12px;
        line-height: 1.5;
    }

    .card-actions {
        gap: 12px;
        font-size: 12px;
    }
}