/**
 * Marker Placement Styles
 * Styling for the marker selection and placement UI
 */

/* Marker Step Container */
.lm-stl-marker-step {
    display: none; /* Hidden until preview is ready */
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
    border: 2px solid #e91e63;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.1);
}

.lm-stl-marker-step h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0d0dc;
    color: #c2185b;
}

.lm-stl-marker-step h4 .step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #e91e63;
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}

.lm-stl-marker-step h4 .optional-badge {
    font-size: 11px;
    font-weight: normal;
    background: #f8bbd9;
    color: #880e4f;
    padding: 3px 8px;
    border-radius: 10px;
    margin-left: auto;
}

/* Marker Step Toggle */
#lm-marker-step-toggle {
    cursor: pointer;
    user-select: none;
}

#lm-marker-step-toggle .dashicons {
    transition: transform 0.3s ease;
}

/* Marker Type Grid */
.marker-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

/* Marker Type Option */
.marker-type-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.marker-type-option:hover {
    border-color: #e91e63;
    box-shadow: 0 2px 8px rgba(233, 30, 99, 0.15);
}

.marker-type-option.selected {
    border-color: #e91e63;
    background: #fce4ec;
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.2);
}

.marker-type-preview {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.marker-type-preview .marker-icon {
    font-size: 24px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.marker-none-preview {
    background: #f5f5f5 !important;
    border: 2px dashed #ccc;
    box-shadow: none;
}

.marker-none-preview .dashicons {
    color: #999;
    font-size: 24px;
}

.marker-type-info {
    text-align: center;
}

.marker-type-name {
    display: block;
    font-weight: 600;
    color: #333;
    font-size: 13px;
    margin-bottom: 4px;
}

.marker-type-price {
    display: block;
    font-size: 12px;
    color: #666;
}

.marker-type-option.selected .marker-type-price {
    color: #c2185b;
    font-weight: 600;
}

/* Marker Placement Container */
#lm-marker-placement-container {
    margin-top: 20px;
}

.marker-placement-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.marker-placement-bg {
    display: block;
    max-width: 100%;
    height: auto;
}

.marker-placement-canvas {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: default;
    z-index: 10;
}

.marker-placement-canvas.placement-active {
    cursor: crosshair;
}

.marker-placement-canvas.placement-active:hover {
    background: rgba(233, 30, 99, 0.05);
}

/* Placed Markers Overlay */
.placed-markers-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 20;
}

.placed-marker {
    position: absolute;
    width: 32px;
    height: 32px;
    margin-left: -16px;
    margin-top: -32px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    cursor: pointer;
    animation: markerDrop 0.3s ease;
}

@keyframes markerDrop {
    from {
        opacity: 0;
        transform: rotate(-45deg) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: rotate(-45deg) translateY(0);
    }
}

.placed-marker::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    margin-left: -4px;
    width: 8px;
    height: 8px;
    background: inherit;
    border-radius: 50%;
    opacity: 0.5;
}

.placed-marker-icon {
    transform: rotate(45deg);
    font-size: 14px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.placed-marker-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #d32f2f;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placed-marker:hover .placed-marker-remove {
    opacity: 1;
}

/* Placement Hint */
#lm-marker-placement-hint {
    display: none;
    padding: 12px 15px;
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    border-radius: 4px;
    margin-bottom: 15px;
    color: #e65100;
    font-weight: 500;
}

#lm-marker-placement-hint .dashicons {
    margin-right: 5px;
    vertical-align: middle;
}

/* Placement Feedback */
.marker-placement-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(76, 175, 80, 0.95);
    color: #fff;
    padding: 12px 24px;
    border-radius: 24px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
    animation: feedbackPop 0.3s ease;
}

@keyframes feedbackPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Placed Markers List */
#lm-placed-markers-list {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0d0dc;
}

.placed-markers-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.placed-marker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
}

.marker-color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.marker-name {
    flex: 1;
    font-weight: 500;
}

.marker-price {
    color: #c2185b;
    font-weight: 600;
    font-size: 13px;
}

.marker-remove-btn {
    width: 24px;
    height: 24px;
    background: #ffebee;
    color: #d32f2f;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s;
}

.marker-remove-btn:hover {
    background: #d32f2f;
    color: #fff;
}

.no-markers-placed {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 15px;
}

/* Marker Price Summary */
.marker-price-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #fce4ec;
    border-radius: 8px;
    margin-top: 15px;
}

.marker-price-label {
    font-weight: 600;
    color: #880e4f;
}

#lm-marker-price {
    font-size: 18px;
    font-weight: bold;
    color: #c2185b;
}

/* No markers hint */
.no-markers-hint {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    .marker-type-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .marker-type-option {
        padding: 10px 8px;
    }

    .marker-type-preview {
        width: 40px;
        height: 40px;
    }

    .marker-type-preview .marker-icon {
        font-size: 18px;
    }

    .marker-type-name {
        font-size: 12px;
    }

    .placed-marker {
        width: 28px;
        height: 28px;
        margin-left: -14px;
        margin-top: -28px;
    }

    .placed-marker-icon {
        font-size: 12px;
    }
}

/* Marker in Action Section Price Update */
.lm-stl-action-section .marker-addon-price {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-top: 1px dashed #e0e0e0;
    margin-top: 10px;
    font-size: 14px;
}

.lm-stl-action-section .marker-addon-price .addon-label {
    color: #666;
}

.lm-stl-action-section .marker-addon-price .addon-value {
    font-weight: 600;
    color: #c2185b;
}
