﻿/*
 * Motorhome Checklist Frontend CSS
 */
.mhc-container {
    max-width: 600px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f9f9ff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* Header (Dropdown) */
.mhc-header {
    padding: 16px 20px;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}
.mhc-header label {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}
.mhc-header select {
    width: 100%;
    padding: 10px;
    font-size: 1.1em;
    border-radius: 6px;
    border: 1px solid #ccc;
    background-color: #fff;
}

/* List Title */
.mhc-container h3 {
    font-size: 1.4em;
    font-weight: 700;
    margin: 0;
    padding: 16px 20px;
    color: #333;
}

/* List Items */
#mhc-list-items {
    list-style: none;
    margin: 0;
    padding: 0 20px 20px 20px;
    background-color: #ffffff;
}

#mhc-list-items li {
    display: flex;
    align-items: center;
    font-size: 1.1em;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    transition: color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

#mhc-list-items li:last-child {
    border-bottom: none;
}

/* ** NEW: Drag Handle ** */
.mhc-drag-handle {
    font-size: 1.5em;
    font-weight: bold;
    color: #ccc;
    padding: 0 10px 0 0;
    cursor: grab;
    line-height: 1;
    user-select: none; /* Prevent text selection */
}
.mhc-drag-handle:hover {
    color: #888;
}

#mhc-list-items li label {
    flex-grow: 1;
    margin: 0 10px;
    cursor: pointer;
    user-select: none; /* Prevent text selection when dragging */
}

#mhc-list-items li input[type="checkbox"] {
    /* Make checkbox bigger */
    width: 1.3em;
    height: 1.3em;
    cursor: pointer;
    flex-shrink: 0;
}

/* Checked State */
#mhc-list-items li.checked label {
    text-decoration: line-through;
    color: #888;
}

/* ** NEW: Dragging State ** */
#mhc-list-items li.mhc-dragging {
    opacity: 0.5;
    background: #f0f7ff;
}

/* Delete Item Button (×) */
.mhc-delete-item {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.6em;
    font-weight: 700;
    line-height: 1;
    padding: 0 5px;
    cursor: pointer;
    border-radius: 4px;
    flex-shrink: 0;
    opacity: 0.2;
    transition: all 0.2s ease;
}

#mhc-list-items li:hover .mhc-delete-item {
    opacity: 1;
    color: #b32d2e;
}
.mhc-delete-item:hover {
    background: #f0f0f0;
}


/* Add Item Form */
#mhc-add-form {
    display: flex;
    padding: 16px 20px;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
}
#mhc-add-form input[type="text"] {
    flex-grow: 1;
    padding: 10px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 6px 0 0 6px;
    margin: 0;
}
#mhc-add-form button {
    font-size: 1em;
    padding: 0 20px;
    border: 1px solid #007bff;
    background: #007bff;
    color: white;
    cursor: pointer;
    border-radius: 0 6px 6px 0;
    margin: 0;
    font-weight: 600;
}
#mhc-add-form button:hover {
    background: #0056b3;
}

/* Footer (Reset Button) */
.mhc-footer {
    padding: 16px 20px;
    background: #f9f9ff;
    border-top: 1px solid #eee;
    text-align: right;
}

.mhc-button-danger {
    background: #dc3545;
    border: 1px solid #dc3545;
    color: white;
    padding: 10px 15px;
    font-size: 0.9em;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.mhc-button-danger:hover {
    background: #c82333;
}
