/* 
   ============================================================================
   MENU ENGINEER UI STYLES
   ============================================================================
   This file contains all UI-specific styles for the Menu Engineer module,
   including the Repertoire Sidebar, Editor Canvas, and Deep Branding Modal.
*/

/* Repertoire Filters & Badges */
.me-rep-badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 1rem;
}

.me-rep-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 2px solid var(--border-subtle);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-user-select: none;
    user-select: none;
}

.me-rep-badge:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    transform: translateY(-1px);
}

.me-rep-badge.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(195, 0, 0, 0.3);
}

.me-sort-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-subtle);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.me-sort-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.me-sort-toggle.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.me-search-container {
    position: relative;
    margin-bottom: 1rem;
}

.me-search-container input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border-radius: 24px;
    background: rgba(0, 0, 0, 0.25);
    border: 2px solid var(--border-subtle);
    color: var(--text-main);
    outline: none;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.me-search-container input:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(195, 0, 0, 0.1);
}

.me-search-container i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Drag and Drop Sortable Styles */
.me-sortable-ghost {
    opacity: 0.3 !important;
    background: var(--primary-dim) !important;
    border: 2px dashed var(--primary) !important;
}

.me-item-chosen {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

.me-item-dragging {
    opacity: 0.9 !important;
    transform: rotate(1deg) scale(1.02);
    cursor: grabbing !important;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    background: var(--bg-card) !important;
    border-color: var(--primary) !important;
}

.me-rep-item-dragging {
    opacity: 0.8 !important;
    transform: scale(1.05);
    background: var(--primary-dim) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 5px 15px rgba(195, 0, 0, 0.4) !important;
    z-index: 1000;
}

.me-drag-handle {
    cursor: grab;
    padding: 12px;
    margin: -12px;
    opacity: 0.3;
    transition: opacity 0.2s, color 0.2s;
    width: 24px;
    height: 24px;
}

.me-drag-handle:hover {
    opacity: 0.8;
    color: var(--primary);
}

.me-drag-handle:active {
    cursor: grabbing;
}

.cursor-grab {
    cursor: grab;
}

.cursor-grab:active {
    cursor: grabbing;
}

/* --- Editor Canvas Sections --- */
.me-section {
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-xxl);
    padding: 1.25rem 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 1rem;
}

.me-section-title {
    background: transparent;
    border: 2px solid transparent;
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    border-bottom: 2px solid var(--primary);
    border-radius: 36px;
    padding: 0.3rem 0.5rem;
    transition: all 0.2s;
}

.me-item {
    background: var(--bg-card2);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 0.75rem 1rem;
    transition: all 0.25s ease;
    cursor: default;
    margin-bottom: 0.5rem;
}

.me-item:hover {
    background: var(--bg-input);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Typography Accordion Sections */
.typo-accordion {
    border: 2px solid var(--border-subtle);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.typo-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
    transition: background 0.2s;
}

.typo-accordion-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.typo-accordion-header .typo-preview {
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.typo-accordion-header i {
    width: 16px;
    height: 16px;
    transition: transform 0.25s ease;
    color: var(--text-muted);
}

.typo-accordion.open .typo-accordion-header i.typo-chevron {
    transform: rotate(180deg);
}

.typo-accordion-body {
    display: none;
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid var(--border-subtle);
}

.typo-accordion.open .typo-accordion-body {
    display: block;
}

/* Orientation Toggle  */
.orientation-toggle {
    display: inline-flex;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-subtle);
    background: var(--bg-input);
}

.orientation-toggle button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.orientation-toggle button i {
    width: 16px;
    height: 16px;
}

.orientation-toggle button.active {
    background: var(--primary);
    color: white;
}

/* Preset Button Groups */
.preset-btn-group {
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-subtle);
    background: var(--bg-input);
}

.preset-btn-group button {
    flex: 1;
    padding: 0.55rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn-group button.active {
    background: var(--primary);
    color: white;
}

/* Enhanced Color Picker with Hex Input */
.color-picker-advanced {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-input);
    padding: 0.4rem 0.6rem;
    border-radius: 12px;
}

.color-picker-advanced input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: none;
    flex-shrink: 0;
}

.color-picker-advanced input[type="text"] {
    width: 80px;
    font-family: monospace;
    font-size: 0.82rem;
    text-transform: uppercase;
    padding: 0.35rem 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-main);
}

/* Custom Fonts List */
.custom-fonts-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.custom-font-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem 0.35rem 0.9rem;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid var(--border-subtle);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-main);
    font-weight: 500;
}

.custom-font-chip .remove-font {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
}

.custom-font-chip .remove-font:hover {
    background: var(--danger);
    color: white;
}

.add-font-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.75rem;
}

.add-font-row input[type="text"] {
    flex: 1;
    padding: 0.6rem 0.75rem;
    background: var(--bg-input);
    border: 2px solid var(--border-subtle);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 0.85rem;
}

/* Branding subsection labels */
.branding-sub-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: -0.2rem;
}

/* Add custom font select options spacing */
#me-font-browser option,
#tab-typography select option {
    padding: 0.5rem;
    font-size: 0.85rem;
}

#me-font-browser optgroup,
#tab-typography select optgroup {
    background: var(--bg-meta);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding-top: 0.5rem;
}

/* Sliders are defined globally in style.css */

/* Keyframes */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================================================
   DEEP BRANDING MODAL STYLES
   ============================================================================ */

/* Deep Branding Modal components are now global in style.css */