/* Enhanced Checklist Builder Styles */

/* Modal size adjustments for the larger checklist builder */
.checklist-modal-content {
    max-width: 1000px;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

#checklistForm {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

/* Checklist Building Tabs */
.checklist-tabs {
    display: flex;
    margin: 20px 0 0 0;
    border-bottom: 2px solid #ddd;
}

.checklist-tab {
    padding: 10px 20px;
    cursor: pointer;
    background-color: #f2f2f2;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    margin-right: 5px;
    font-weight: bold;
}

.checklist-tab.active {
    background-color: #fff;
    border-bottom: 2px solid #fff;
    margin-bottom: -2px;
    color: #2196F3;
}

.checklist-tab-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 15px 0;
}

/* Toolbar */
.checklist-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.item-type-selector {
    display: flex;
    gap: 5px;
    align-items: center;
}

.item-type-selector select {
    min-width: 150px;
}

/* Checklist Builder */
.checklist-builder {
    flex-grow: 1;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background-color: #f9f9f9;
}

.sortable-list {
    min-height: 50px;
}

/* Sections */
.checklist-section {
    margin-bottom: 20px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    background-color: #f2f2f2;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.section-title {
    flex-grow: 1;
    font-weight: bold;
    font-size: 16px;
    background: transparent;
    border: none;
    padding: 5px;
}

.section-title:focus {
    background-color: white;
    border: 1px solid #ddd;
    outline: none;
}

.section-actions {
    display: flex;
    gap: 5px;
}

.section-items {
    padding: 10px;
}

/* Items */
.checklist-item {
    margin-bottom: 10px;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #ddd;
    overflow: hidden;
}

.item-content {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #fff;
}

.item-type-indicator {
    margin-right: 10px;
    width: 25px;
    text-align: center;
    font-size: 16px;
    color: #666;
}

.item-text {
    flex-grow: 1;
    border: none;
    padding: 5px;
    background-color: transparent;
}

.item-text:focus {
    background-color: #f5f5f5;
    outline: none;
    border-radius: 3px;
}

.item-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.required-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #666;
}

.item-details {
    padding: 10px;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
}

/* Drag handle */
.drag-handle {
    cursor: move;
    margin-right: 10px;
    color: #999;
}

/* Placeholder */
.empty-state {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Preview Tab */
.preview-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.preview-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.preview-description {
    color: #666;
    font-size: 14px;
}

.checklist-preview {
    flex-grow: 1;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
}

/* Settings Tab */
.settings-section {
    background-color: white;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.settings-section h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #333;
}

/* Multiple choice items */
.choice-list {
    margin-bottom: 10px;
}

.choice-item {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
    align-items: center;
}

.choice-text {
    flex-grow: 1;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.delete-choice-btn {
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.add-choice-btn {
    padding: 5px 10px;
    font-size: 12px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
}

/* Range inputs */
.range-inputs {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.range-inputs input {
    width: 100px;
}

/* Measurement config */
.measurement-config {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.unit-select {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Collapsed sections */
.section-collapsed .section-items {
    display: none;
}

.collapse-section-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

/* Delete buttons */
.delete-section-btn, .delete-item-btn {
    border: none;
    background: none;
    color: #f44336;
    font-size: 18px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.delete-section-btn:hover, .delete-item-btn:hover {
    background-color: #ffebee;
}

/* Instruction item */
.instruction-text {
    width: 100%;
    min-height: 80px;
    resize: vertical;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* When items are being dragged */
.sortable-ghost {
    opacity: 0.5;
    background-color: #e3f2fd;
}