/**
 * Frontend Styles for LM STL Export
 */

.lm-stl-map-selector {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
}

.lm-stl-map-selector h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.5em;
}

.lm-stl-map-container {
    margin: 20px 0;
    border: 2px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#lm-stl-map {
    height: 500px;
    width: 100%;
}

.lm-stl-map-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 4px;
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.control-group input[type="number"] {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.control-group input[type="number"]:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.control-group input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
}

.control-group label:has(input[type="checkbox"]) {
    flex-direction: row;
    align-items: center;
    font-weight: normal;
}

.lm-stl-map-info {
    background: white;
    padding: 20px;
    border-radius: 4px;
    margin-top: 20px;
    border-left: 4px solid #2271b1;
}

.lm-stl-map-info p {
    margin: 8px 0;
}

.lm-stl-map-info strong {
    color: #2271b1;
}

#lm-update-preview {
    padding: 10px 20px;
    background: #2271b1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

#lm-update-preview:hover {
    background: #135e96;
}

/* Preview section */
.lm-stl-preview-section {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.lm-preview-hint {
    text-align: center;
    color: #666;
    font-style: italic;
}

.lm-preview-loading {
    text-align: center;
    padding: 40px;
}

.lm-preview-loading .spinner {
    margin: 20px auto;
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Preview status display */
.lm-preview-status {
    max-width: 400px;
    margin: 0 auto 20px auto;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.lm-preview-step-name {
    font-size: 18px;
    font-weight: 700;
    color: #2271b1;
    margin-bottom: 8px;
}

.lm-preview-step-message {
    font-size: 14px;
    color: #555;
    font-style: italic;
    margin-bottom: 16px;
    min-height: 20px;
}

.lm-preview-progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.lm-preview-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2271b1 0%, #4a90c2 100%);
    border-radius: 4px;
    transition: width 0.3s ease-out;
}

.lm-preview-progress-text {
    font-size: 12px;
    color: #888;
    font-weight: 600;
}

.lm-preview-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.lm-preview-item {
    text-align: center;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background: #fafafa;
    transition: transform 0.2s, box-shadow 0.2s;
}

.lm-preview-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.lm-preview-item h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.lm-preview-item img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: opacity 0.2s;
}

.lm-preview-item a {
    display: block;
    cursor: pointer;
}

.lm-preview-item a:hover img {
    opacity: 0.9;
}

.lm-preview-item .error {
    color: #d32f2f;
    padding: 20px;
}

/* Leaflet map customization */
.leaflet-container {
    font-family: inherit;
}

/* Responsive design */
@media (max-width: 768px) {
    .lm-stl-map-controls {
        grid-template-columns: 1fr;
    }

    #lm-stl-map {
        height: 400px;
    }

    .lm-preview-gallery {
        grid-template-columns: 1fr;
    }
}
