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

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--gray-600);
}

.modal-body {
    padding: 1.5rem;
}

/* Status indicators */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.categorized {
    background: rgb(16 185 129 / 0.1);
    color: var(--success-color);
}

.status-badge.uncategorized {
    background: rgb(107 114 128 / 0.1);
    color: var(--gray-500);
}

/* Responsive design */
@media (max-width: 1024px) {
    .main {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .sidebar {
        width: 100%;
        position: static;
    }
    
    .categorize-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .burger-review-layout {
        height: auto;
    }
    
    .pdf-viewer {
        order: 2;
    }
    
    .categorization-panel {
        order: 1;
    }

    .burger-preview-panel {
        order: 2;
    }
}

/* Autocomplete styles */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-300);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: background-color 0.2s;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: var(--gray-50);
}

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

/* Ensure form groups have relative positioning for autocomplete */
.form-group {
    position: relative;
}

/* Modal styles for images and actions */
.modal-item-image {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 1rem;
}

.modal-item-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    object-fit: contain;
}

.burger-modal-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.burger-modal-gallery-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--gray-50);
    padding: 0.45rem;
}

.burger-modal-gallery-item.is-cover {
    border-color: rgb(37 99 235 / 0.4);
    box-shadow: 0 0 0 2px rgb(37 99 235 / 0.12);
}

.burger-modal-gallery-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: calc(var(--radius) - 2px);
}

.burger-modal-gallery-item span {
    font-size: 0.72rem;
    color: var(--gray-600);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-item-notes {
    grid-column: 1 / -1;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.delete-button {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.delete-button:hover {
    background: #dc2626;
}

@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .header-brand {
        align-items: center;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }

    .collection-switcher {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .browse-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .view {
        padding: 1rem;
    }

    .browse-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .browse-header-actions {
        justify-content: flex-start;
    }

    .browse-item-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .burger-preview-card h2 {
        font-size: 1.45rem;
    }

    .burger-preview-media {
        min-height: 140px;
    }

    .burger-images-preview {
        grid-template-columns: 1fr;
    }

    .delete-btn {
        align-self: flex-end;
        width: fit-content;
    }

    .feed-action-button {
        width: 100%;
        justify-content: center;
    }

    .stats-toolbar {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .alfajor-rating-grid {
        grid-template-columns: 1fr;
    }
}

