/**
 * OSM Import Styles
 * Polygon controls + progress modal
 */

/* --- Toolbar buttons --- */
.osm-toolbar-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.osm-toolbar-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* --- Polygon drawing controls (bottom-center bar) --- */
.poly-controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    z-index: 1100;
    font-size: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.poly-controls-count {
    font-weight: 500;
    min-width: 70px;
}

.poly-controls-btn {
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.poly-controls-btn:hover {
    opacity: 0.85;
}

.poly-controls-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.poly-controls-btn--finish {
    background: #4CAF50;
    color: #fff;
}

.poly-controls-btn--cancel {
    background: #f44336;
    color: #fff;
}

/* --- Progress / result modal (centered overlay) --- */
.osm-progress-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}

.osm-modal-content {
    background: #fff;
    border-radius: 14px;
    padding: 32px 40px;
    min-width: 260px;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.osm-modal-icon {
    font-size: 42px;
    color: #4CAF50;
    margin-bottom: 12px;
}

.osm-modal-icon--error {
    color: #f44336;
}

.osm-modal-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.osm-modal-detail {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

.osm-modal-btn {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.osm-modal-btn:hover {
    background: #5a6fd6;
}

/* --- Progress bar (indeterminate) --- */
.osm-progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.osm-progress-bar-fill {
    height: 100%;
    width: 40%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 3px;
    animation: osmProgressSlide 1.5s ease-in-out infinite;
}

@keyframes osmProgressSlide {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(150%); }
    100% { transform: translateX(300%); }
}

/* --- Preview type selection modal --- */
.osm-preview-list {
    text-align: left;
    margin: 16px 0;
    max-height: 300px;
    overflow-y: auto;
}

.osm-preview-type {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.osm-preview-type:last-child {
    border-bottom: none;
}

.osm-preview-type input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.osm-preview-type-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.osm-preview-count {
    color: #888;
    font-size: 13px;
    margin-left: 6px;
}

.osm-preview-names {
    font-size: 12px;
    color: #999;
    line-height: 1.3;
}

.osm-preview-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 8px;
    margin-top: 4px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    border-top: 1px solid #eee;
}

.osm-preview-option input[type="checkbox"] {
    width: 15px;
    height: 15px;
}

.osm-preview-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 12px;
}

.osm-modal-btn--cancel {
    background: #999;
}

.osm-modal-btn--cancel:hover {
    background: #777;
}

/* --- Delete variant (red) for polygon controls --- */
.poly-controls--delete .poly-controls-btn--finish {
    background: #f44336;
}

/* --- Danger button variant for toolbar --- */
.osm-toolbar-btn--danger {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.osm-toolbar-btn--danger:hover {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .poly-controls {
        bottom: 20px;
        padding: 8px 14px;
        font-size: 13px;
        gap: 8px;
    }

    .osm-modal-content {
        margin: 0 20px;
        padding: 24px 20px;
    }
}
