/**
 * List-Map Layout
 * @package Bayiler_Plugin
 * @version 2.1.0
 */

/* ─── Desktop: Grid Layout ─── */

.bayi-layout-list-map {
    display: grid;
    grid-template-columns: 400px 1fr;
    grid-template-rows: auto 1fr;
    gap: 0;
    border: 1px solid #222;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

/* Grid Areas - Desktop */
.bayi-list-filters {
    grid-column: 1;
    grid-row: 1;
}

.bayi-map-area {
    grid-column: 2;
    grid-row: 1 / 3; /* İki satır kapla */
}

.bayi-list-items {
    grid-column: 1;
    grid-row: 2;
}

/* ─── Liste Filtreleri ─── */

.bayi-list-filters {
	background: #fff;
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #ddd;
    padding: 15px;	
}

.bayi-list-filter-group {
    margin-bottom: 10px;
}

.bayi-list-filter-group:last-child {
    margin-bottom: 0;
}

/* ─── Form Elements ─── */

.bayi-il-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.bayi-il-select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.bayi-il-select:hover {
    border-color: #999;
}

.bayi-search-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bayi-search-wrapper input[type="search"],
.bayi-search-wrapper input[type="text"] {
    flex: 1;
    padding: 7px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.bayi-search-wrapper input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

/* ─── Action Buttons ─── */

.bayi-search-actions {
    display: flex;
    gap: 6px;
}

.bayi-action-btn {
    width: 42px;
    height: 42px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    padding: 0;
}

.bayi-action-btn i {
    font-size: 16px;
    color: #666;
    transition: color 0.3s;
}

.bayi-action-btn:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.bayi-action-btn:hover i {
    color: #2271b1;
}

.bayi-clear-filters:hover {
    border-color: #dc3545;
    background: #fff5f5;
}

.bayi-clear-filters:hover i {
    color: #dc3545;
}

.bayi-location-btn:hover {
    border-color: #28a745;
    background: #f0fff4;
}

.bayi-location-btn:hover i {
    color: #28a745;
}

.bayi-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bayi-action-btn:disabled:hover {
    border-color: #ddd;
    background: #fff;
}

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

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

/* ─── Liste Container ─── */

.bayi-list-items {
    background: #f9f9f9;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    padding: 15px;
	padding-top: 0;
	position: relative;
}

.bayi-list-items::-webkit-scrollbar {
    width: 8px;
}

.bayi-list-items::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.bayi-list-items::-webkit-scrollbar-thumb {
    background: #009da9;
    border-radius: 4px;
}

.bayi-list-items::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ─── Liste Başlığı ─── */

.bayi-list-items-title {
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    background: #fff;
    box-shadow: 1px 1px 2px 0px rgba(0, 0, 0, .2);
    text-align: center;
	position: sticky;
	z-index:1;
	top:0;
	margin-bottom: 8px;
}

.bayi-list-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 14px;
}

.bayi-list-loading:before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(34, 113, 177, 0.3);
    border-radius: 50%;
    border-top-color: #2271b1;
    animation: bayi-spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

.bayi-list-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.bayi-list-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* ─── Bayi Kartı ─── */

.bayi-list-item {
    background: #fff;
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.bayi-list-item:hover {
    border-color: #009DA9;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.15);
    transform: translateY(-2px);
}

.bayi-list-item.active {
    border-color: #009DA9;
    background: #f0f6fc;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.2);
}

.bayi-list-item.hidden {
    display: none;
}

.bayi-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 10px;
}

.bayi-list-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    flex: 1;
}

.bayi-list-distance {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    background: #e8f4f8;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.bayi-list-distance i {
    color: #2271b1;
    margin-right: 3px;
}

.bayi-list-location {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
}

.bayi-list-location i {
    margin-right: 6px;
    color: #999;
    font-size: 12px;
}

.bayi-list-types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.bayi-list-types .type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
}

.bayi-list-phones {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 sütun */
    gap: 8px;
    margin-bottom: 10px;
}

.bayi-list-phone {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
}

.bayi-list-phone i {
    margin-right: 6px;
    color: #2271b1;
    font-size: 12px;
}

.bayi-list-phones:has(.bayi-list-phone:only-child) {
    grid-template-columns: 1fr;
}

/* ─── Aksiyon Butonları ─── */

.bayi-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.bayi-list-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.bayi-list-btn i {
    font-size: 12px;
}

.bayi-show-on-map,
.bayi-detail {
    flex: 1;
    min-width: calc(50% - 4px);
}

.bayi-show-on-map {
    background: #2271b1;
    color: #fff;
}

.bayi-show-on-map:hover {
    background: #135e96;
    color: #fff;
}

.bayi-detail {
    background: #333;
    color: #fff;
}

.bayi-detail:hover {
    background: #222;
    color: #fff;
}

.bayi-directions,
.bayi-call {
    flex: 1;
    min-width: calc(50% - 4px);
}

.bayi-directions {
    background: #28a745;
    color: #fff;
}

.bayi-directions:hover {
    background: #218838;
    color: #fff;
}

.bayi-call {
    background: #dc3545;
    color: #fff;
}

.bayi-call:hover {
    background: #c82333;
    color: #fff;
}

/* ─── Harita Alanı ─── */

.bayi-map-area {
    position: relative;
    height: 100%;
    width: 100%;
}

