
/* Bounding Box Input Styles */
.bounding-box-toggle {
    cursor: pointer;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    margin-left: auto;
    margin-right: auto;
    transition: all 0.2s ease;
}

.bounding-box-toggle:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
}

.bounding-box-toggle.active {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.bounding-box-toggle.active .form-check-label {
    color: #0c5460;
}

.bounding-box-toggle.active .form-check-label i {
    color: #007bff;
}

.bounding-box-toggle .form-check {
    margin: 0;
    display: flex;
    align-items: center;
}

.bounding-box-toggle .form-check-input {
    margin-right: 0.5rem;
    cursor: pointer;
    width: 1.2em;
    height: 1.2em;
}

.bounding-box-toggle .form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
}

.bounding-box-toggle .form-check-label {
    cursor: pointer;
    font-weight: 500;
    color: #495057;
    margin: 0;
    display: flex;
    align-items: center;
    user-select: none;
}

.bounding-box-toggle .form-check-label:hover {
    color: #007bff;
}

.bounding-box-toggle .form-check-label i {
    color: #6c757d;
    margin-right: 0.5rem;
}

.bounding-box-help-text {
    margin-top: 0.5rem;
    padding-left: 1.7rem;
}

.bounding-box-help-text small {
    font-size: 0.8rem;
    line-height: 1.2;
}

.bounding-box-help-text i {
    color: #6c757d;
}

.bounding-box-input {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.bounding-box-input.hidden {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
}

.bounding-box-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.coordinate-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
    max-width: 600px;
}

/* Four-input layout: X max, Y max, X min, Y min */
.coordinate-grid-four {
    grid-template-columns: 1fr 1fr;
    max-width: 500px;
}

.coordinate-grid-four .coordinate-input {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.coordinate-input {
    background-color: white;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.coordinate-input label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    text-align: center;
}

.coordinate-inputs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.coordinate-grid-four .coordinate-input .coordinate-input-field {
    width: 100%;
    max-width: 140px;
}

.coordinate-input-field {
    width: 150px;
    padding: 0.5rem;
    font-size: 0.8rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    text-align: center;
}

.coordinate-input-field:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.coordinate-input-field::placeholder {
    color: #adb5bd;
    font-size: 0.7rem;
}

.coordinate-input-field.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

/* Error Messages */
.coordinate-errors {
    margin-top: 1rem;
    width: 100%;
    max-width: 600px;
}

.error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    font-size: 0.8rem;
}

.error-message i {
    color: #dc3545;
    flex-shrink: 0;
}

.error-message.hidden {
    display: none;
}

/* Warning message styling */
.error-message.swap-warning {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.error-message.swap-warning i {
    color: #17a2b8;
}

.bounding-box-actions {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 1rem;
}

.bounding-box-add-btn {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.bounding-box-add-btn:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.bounding-box-add-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (min-width: 992px){
    .bounding-box-container{
        margin:auto;
        width: 100%;
    }
}


/* Responsive design for bounding box */
@media (max-width: 768px) {
    .coordinate-grid,
    .coordinate-grid-four {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
    
    .coordinate-input {
        padding: 0.75rem;
    }
    
    .coordinate-input-field {
        width: 120px;
        font-size: 0.75rem;
        padding: 0.4rem;
    }
    
    .coordinate-input label {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .coordinate-grid,
    .coordinate-grid-four {
        max-width: 300px;
    }
    
    .coordinate-input {
        padding: 0.5rem;
    }
    
    .coordinate-input-field {
        width: 100px;
        font-size: 0.7rem;
        padding: 0.3rem;
    }
    
    .coordinate-input label {
        font-size: 0.75rem;
    }
}