/* Custom CSS fixes for Unfold Admin Theme */

/* Fix 1: Batch action dropdown text visibility */
/* Make the default "--------" option text visible in the dropdown */
#changelist-actions select[name="action"] {
    color: #1f2937 !important; /* Dark gray text */
    background-color: white !important;
}

#changelist-actions select[name="action"] option {
    color: #1f2937 !important; /* Dark gray text for all options */
    background-color: white !important;
}

/* Ensure the select box itself has proper styling */
#changelist-actions select[name="action"]:focus {
    border-color: #8b5cf6 !important; /* Purple border on focus */
    outline: none !important;
}

/* Fix 2: Export button styling from django-import-export */
/* Style the export button to look like a proper Unfold button */
.object-tools a,
.object-tools li a {
    display: inline-flex !important;
    align-items: center !important;
    padding: 0.5rem 1rem !important;
    margin-left: 10px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    line-height: 1.25rem !important;
    border-radius: 0.375rem !important;
    background-color: #8b5cf6 !important; /* Purple background */
    color: white !important;
    text-decoration: none !important;
    transition: all 0.15s ease-in-out !important;
    border: 1px solid #8b5cf6 !important;
}

.object-tools a:hover,
.object-tools li a:hover {
    background-color: #7c3aed !important; /* Darker purple on hover */
    border-color: #7c3aed !important;
    color: white !important;
}

/* Alternative styling for secondary buttons (if needed) */
.object-tools a.default,
.object-tools li a.default {
    background-color: white !important;
    color: #8b5cf6 !important;
    border: 1px solid #e5e7eb !important;
}

.object-tools a.default:hover,
.object-tools li a.default:hover {
    background-color: #f9fafb !important;
    border-color: #d1d5db !important;
}

/* Ensure export button text is visible */
.object-tools li {
    list-style: none !important;
}

.object-tools {
    display: flex !important;
    gap: 0.5rem !important;
    align-items: center !important;
}

/* Fix the header export button specifically */
#content-start .object-tools {
    margin-bottom: 1rem !important;
}

/* Don't add background to the actions bar - Unfold already handles this */
/* Just ensure the button has proper styling */
#changelist-actions button[type="submit"],
#changelist-actions input[type="submit"] {
    background-color: #8b5cf6 !important;
    color: white !important;
    border: 1px solid #8b5cf6 !important;
    padding: 0.5rem 1rem !important;
    border-radius: 0.375rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.15s ease-in-out !important;
}

#changelist-actions button[type="submit"]:hover,
#changelist-actions input[type="submit"]:hover {
    background-color: #7c3aed !important;
    border-color: #7c3aed !important;
}

/* Fix 3: Export page styling */
/* Style the export form page */
form fieldset.module {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Export page checkboxes */
.selectable-field-export-row {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    gap: 0.5rem;
}

.selectable-field-export-row input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
    cursor: pointer;
}

.selectable-field-export-row input[type="checkbox"]:checked {
    background-color: #8b5cf6;
    border-color: #8b5cf6;
}

.selectable-field-export-row label {
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    margin: 0;
}

/* Format dropdown */
.form-row.aligned {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    margin-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.form-row.aligned label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    min-width: 80px;
}

.form-row.aligned select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #1f2937;
    background-color: white;
    min-width: 200px;
}

.form-row.aligned select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Submit button on export page */
.submit-row {
    background-color: #f9fafb;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    margin: 1.5rem -1.5rem -1.5rem -1.5rem;
    border-radius: 0 0 0.5rem 0.5rem;
}

.submit-row input[type="submit"] {
    background-color: #8b5cf6 !important;
    color: white !important;
    border: 1px solid #8b5cf6 !important;
    padding: 0.625rem 1.25rem !important;
    border-radius: 0.375rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.15s ease-in-out !important;
}

.submit-row input[type="submit"]:hover {
    background-color: #7c3aed !important;
    border-color: #7c3aed !important;
}

/* Select all checkbox styling */
.select-toggle {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
    cursor: pointer;
    margin-right: 0.5rem;
}

.select-toggle:checked {
    background-color: #8b5cf6;
    border-color: #8b5cf6;
}
