/* ===================================
   SUBMIT RECIPE PAGE STYLES
   ReceitasTech - Página de Envio de Receitas
   =================================== */

.submit-recipe-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 80px 20px 40px;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.page-header p {
    font-size: 1.1rem;
    color: var(--text-light);
}

/* ===================================
   FORMULÁRIO
   =================================== */

.recipe-form {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 30px;
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--bg-light);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===================================
   CAMPOS DO FORMULÁRIO
   =================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: #fff;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ===================================
   FORM ROW (campos lado a lado)
   =================================== */

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* ===================================
   INGREDIENTES, PASSOS E DICAS
   =================================== */

.ingredient-item,
.step-item,
.tip-item {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: flex-start;
}

/* ===================================
   PREVIEW DE IMAGEM
   =================================== */

.image-preview {
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: block;
}

.image-preview .image-info {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

.form-group input[type="file"] {
    padding: 10px;
    cursor: pointer;
}

.form-group input[type="file"]::file-selector-button {
    padding: 10px 20px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin-right: 15px;
    transition: all 0.3s ease;
}

.form-group input[type="file"]::file-selector-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* ===================================
   INGREDIENTES, PASSOS E DICAS
   =================================== */

.ingredient-item input,
.tip-item textarea {
    flex: 1;
}

.step-item {
    position: relative;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 8px;
}

.step-item textarea {
    flex: 1;
}

.btn-remove {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 8px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.btn-remove:hover {
    transform: scale(1.2);
}

/* ===================================
   BOTÕES DE ADICIONAR
   =================================== */

.btn-add {
    background: var(--bg-light);
    border: 2px dashed var(--primary-color);
    color: var(--primary-color);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
}

.btn-add:hover {
    background: var(--primary-color);
    color: white;
    border-style: solid;
}

/* ===================================
   AÇÕES DO FORMULÁRIO
   =================================== */

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--bg-light);
}

.btn-primary,
.btn-secondary {
    padding: 15px 40px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-dark);
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    border-color: var(--text-dark);
    background: var(--bg-light);
}

/* ===================================
   MODAL DE SUCESSO
   =================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.modal-content p {
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
    padding: 12px 30px;
}

/* ===================================
   ESTADOS DE VALIDAÇÃO
   =================================== */

.form-group input.error,
.form-group textarea.error,
.form-group select.error {
    border-color: #dc3545;
}

.form-group .error-message {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
}

/* ===================================
   RESPONSIVIDADE
   =================================== */

@media (max-width: 768px) {
    .submit-recipe-container {
        padding: 60px 15px 30px;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header p {
        font-size: 1rem;
    }

    .recipe-form {
        padding: 20px;
    }

    .form-section h2 {
        font-size: 1.3rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .modal-content {
        padding: 30px 20px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn-primary,
    .modal-actions .btn-secondary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .step-item {
        flex-direction: column;
    }

    .step-number {
        align-self: flex-start;
    }

    .ingredient-item,
    .tip-item {
        flex-direction: column;
    }

    .btn-remove {
        align-self: flex-end;
    }
}
