/**
 * Bulgaria Map Styles - Admin & Frontend
 */

/* ============================================
   ADMIN STYLES
   ============================================ */

.bg-map-admin-container {
    max-width: 1200px;
    margin: 20px 0;
}

.bg-map-usage-info {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.bg-map-usage-info h2 {
    margin-top: 0;
}

.bg-map-shortcode-display {
    display: inline-block;
    background: #f0f0f1;
    padding: 8px 12px;
    border-radius: 3px;
    font-size: 14px;
    margin-right: 10px;
}

.bg-map-points-container {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
}

.bg-map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dcdcde;
}

.bg-map-header h2 {
    margin: 0;
}

#bg-map-add-point .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 5px;
}

/* Empty State */
.bg-map-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #787c82;
}

.bg-map-empty-state .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #c3c4c7;
    margin-bottom: 10px;
}

.bg-map-empty-state p {
    font-size: 16px;
}

/* Point Item */
.bg-map-point-item {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.bg-map-point-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.bg-map-point-placeholder {
    background: #e8f5e9;
    border: 2px dashed #4caf50;
    border-radius: 4px;
    margin-bottom: 15px;
}

.bg-map-point-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #fff;
    border-bottom: 1px solid #dcdcde;
    cursor: move;
}

.bg-map-point-number {
    font-weight: 600;
    color: #2271b1;
    min-width: 30px;
}

.bg-map-point-name {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
}

.bg-map-point-name:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.bg-map-toggle-point,
.bg-map-delete-point {
    padding: 5px 10px;
    cursor: pointer;
    border: none;
    background: transparent;
    border-radius: 3px;
}

.bg-map-toggle-point:hover {
    background: #f0f0f1;
}

.bg-map-delete-point:hover {
    background: #fef1f1;
    color: #d63638;
}

.bg-map-toggle-point .dashicons,
.bg-map-delete-point .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Point Content */
.bg-map-point-content {
    padding: 20px;
    display: block;
}

.bg-map-point-item.collapsed .bg-map-point-content {
    display: none;
}

.bg-map-point-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.bg-map-point-field {
    margin-bottom: 15px;
}

.bg-map-point-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #1d2327;
}

.bg-map-point-field input[type="text"],
.bg-map-point-field input[type="number"],
.bg-map-point-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
}

.bg-map-point-field input[type="text"]:focus,
.bg-map-point-field input[type="number"]:focus,
.bg-map-point-field textarea:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.bg-map-point-field textarea {
    resize: vertical;
    font-family: inherit;
}

.bg-map-point-field small {
    display: block;
    margin-top: 5px;
    color: #646970;
    font-size: 13px;
}

/* Image Gallery */
.bg-map-images-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.bg-map-image-item {
    position: relative;
    aspect-ratio: 1;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    overflow: hidden;
    background: #f6f7f7;
}

.bg-map-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bg-map-remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.bg-map-image-item:hover .bg-map-remove-image {
    opacity: 1;
}

.bg-map-remove-image .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.bg-map-add-images .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 5px;
}

/* Actions */
.bg-map-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dcdcde;
    display: flex;
    align-items: center;
    gap: 15px;
}

#bg-map-save-all .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 5px;
}

.bg-map-save-status {
    display: none;
    font-size: 14px;
    font-weight: 500;
}

.bg-map-save-status.success {
    color: #00a32a;
}

.bg-map-save-status.error {
    color: #d63638;
}

.bg-map-save-status .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: text-bottom;
}

.bg-map-save-status .spin {
    animation: spin 1s linear infinite;
}

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

/* ============================================
   FRONTEND STYLES
   ============================================ */

.bg-map-container {
    width: 100%;
    position: relative;
    margin: 20px 0;
}

.bg-map-search-container {
    margin-bottom: 15px;
}

#bgMapSearchInput {
    width: 100%;
    max-width: 400px;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s ease;
}

#bgMapSearchInput:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.2);
}

#bgMap {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Info Window Styles */
.bg-map-info-window {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    padding: 0;
    max-width: 400px;
}

.bg-map-info-gallery {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}

.bg-map-info-gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border-radius: 8px 8px 0 0;
}

.bg-map-gallery-slider {
    position: relative;
    height: 200px;
}

.bg-map-gallery-slider img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bg-map-gallery-slider img.active {
    opacity: 1;
    z-index: 1;
}

.bg-map-gallery-nav {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 15px;
    border-radius: 20px;
    color: white;
    z-index: 2;
}

.bg-map-gallery-prev,
.bg-map-gallery-next {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

.bg-map-gallery-prev:hover,
.bg-map-gallery-next:hover {
    opacity: 0.7;
}

.bg-map-gallery-counter {
    font-size: 13px;
    font-weight: 500;
}

.bg-map-info-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

.bg-map-info-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.bg-map-info-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.bg-map-info-text {
    flex: 1;
    color: #3c4043;
}

.bg-map-info-text strong {
    color: #1d2327;
    display: block;
    margin-bottom: 3px;
}

.bg-map-info-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.bg-map-directions-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #2271b1;
    color: white !important;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.3s ease;
}

.bg-map-directions-btn:hover {
    background: #135e96;
}

/* Google Maps Info Window Overrides */
.gm-style .gm-style-iw-c {
    padding: 15px !important;
    border-radius: 8px !important;
    max-width: 400px !important;
}

.gm-style .gm-style-iw-d {
    overflow: auto !important;
    max-height: 500px !important;
}

.gm-style .gm-style-iw-t::after {
    background: white !important;
}

/* Responsive */
@media (max-width: 768px) {
    .bg-map-point-row {
        grid-template-columns: 1fr;
    }
    
    #bgMapSearchInput {
        max-width: 100%;
    }
    
    .bg-map-info-window {
        max-width: 280px;
    }
    
    .gm-style .gm-style-iw-c {
        max-width: 280px !important;
    }
}

@media (max-width: 600px) {
    .bg-map-images-container {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}