.bayi-map-area .bayi-harita {
    height: 100%;
    width: 100%;
    border-radius: 0;
}

/* ─── No Results ─── */

.bayi-no-results {
    text-align: center;
    padding: 30px 20px;
    color: #999;
    font-size: 14px;
}

.bayi-no-results i {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
    opacity: 0.5;
}

/* ─── Notifications ─── */

.bayi-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 400px;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.bayi-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.bayi-toast i {
    font-size: 18px;
    flex-shrink: 0;
}

.bayi-toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

.bayi-toast.toast-warning {
    border-left: 4px solid #ffc107;
}

.bayi-toast.toast-warning i {
    color: #ffc107;
}

.bayi-toast.toast-info {
    border-left: 4px solid #009DA9;
}

.bayi-toast.toast-info i {
    color: #009DA9;
}

.bayi-toast.toast-success {
    border-left: 4px solid #28a745;
}

.bayi-toast.toast-success i {
    color: #28a745;
}

.bayi-info-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    margin: 0 15px 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    animation: slideInDown 0.3s ease;
}

.bayi-info-card i {
    font-size: 18px;
    flex-shrink: 0;
}

.bayi-info-message {
    flex: 1;
}

.bayi-info-card-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-left: auto;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.bayi-info-card-close:hover {
    opacity: 1;
}

.bayi-info-card-close i {
    font-size: 14px;
}

.bayi-info-card.info-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.bayi-info-card.info-warning i {
    color: #ffc107;
}

.bayi-info-card.info-info {
    background: #e7f3ff;
    border: 1px solid #009DA9;
    color: #004085;
}

.bayi-info-card.info-info i {
    color: #009DA9;
}

.bayi-info-card.info-success {
    background: #d4edda;
    border: 1px solid #28a745;
    color: #155724;
}

.bayi-info-card.info-success i {
    color: #28a745;
}

.bayi-list-filters .bayi-info-card {
    margin: 10px 0 0 0;
    border-radius: 6px;
}

.bayi-map-overlay {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeInScale 0.3s ease;
}

.bayi-map-overlay i {
    font-size: 18px;
    flex-shrink: 0;
}

.bayi-map-overlay-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

.bayi-map-overlay.overlay-warning {
    border-left: 4px solid #ffc107;
}

.bayi-map-overlay.overlay-warning i {
    color: #ffc107;
}

.bayi-map-overlay.overlay-info {
    border-left: 4px solid #009DA9;
}

.bayi-map-overlay.overlay-info i {
    color: #009DA9;
}

.bayi-map-overlay.overlay-success {
    border-left: 4px solid #28a745;
}

.bayi-map-overlay.overlay-success i {
    color: #28a745;
}

/* ─── Animations ─── */

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translateX(-50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

/* ─── Responsive: Tablet ─── */

@media (max-width: 991px) {
    .bayi-layout-list-map {
        grid-template-columns: 350px 1fr;
    }
    
    .bayi-list-item {
        padding: 12px;
    }
    
    .bayi-list-title {
        font-size: 15px;
    }
}

/* ─── Responsive: Mobile ─── */

@media (max-width: 768px) {
    /* Mobil: Dikey sıralama */
    .bayi-layout-list-map {
        display: flex;
        flex-direction: column;
        border-width: 0;
        height: auto !important;
        max-height: none;
		padding: 0 15px 0 10px;
    }
    
    /* Mobil sıralama: Filters → Map → Items */
    .bayi-list-filters {
        order: 1;
        border-radius: 8px 8px 0 0;
        border-style: solid;
        border-color: #ddd;
        border-width: 1px 1px 0;
		padding-bottom: 10px;
    }
	
	.bayi-info-card {
        order: 2;
    }    
	
	.bayi-list-items {
        order: 3;
        border-radius: 8px 8px 0 0;
        border-style: solid;
        border-color: #ddd;
        border-width: 0px 1px 1px;
        border-radius: 0px 8px 8px 8px;
        max-height: 550px;
        min-height: 280px;
    }
	
    .bayi-map-area {
        order: 4;
        margin: 10px 0;
        border-radius: 8px;
        overflow: hidden;
        border: 1px solid #ddd;
    }
    
    .bayi-list-items-title {
        font-size: 15px;
        padding: 12px;
    }
    
    .bayi-action-btn {
        width: 36px;
        height: 36px;
    }
    
    .bayi-action-btn i {
        font-size: 14px;
    }
	
	.bayi-list-btn {
		padding: 8px;
		line-height: 1.2;
	}
    
    .bayi-toast {
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .bayi-list-filters {
        padding: 12px;
    }
    
    .bayi-list-items {
        padding: 12px;
		padding-top: 0px;
    }
    
    .bayi-list-item {
        padding: 12px;		
        margin-bottom: 10px;
    }
    
    .bayi-list-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .bayi-list-distance {
        align-self: flex-start;
    }
	.bayi-list-phones {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 360px) {
    .bayi-search-wrapper {
        flex-direction: column; 
        gap: 10px;
    }
    
    .bayi-search-wrapper input {
        width: 100%; 
    }
    
    .bayi-search-actions {
        width: 100%;
        justify-content: center; 
        gap: 10px;
    }
    
    .bayi-action-btn {
        flex: 1; 
        max-width: 120px; 
        height: 34px;
    }
}