/* Menu Manager Admin CSS */

/* Menu Category Admin */
.menu-category-preview {
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    color: white;
    font-weight: bold;
}

.color-preview {
    width: 20px;
    height: 20px;
    border: 1px solid #ccc;
    display: inline-block;
    border-radius: 2px;
}

/* Menu Item Inline */
.menu-item-inline {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 5px 0;
    padding: 10px;
}

.menu-item-inline .form-row {
    margin-bottom: 10px;
}

.menu-item-inline .field-icon input {
    font-family: 'Font Awesome 5 Free', sans-serif;
}

/* URL Type specific styling */
.field-url_value input[data-url-type="view_name"] {
    background-color: #e8f4fd;
}

.field-url_value input[data-url-type="external"] {
    background-color: #fff2e8;
}

.field-url_value input[data-url-type="javascript"] {
    background-color: #f0f8e8;
    font-family: monospace;
}

/* Migration Wizard */
.migration-wizard {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.migration-step {
    margin-bottom: 30px;
}

.migration-step h3 {
    color: #79aec8;
    border-bottom: 2px solid #79aec8;
    padding-bottom: 10px;
}

.app-suggestion {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 10px 0;
    padding: 15px;
    background: #f9f9f9;
}

.app-suggestion.selected {
    background: #e8f4fd;
    border-color: #79aec8;
}

.app-suggestion h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.app-suggestion .app-models {
    font-size: 0.9em;
    color: #666;
}

.app-suggestion input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

/* Menu Preview */
.menu-preview {
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
}

.menu-preview-category {
    margin-bottom: 20px;
    border-radius: 4px;
    overflow: hidden;
}

.menu-preview-header {
    padding: 10px 15px;
    font-weight: bold;
    color: white;
}

.menu-preview-items {
    background: white;
    border: 1px solid #ddd;
}

.menu-preview-item {
    padding: 8px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.menu-preview-item:last-child {
    border-bottom: none;
}

.menu-preview-item i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

.menu-preview-item .badge {
    background: #79aec8;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.8em;
    margin-left: auto;
}

/* Drag and Drop (for future enhancement) */
.sortable-item {
    cursor: move;
    position: relative;
}

.sortable-item:hover {
    background-color: #f0f8ff;
}

.sortable-placeholder {
    background-color: #e8f4fd;
    border: 2px dashed #79aec8;
    height: 40px;
    margin: 5px 0;
}

/* Form enhancements */
.field-url_params textarea,
.field-count_filter textarea {
    font-family: monospace;
    font-size: 12px;
}

.json-field {
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

/* Responsive design */
@media (max-width: 768px) {
    .migration-wizard {
        margin: 10px;
        padding: 15px;
    }
    
    .menu-preview {
        margin: 10px 0;
        padding: 15px;
    }
}

/* Icon picker (for future enhancement) */
.icon-picker {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.icon-picker .icon-option {
    display: inline-block;
    padding: 5px;
    margin: 2px;
    cursor: pointer;
    border-radius: 2px;
}

.icon-picker .icon-option:hover {
    background-color: #e8f4fd;
}

/* Validation styling */
.field-error {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
}

.validation-message {
    color: #dc3545;
    font-size: 0.9em;
    margin-top: 5px;
}

.validation-success {
    color: #28a745;
    font-size: 0.9em;
    margin-top: 5px;
}

/* Advanced Admin Features */

/* Drag & Drop */
.drag-handle {
    cursor: move;
    color: #666;
    margin-right: 10px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.drag-handle:hover {
    opacity: 1;
    color: #79aec8;
}

.sortable-ghost {
    opacity: 0.5;
    background-color: #e8f4fd;
}

.sortable-chosen {
    background-color: #f0f8ff;
}

.sortable-drag {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Bulk Operations */
.bulk-actions {
    margin-left: 20px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.bulk-actions select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.bulk-actions button {
    padding: 6px 12px;
    background: #79aec8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.bulk-actions button:hover {
    background: #6c9ab7;
}

/* Preview Modal */
.menu-preview-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    background: #79aec8;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Menu Preview Content */
.menu-preview-container {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.preview-category {
    margin-bottom: 0;
}

.preview-category-header {
    padding: 10px 15px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-items {
    background: white;
    border-bottom: 1px solid #eee;
}

.preview-item {
    padding: 8px 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.preview-item i {
    width: 16px;
    text-align: center;
    color: #666;
}

.preview-badge {
    background: #79aec8;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: auto;
}

.preview-submenu {
    background: #f9f9f9;
    border-left: 3px solid #79aec8;
}

.preview-subitem {
    padding: 6px 15px 6px 30px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.preview-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 4px 15px;
}

/* Quick Actions */
.duplicate-item {
    background: #28a745 !important;
    color: white !important;
    border: none !important;
    padding: 4px 8px !important;
    font-size: 11px !important;
    margin-left: 5px !important;
}

.duplicate-item:hover {
    background: #218838 !important;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    color: white;
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.notification-success {
    background: #28a745;
}

.notification-error {
    background: #dc3545;
}

.notification-warning {
    background: #ffc107;
    color: #333;
}

.notification .close {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    margin-left: auto;
}

/* Loading states */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #79aec8;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

/* Enhanced form styling */
.inline-related {
    position: relative;
}

.inline-related:hover .drag-handle {
    opacity: 1;
}

.form-row.errors input,
.form-row.errors select,
.form-row.errors textarea {
    border-color: #dc3545;
}

/* Preview button styling */
.preview-menu-btn {
    background: #17a2b8 !important;
    color: white !important;
}

.preview-menu-btn:hover {
    background: #138496 !important;
}
