/*
    General styling
 */

.recipeForm-content-wrapper {
}


.recipeForm-form {
    display: flex;
    flex-direction: column;
    color: var(--text-primary);

}
.recipeForm-form-group {
    display: flex;
    flex-direction: column;
    padding-bottom: 1rem;
}
.recipeForm-form-group.grouped{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 2rem;
}

@media (max-width: 768px) {
    .recipeForm-form-group.grouped {
            flex-direction: column;
    }
}


.recipeForm-form-group.grouped .recipe-name-container {
    width: 90%;
}
.recipeForm-star-rating {
    display: flex;
    flex-direction: column;
    min-width: 10rem;
}
.recipeForm-star-rating .rating-star {
    cursor: pointer;
    width: 1.5rem;
    height: 1.5rem;
}
.recipeForm-form #portions, .recipeForm-form #prep-time {
    text-align: center;
}
/*
    Form styling
 */
.recipeForm-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    font-size: 1rem;
    letter-spacing: 0.1rem;
}

.recipeForm-ingredients {
    width: 100%;
}
.recipeForm-ingredients  td {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}
.recipeForm-ingredients  td:last-child {
    width: 1%;
    white-space: nowrap;
}
.recipeForm-form input, .recipeForm-form textarea {
    width: 100%;
    min-width: 3rem;
    padding: 0.5rem;
    border: 1px solid var(--border-secundary);
    border-radius: var(--border-radius);
    box-sizing: border-box;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.recipeForm-form input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}
/*
    Recipe instruction editor (Quill) styling
 */
.instructions-container {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-secundary);
}
#editor-container {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-secundary);
}

.ql-toolbar {
    background-color: var(--bg-secondary) !important;
    border: none !important;
    border-bottom: 1px solid var(--border-secundary) !important;
}

.ql-toolbar .ql-stroke {
    stroke: #ecf0f1 !important;
}

.ql-toolbar .ql-fill {
    fill: #ecf0f1 !important;
}

.ql-toolbar button.ql-active .ql-stroke {
    stroke: var(--accent) !important;
}

.ql-toolbar button.ql-active .ql-fill {
    fill: var(--accent) !important;
}

.ql-toolbar button:hover .ql-stroke,
.ql-toolbar button:hover .ql-fill {
    stroke: var(--accent) !important;
}

.ql-toolbar button:hover {
    background-color: var(--bg-tertiary) !important;

}

.ql-container {
    background-color: var(--bg-tertiary) !important;
    border: none !important;
    font-size: 14px;
}

.ql-editor {
    padding: 20px !important;
    line-height: 1.6;
}

.ql-container.ql-snow {
    border: none !important;
}

.ql-editor.ql-blank::before {
    color: #95a5a6;
    font-style: italic;
}

/*
    Category selector styling
*/
.recipeForm-dropdown-container {
    position: relative;
    width: 20rem;
}
.recipeForm-dropdown-container button {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-secundary);
    border-radius: 4px;
    background: var(--bg-tertiary);
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
}
.recipeForm-dropdown-container button:hover {
    border-color: #007bff;
}
.recipeForm-dropdown-menu {
    position: absolute;
    top: 100%;
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secundary);
    border-top: none;
    border-radius: var(--border-radius);
    max-height: 20rem;
    overflow-y: auto;
    z-index: 1000;
    color: var(--text-primary);
}
.recipeForm-dropdown-menu.show {
    display: block;
}
.recipeForm-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 0;
    cursor: pointer;
    font-weight: 600;
    border-bottom: 1px solid var(--border-secundary);
}
.dropdown-item:hover {
    background: var(--accent);
}
.dropdown-item:active {
    background: var(--accent-blue);
}
.recipeForm-dropdown-menu .dropdown-item input[type="checkbox"] {
    margin-right: 8px;
    width: auto;
    padding: 0;
}
.recipeForm-dropdown-arrow {
    transition: transform 0.2s;
}

.recipeForm-dropdown-arrow.open {
    transform: rotate(180deg);
}
.category-color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    border: 1px solid rgba(0,0,0,0.1);
}
.selected-categories {
    display: flex;
    flex-wrap: wrap;

    gap: 0.5rem;
}
.category-tag {
    background: #007bff;
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    gap: 0.5rem;
    align-items:center;
}
/*
    Ingredients selector styling
 */
.ingredients-container {
    border: 1px solid var(--border-secundary);
    border-radius: var(--border-radius);
    padding: 1rem;
}
.ingredient-selection-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.ingredient-selection-search-container {
    position: relative;
    flex: 2;
    min-width: 200px;
}
.ingredient-suggestions-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secundary);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    max-height: 150px;
    overflow-y: auto;
    z-index: 1000;
}
.ingredient-suggestions-container.show {
    display: block;
}
.suggestion-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-secundary);
    line-height: 1.4;
}
.suggestion-item:hover, .suggestion-item.highlighted {
    background-color: var(--bg-fourth);
}
.ingredient-quantity-container {
    display: flex;
    gap: 1rem;
    flex: 1;
}
.quantity-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.unit-select {
    flex: 1;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secundary);
    border-radius: var(--border-radius);
    color: var(--text-primary);
}
.add-ingredient-button {
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}
.add-ingredient-button:hover {
    background: var(--accent-blue)
}
.selected-ingredients {
    min-height: 60px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    background: white;
}
.ingredients-placeholder {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}
.ingredient-selected-container{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
}
.ingredient-item {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-secundary);
    border-radius: var(--border-radius);
    background: var(--bg-tertiary);
}
.ingredient-item .round-button {
    width: 2rem;
    height: 2rem;
}
.ingredient-info {
    flex: 1;
}
.ingredient-name {
    font-weight: bold;
    color: var(--text-primary);
}
.ingredient-amount {
    color: var(--text-secondary);
    font-size: 0.9em;
}
.recipeForm-form .remove-ingredient {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
/*
    Images upload - FilePond styling
 */
.images-container {
    border: 1px solid var(--border-secundary);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.images-placeholder {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

.unified-images-grid {
    margin-top: 1rem;
}

/* FilePond custom styling to match dark theme */
.filepond--root {
    margin-bottom: 0;
}

.filepond--drop-label {
    background-color: var(--bg-tertiary);
    border: 2px dashed var(--border-secundary);
    border-radius: var(--border-radius);
    color: var(--text-primary);
}

.filepond--drop-label label {
    cursor: pointer;
}

.filepond--label-action {
    color: var(--accent);
    text-decoration: underline;
}

.filepond--panel-root {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-secundary);
}

.filepond--drip-blob {
    background-color: var(--accent);
}

.filepond--item-panel {
    background-color: var(--bg-secondary);
}

.filepond--file-action-button {
    cursor: pointer;
}

/* Image preview grid */
.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.image-preview-item {
    position: relative;
    border: 1px solid var(--border-secundary);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-secondary);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.image-preview-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Selected thumbnail styling */
.image-preview-item.selected-thumbnail {
    border: 3px solid #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.image-preview-item.selected-thumbnail:hover {
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.7);
}

/* Thumbnail badge */
.thumbnail-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 2rem;
    height: 2rem;
    background: #FFD700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.thumbnail-badge svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: #000;
}

.image-preview-item[data-type="existing"] {
    border-color: var(--accent);
}

.image-preview-item[data-type="new"] {
    border-color: #28a745;
}

.image-preview-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.image-info {
    padding: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    background: var(--bg-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.image-preview-item[data-type="existing"] .image-info {
    color: var(--accent);
}

.image-preview-item[data-type="new"] .image-info {
    color: #28a745;
}

.image-preview-item .round-button {
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
}
