/* =====================================================
   ESTILOS PARA PÁGINA DE MENÚS
   ===================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Segoe UI', Tahoma, sans-serif;
}

body {
    background-color: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
    padding-top: 140px;
    overflow-x: hidden;
}

.menus-container {
    max-width: 1000px;
    margin: 0 auto;
    overflow-x: hidden;
}

/* Header */
.header-logo {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 15px;
    text-align: center;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-logo img {
    max-width: 250px;
    cursor: pointer;
}

/* Header minimized for modal */
.header-logo.minimized {
    padding: 8px;
}

.header-logo.minimized img {
    max-width: 150px;
}

/* User Panel */
.user-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 20px;
    background: white;
    padding: 10px 15px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name-clickable {
    cursor: pointer;
    color: #667eea;
    font-weight: 600;
}

.user-name-clickable:hover {
    text-decoration: underline;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 30px;
    margin-top: 40px;
}

.page-header h1 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 10px;
}

.page-header p {
    color: #666;
    font-size: 1rem;
}

/* Create Menu Section */
.create-menu-section {
    text-align: center;
    margin-bottom: 30px;
}

.btn-large {
    padding: 18px 40px;
    font-size: 1.1rem;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Menu Type Selector */
.menu-type-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.menu-type-card {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.menu-type-card:hover {
    border-color: #667eea;
    transform: translateY(-3px);
}

.menu-type-card.active {
    border-color: #667eea;
    background: #f0f4ff;
}

.menu-type-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.menu-type-card h4 {
    margin-bottom: 5px;
    color: #333;
}

.menu-type-card p {
    font-size: 0.8rem;
    color: #666;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.menu-modal {
    max-width: 600px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.slug-input-group {
    display: flex;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.slug-prefix {
    background: #f0f0f0;
    padding: 12px 15px;
    color: #666;
    font-weight: 500;
}

.slug-input-group input {
    border: none;
    border-radius: 0;
    flex: 1;
}

.slug-input-group input:focus {
    border: none;
}

.slug-hint {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

.slug-error {
    display: block;
    margin-top: 5px;
    color: #ff6b6b;
    font-size: 0.85rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input {
    width: 20px;
    height: 20px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

/* Buttons */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Menus Grid */
.menus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

.menu-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.menu-card:hover {
    transform: translateY(-5px);
}

.menu-card-header {
    height: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.menu-card-header.links {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.menu-card-header.restaurant {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.menu-card-header.business {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.menu-card-body {
    padding: 20px;
}

.menu-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.menu-card-slug {
    font-size: 0.9rem;
    color: #667eea;
    margin-bottom: 10px;
}

.menu-card-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.menu-card-stats {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 15px;
}

.menu-card-actions {
    display: flex;
    gap: 10px;
}

.menu-card-actions .btn {
    flex: 1;
    padding: 10px;
    font-size: 0.9rem;
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #333;
    margin-bottom: 10px;
}

.empty-state p {
    color: #666;
    margin-bottom: 20px;
}

/* Menu Editor */
.menu-editor {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.editor-header h2 {
    color: #333;
}

.editor-actions {
    display: flex;
    gap: 10px;
}

.editor-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.editor-section:last-child {
    border-bottom: none;
}

.editor-section:not(.collapsible) .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.editor-section:not(.collapsible) .section-header h3 {
    color: #333;
}

/* Links List */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.link-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    gap: 15px;
}

.link-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.link-info {
    flex: 1;
}

.link-title {
    font-weight: 600;
    color: #333;
}

.link-url {
    font-size: 0.85rem;
    color: #667eea;
}

.link-actions {
    display: flex;
    gap: 5px;
}

.link-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.link-actions button:hover {
    opacity: 1;
}

/* Categories List */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.category-card {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #e9ecef;
}

.category-name {
    font-weight: 600;
    color: #333;
}

.category-actions {
    display: flex;
    gap: 10px;
}

.category-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.category-items {
    padding: 15px;
}

.item-card {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    gap: 15px;
}

.item-card:last-child {
    margin-bottom: 0;
}

.item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    background: #eee;
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 600;
    color: #333;
}

.item-description {
    font-size: 0.85rem;
    color: #666;
}

.item-price {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

.item-actions {
    display: flex;
    gap: 5px;
}

.item-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.6;
}

.item-actions button:hover {
    opacity: 1;
}

/* Theme Selector */
.theme-selector {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.theme-option {
    text-align: center;
    cursor: pointer;
}

.theme-preview {
    width: 100%;
    height: 50px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 3px solid transparent;
    transition: border-color 0.3s;
}

.theme-option.active .theme-preview {
    border-color: #667eea;
}

.theme-option span {
    font-size: 0.8rem;
    color: #666;
}

/* Color Settings */
.color-settings {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.color-group {
    flex: 1;
    min-width: 150px;
}

.color-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.color-group input[type="color"] {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* Preview Modal */
.preview-modal {
    max-width: 400px;
    padding: 0;
    background: transparent;
}

.phone-frame {
    background: white;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.phone-header {
    background: #f0f0f0;
    padding: 10px;
    text-align: center;
    font-size: 0.8rem;
    color: #666;
}

#previewFrame {
    width: 100%;
    height: 600px;
    border: none;
}

/* Preview Modal z-index override */
.preview-modal.modal-content {
    max-width: 420px;
    width: 95%;
    background: transparent;
    box-shadow: none;
}

.preview-modal .phone-frame {
    max-height: 80vh;
    overflow: hidden;
}

.preview-modal #previewFrame {
    height: 70vh;
    max-height: 500px;
}

/* QR Code Section */
.qr-code-container {
    text-align: center;
    padding: 20px;
}

.qr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
}

.qr-loading .spinner {
    width: 30px;
    height: 30px;
    border-width: 3px;
}

.qr-image-wrapper {
    background: white;
    padding: 20px;
    border-radius: 15px;
    display: inline-block;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.qr-image-wrapper img {
    max-width: 200px;
    height: auto;
    display: block;
}

.qr-url {
    font-size: 1rem;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 15px;
    word-break: break-all;
}

.qr-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Appearance Subsections */
.appearance-subsection {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.appearance-subsection:last-of-type {
    border-bottom: none;
}

.appearance-subsection h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1rem;
}

/* Extended Theme Selector */
.theme-selector {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5px;
}

.theme-option {
    text-align: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.3s;
}

.theme-option:hover {
    transform: translateY(-2px);
}

.theme-option.active {
    background: rgba(102, 126, 234, 0.1);
    box-shadow: 0 0 0 2px #667eea;
}

.theme-preview {
    width: 100%;
    height: 40px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.theme-option.active .theme-preview {
    border-color: #667eea;
}

.theme-option span {
    font-size: 0.75rem;
    color: #666;
    display: block;
}

/* Animated Background Selector */
.animated-bg-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5px;
}

.bg-option {
    text-align: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.bg-option:hover {
    transform: translateY(-2px);
}

.bg-option.active {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.bg-preview {
    width: 100%;
    height: 50px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.bg-option span {
    font-size: 0.75rem;
    color: #666;
}

/* Font Selector */
.font-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5px;
}

.font-option {
    text-align: center;
    padding: 12px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.font-option:hover {
    border-color: #667eea;
}

.font-option.active {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* Additional Options */
.additional-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.additional-options .checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background 0.3s;
}

.additional-options .checkbox-label:hover {
    background: #e9ecef;
}

.additional-options .checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

/* Extended Color Settings */
.color-settings {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5px;
}

.color-group {
    flex: 1;
}

.color-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.color-group input[type="color"] {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.color-group input[type="color"]:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Checkbox "Aplicar desde tema" */
.checkbox-apply-theme {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.8rem;
    color: #666;
    cursor: pointer;
}

.checkbox-apply-theme input {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
}

body.dark-mode .checkbox-apply-theme {
    color: #b0b0b0;
}

/* Dark Mode Button */
.dark-mode-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.dark-mode-btn:hover {
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
        padding-top: 120px;
    }

    .page-header {
        margin-top: 30px;
        margin-bottom: 20px;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .page-header p {
        font-size: 0.9rem;
    }

    .menu-type-selector {
        grid-template-columns: 1fr;
    }

    .theme-selector {
        grid-template-columns: repeat(3, 1fr);
    }

    .theme-option {
        padding: 5px;
    }

    .theme-preview {
        height: 35px;
    }

    .menus-grid {
        grid-template-columns: 1fr;
    }

    .editor-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .editor-header h2 {
        font-size: 1.2rem;
        margin: 10px 0;
    }

    .editor-actions {
        width: 100%;
    }

    .editor-actions .btn {
        flex: 1;
        text-align: center;
        padding: 10px;
        font-size: 0.85rem;
    }

    .color-settings {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .color-group {
        min-width: 100%;
    }

    .animated-bg-selector {
        grid-template-columns: repeat(2, 1fr);
    }

    .font-selector {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Modal responsive */
    .modal {
        padding: 10px;
        align-items: flex-start;
        padding-top: 60px;
    }

    .modal-content {
        padding: 15px;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }

    .menu-modal {
        max-width: 100%;
    }

    .preview-modal.modal-content {
        max-width: 95%;
    }

    .preview-modal .phone-frame {
        max-height: 70vh;
    }

    .preview-modal #previewFrame {
        height: 60vh;
        max-height: 400px;
    }

    /* Secciones colapsables en móvil */
    .editor-section.collapsible .section-header {
        padding: 15px;
    }

    .editor-section.collapsible .section-header h3 {
        font-size: 1rem;
    }

    .subsection-header {
        padding: 12px 15px;
    }

    .subsection-header h4 {
        font-size: 0.9rem;
    }

    .subsection-content {
        padding: 12px;
    }

    /* Header del usuario en móvil */
    .user-panel {
        flex-direction: column;
        gap: 8px;
        padding: 10px;
    }

    .user-info {
        width: 100%;
        justify-content: center;
    }

    /* Botón crear menú */
    .btn-large {
        padding: 15px 25px;
        font-size: 1rem;
        width: 100%;
    }

    /* Header logo en móvil */
    .header-logo img {
        max-width: 180px;
    }

    /* Dark mode button */
    .dark-mode-btn {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }

    /* QR section */
    .qr-code-container {
        padding: 10px;
    }

    .qr-actions {
        flex-direction: column;
    }

    .qr-actions .btn {
        width: 100%;
        text-align: center;
    }

    /* Links y categorías */
    .link-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .link-info {
        width: 100%;
    }

    .category-card {
        margin-bottom: 15px;
    }

    /* Formularios */
    .form-group {
        margin-bottom: 15px;
    }

    .form-group input,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        text-align: center;
    }

    /* Imagen preview */
    .image-preview {
        max-width: 100%;
    }

    /* Checkbox apply theme */
    .checkbox-apply-theme {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    /* Ocultar secundarios en móvil */
    .editor-section.collapsible .collapse-icon,
    .appearance-subsection.collapsible-sub .collapse-icon {
        font-size: 0.7rem;
    }
}

/* Pantallas muy pequeñas */
@media (max-width: 480px) {
    body {
        padding: 5px;
        padding-top: 100px;
    }

    .page-header h1 {
        font-size: 1.3rem;
    }

    .header-logo img {
        max-width: 150px;
    }

    .theme-selector {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .theme-preview {
        height: 30px;
    }

    .theme-option span {
        font-size: 0.7rem;
    }

    .animated-bg-selector {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .font-selector {
        grid-template-columns: 1fr;
    }

    .editor-section.collapsible .section-header h3 {
        font-size: 0.9rem;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* =====================================================
   DARK MODE STYLES
   ===================================================== */

body.dark-mode {
    background-color: #1a1a2e;
    color: #e0e0e0;
}

/* Dark mode - logo invert */
body.dark-mode .header-logo img {
    filter: invert(1) brightness(1.2);
}

/* User Panel */
body.dark-mode .user-panel {
    background: #16213e;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

body.dark-mode .user-name-clickable {
    color: #a8c0ff;
}

/* Page Header */
body.dark-mode .page-header h1 {
    color: #e0e0e0;
}

body.dark-mode .page-header p {
    color: #b0b0b0;
}

/* Menu Type Selector */
body.dark-mode .menu-type-card {
    background: #16213e;
    border-color: #0f3460;
}

body.dark-mode .menu-type-card:hover {
    border-color: #667eea;
}

body.dark-mode .menu-type-card.active {
    background: #0f3460;
    border-color: #667eea;
}

body.dark-mode .menu-type-card h4 {
    color: #e0e0e0;
}

body.dark-mode .menu-type-card p {
    color: #b0b0b0;
}

/* Modal */
body.dark-mode .modal-content {
    background: #16213e;
}

body.dark-mode .modal-close {
    color: #b0b0b0;
}

body.dark-mode .modal-close:hover {
    color: #e0e0e0;
}

body.dark-mode .modal-content h3 {
    color: #e0e0e0;
}

/* Form */
body.dark-mode .form-group label {
    color: #e0e0e0;
}

body.dark-mode .form-group input,
body.dark-mode .form-group textarea,
body.dark-mode .form-group select {
    background: #0f3460;
    border-color: #1a4a7a;
    color: #e0e0e0;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group textarea:focus {
    border-color: #667eea;
}

body.dark-mode .slug-input-group {
    border-color: #1a4a7a;
}

body.dark-mode .slug-prefix {
    background: #0f3460;
    color: #b0b0b0;
}

body.dark-mode .slug-hint {
    color: #b0b0b0;
}

body.dark-mode .checkbox-label {
    color: #e0e0e0;
}

/* Buttons */
body.dark-mode .btn-secondary {
    background: #0f3460;
    color: #e0e0e0;
}

body.dark-mode .btn-secondary:hover {
    background: #1a4a7a;
}

/* Menu Card */
body.dark-mode .menu-card {
    background: #16213e;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Menu Card Body - CRITICAL for contrast */
body.dark-mode .menu-card-body {
    background: #16213e;
}

body.dark-mode .menu-card-title {
    color: #e0e0e0;
}

body.dark-mode .menu-card-slug {
    color: #a8c0ff;
}

body.dark-mode .menu-card-description {
    color: #b0b0b0;
}

body.dark-mode .menu-card-stats {
    color: #b0b0b0;
    border-top-color: #0f3460;
}

/* Menu Editor */
body.dark-mode .menu-editor {
    background: #16213e;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

body.dark-mode .editor-header h2 {
    color: #e0e0e0;
}

body.dark-mode .editor-section {
    border-bottom-color: #0f3460;
}

body.dark-mode .editor-section:not(.collapsible) .section-header h3 {
    color: #e0e0e0;
}

/* Links List */
body.dark-mode .link-item {
    background: #0f3460;
}

body.dark-mode .link-title {
    color: #e0e0e0;
}

body.dark-mode .link-url {
    color: #a8c0ff;
}

body.dark-mode .link-actions button {
    color: #b0b0b0;
}

body.dark-mode .link-actions button:hover {
    color: #e0e0e0;
}

/* Categories List */
body.dark-mode .category-card {
    background: #0f3460;
}

body.dark-mode .category-header {
    background: #1a4a7a;
}

body.dark-mode .category-name {
    color: #e0e0e0;
}

body.dark-mode .category-actions button {
    color: #b0b0b0;
}

body.dark-mode .category-actions button:hover {
    color: #e0e0e0;
}

body.dark-mode .item-card {
    background: #16213e;
}

body.dark-mode .item-name {
    color: #e0e0e0;
}

body.dark-mode .item-description {
    color: #b0b0b0;
}

body.dark-mode .item-price {
    color: #a8c0ff;
}

body.dark-mode .item-actions button {
    color: #b0b0b0;
}

body.dark-mode .item-actions button:hover {
    color: #e0e0e0;
}

/* Theme Selector */
body.dark-mode .theme-option span {
    color: #b0b0b0;
}

body.dark-mode .theme-option.active {
    background: rgba(102, 126, 234, 0.2);
}

/* Color Settings */
body.dark-mode .color-group label {
    color: #e0e0e0;
}

/* Phone Frame */
body.dark-mode .phone-frame {
    background: #16213e;
}

body.dark-mode .phone-header {
    background: #0f3460;
    color: #b0b0b0;
}

/* QR Code Section */
body.dark-mode .qr-image-wrapper {
    background: #16213e;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

body.dark-mode .qr-url {
    color: #a8c0ff;
}

/* Appearance Subsections */
body.dark-mode .appearance-subsection {
    border-bottom-color: #0f3460;
}

body.dark-mode .appearance-subsection h4 {
    color: #e0e0e0;
}

/* Background Option */
body.dark-mode .bg-option span {
    color: #b0b0b0;
}

body.dark-mode .bg-option.active {
    background: rgba(102, 126, 234, 0.2);
}

/* Font Option */
body.dark-mode .font-option {
    border-color: #1a4a7a;
    color: #e0e0e0;
}

body.dark-mode .font-option:hover {
    border-color: #667eea;
}

body.dark-mode .font-option.active {
    background: rgba(102, 126, 234, 0.2);
}

/* Additional Options */
body.dark-mode .additional-options .checkbox-label {
    background: #0f3460;
    color: #e0e0e0;
}

body.dark-mode .additional-options .checkbox-label:hover {
    background: #1a4a7a;
}

/* Empty State */
body.dark-mode .empty-state h3 {
    color: #e0e0e0;
}

body.dark-mode .empty-state p {
    color: #b0b0b0;
}

/* Dark Mode Button */
body.dark-mode .dark-mode-btn {
    background: #16213e;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* =====================================================
   SECCIONES COLAPSABLES DEL EDITOR
   ===================================================== */

.editor-section.collapsible {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.editor-section.collapsible:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.editor-section.collapsible .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s ease;
    border-radius: 12px 12px 0 0;
}

.editor-section.collapsible .section-header:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
}

.editor-section.collapsible .section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.editor-section.collapsible .collapse-icon {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    opacity: 0.9;
}

.editor-section.collapsible .section-content {
    padding: 20px;
    transition: all 0.3s ease;
}

/* Estado colapsado */
.editor-section.collapsible.collapsed .section-content {
    display: none;
    padding: 0 20px;
}

.editor-section.collapsible.collapsed .section-header {
    border-radius: 12px;
}

/* Links List dentro de collapsible */
.editor-section.collapsible .links-list {
    margin-top: 15px;
}

/* Dark mode para secciones colapsables */
body.dark-mode .editor-section.collapsible {
    background: #2d2d3a;
    border-color: #3d3d4a;
}

body.dark-mode .editor-section.collapsible:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Restaurar el editor-section original para secciones no colapsables */
.editor-section:not(.collapsible) {
    background: transparent;
    border: none;
    padding: 0;
}

/* =====================================================
   SUB-SECCIONES COLAPSABLES DE APARIENCIA
   ===================================================== */

.appearance-subsection.collapsible-sub {
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
    background: #fafafa;
    transition: all 0.3s ease;
}

.appearance-subsection.collapsible-sub:hover {
    border-color: #667eea;
}

.appearance-subsection.collapsible-sub .subsection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 18px;
    background: #f0f4ff;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s ease;
}

.appearance-subsection.collapsible-sub .subsection-header:hover {
    background: #e0e8ff;
}

.appearance-subsection.collapsible-sub .subsection-header h4 {
    margin: 0;
    font-size: 1rem;
    color: #333;
    font-weight: 600;
}

.appearance-subsection.collapsible-sub .collapse-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    opacity: 0.7;
    color: #667eea;
}

.appearance-subsection.collapsible-sub .subsection-content {
    padding: 18px;
    transition: all 0.3s ease;
    background: white;
}

/* Estado colapsado */
.appearance-subsection.collapsible-sub.collapsed .subsection-content {
    display: none;
    padding: 0 18px;
}

.appearance-subsection.collapsible-sub.collapsed .subsection-header {
    border-radius: 10px;
}

/* Dark mode para sub-secciones */
body.dark-mode .appearance-subsection.collapsible-sub {
    background: #1a1a2e;
    border-color: #2d2d4a;
}

body.dark-mode .appearance-subsection.collapsible-sub:hover {
    border-color: #667eea;
}

body.dark-mode .appearance-subsection.collapsible-sub .subsection-header {
    background: #16213e;
}

body.dark-mode .appearance-subsection.collapsible-sub .subsection-header:hover {
    background: #1a2a4a;
}

body.dark-mode .appearance-subsection.collapsible-sub .subsection-header h4 {
    color: #e0e0e0;
}

body.dark-mode .appearance-subsection.collapsible-sub .subsection-content {
    background: #0f3460;
}

/* Ajuste para selectors dentro de sub-secciones */
.appearance-subsection.collapsible-sub .theme-selector,
.appearance-subsection.collapsible-sub .animated-bg-selector,
.appearance-subsection.collapsible-sub .font-selector {
    margin-top: 10px;
}

/* =====================================================
   IMAGEN PREVIEW Y FORM HINTS
   ===================================================== */

.form-hint {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 0.85rem;
}

.image-preview {
    position: relative;
    margin-top: 10px;
    display: inline-block;
    max-width: 200px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.image-preview .btn-clear {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #ff4444;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.image-preview .btn-clear:hover {
    background: #ff4444;
    color: white;
    transform: scale(1.1);
}

/* Dark mode */
body.dark-mode .form-hint {
    color: #aaa;
}