/*Perfil.php */
body.perfil-page {
    font-family: "Poppins", sans-serif;
}

body.perfil-page nav a:hover {
    color: #e05b49;
}

.perfil-mini img {
    width: 40px;
    border-radius: 50%;
}

.perfil {
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 20px;
    margin-top: 120px;
}

.perfil-header {
    background: linear-gradient(135deg, #f47a6a, #e05b49);
    color: white;
    text-align: center;
    padding: 55px 280px;
    border-radius: 15px;
}

.perfil-foto {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 10px;
    object-fit: cover;
    border: 3px solid white;
}

.perfil-header h2 {
    font-size: 1.4em;
    margin-bottom: 5px;
}

.perfil-header p {
    font-size: 0.9em;
    margin-bottom: 15px;
}

.perfil-estadisticas {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.perfil-estadisticas div {
    text-align: center;
    font-size: 0.85em;
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 8px;
}

.tab {
    background: none;
    border: none;
    font-size: 0.95em;
    font-weight: 600;
    color: #777;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s, border-bottom 0.3s;
}

.tab:hover {
    color: #e05b49;
}

.tab.activa {
    color: #e05b49;
    border-bottom: 2px solid #e05b49;
}

.perfil + .recetas {
    margin-bottom: 40px;
}

.perfil + .recetas .contenido {
    margin-bottom: 30px;
}

.perfil + .recetas h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.perfil + .recetas p {
    color: #666;
    font-size: 0.9rem;
}

body.perfil-page .cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    justify-content: center;
    max-width: 960px;
    margin: 0 auto;
}

body.perfil-page .card {
    max-width: 500px;
    width: 100%;
    border-radius: 15px;
}

body.perfil-page .card-image {
    height: 150px;
}

body.perfil-page .card-content {
    padding: 15px;
}

body.perfil-page .card-rating {
    gap: 3px;
    margin-bottom: 8px;
}

body.perfil-page .star {
    font-size: 1rem;
}

body.perfil-page .rating-number {
    font-size: 0.8rem;
    margin-left: 4px;
}

body.perfil-page .card-title {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

body.perfil-page .card-author {
    font-size: 0.8rem;
    margin-bottom: 10px;
}

body.perfil-page .card-info {
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.8rem;
}

body.perfil-page .info-icon {
    width: 16px;
}

body.perfil-page .card-footer {
    gap: 8px;
    padding: 10px 15px;
    margin-top: 0px;
}

body.perfil-page .card-receta {
    display: flex;
    padding: 10px 15px;

}

body.perfil-page .btn-receta {
    padding: 8px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.btn_sesion {
    padding: 16px 24px;
    font-size: 14px;
    width: 180px;
    background-color: #190055;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    display: block;
    margin: 20px auto 120px;
}

.btn_sesion:hover {
    background-color: #0f0038;
}

.formulario-editar-perfil {
    max-width: none;
    width: 100%;
    margin: 2rem 0;
    background: white;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-radius: 1.5rem;
    padding: 3rem;
    border: 1px solid #f3f4f6;
    display: block;
    grid-column: 1 / -1;
    flex: 0 0 100%;
}

.formulario-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.formulario-icono {
    display: inline-block;
    padding: 1rem;
    background: #FFF5F2;
    border-radius: 9999px;
    margin-bottom: 1rem;
}

.formulario-icono svg {
    width: 2.5rem;
    height: 2.5rem;
    color: #e05b49;
    display: block;
}

.formulario-titulo {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.formulario-subtitulo {
    color: #6b7280;
    font-size: 1rem;
}

#formPerfil {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.formulario-campo {
    position: relative;
}

.formulario-label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

.formulario-label svg {
    width: 1.125rem;
    height: 1.125rem;
    color: #e05b49;
    flex-shrink: 0;
}

.formulario-input,
.formulario-textarea {
    width: 100%;
    border: 2px solid #e5e7eb;
    border-radius: 0.875rem;
    padding: 1rem 1.25rem;
    background: #f9fafb;
    transition: all 0.2s;
    font-size: 0.95rem;
    font-family: inherit;
    box-sizing: border-box;
}

.formulario-input:hover,
.formulario-textarea:hover {
    border-color: #d1d5db;
}

.formulario-input:focus,
.formulario-textarea:focus {
    outline: none;
    border-color: #e05b49;
    background: white;
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.1);
}

.formulario-file-wrapper {
    position: relative;
}

.formulario-file {
    width: 100%;
    color: #4b5563;
    border-radius: 0.875rem;
    border: 2px dashed #d1d5db;
    padding: 1.25rem;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    box-sizing: border-box;
    font-size: 0.95rem;
}

.formulario-file:hover {
    border-color: #e05b49;
    background: #f3f4f6;
}

.formulario-file::-webkit-file-upload-button {
    margin-right: 1.25rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.625rem;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    background: #eef2ff;
    color: #e05b49;
    cursor: pointer;
    transition: all 0.2s;
}

.formulario-file::-webkit-file-upload-button:hover {
    background: #e0e7ff;
}

.formulario-file::file-selector-button {
    margin-right: 1.25rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.625rem;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    background: #eef2ff;
    color: #e05b49;
    cursor: pointer;
    transition: all 0.2s;
}

.formulario-file::file-selector-button:hover {
    background: #e0e7ff;
}

.formulario-ayuda {
    font-size: 0.813rem;
    color: #6b7280;
    margin-top: 0.625rem;
    margin-left: 0.25rem;
}

.formulario-textarea {
    resize: none;
    min-height: 120px;
}

.formulario-contador {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.formulario-contador span {
    font-size: 0.813rem;
    color: #9ca3af;
}

.formulario-boton {
    width: 100%;
    background: linear-gradient(to right, #E8534F, #bd504c);
    color: white;
    font-weight: 700;
    padding: 1.125rem 1.75rem;
    border-radius: 0.875rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    margin-top: 1rem;
    font-size: 1.05rem;
    font-family: inherit;
}

.formulario-boton:hover {
    background: linear-gradient(to right, #d6312b, #a83e3a);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.formulario-boton:active {
    transform: translateY(0);
}

.formulario-boton svg {
    width: 1.375rem;
    height: 1.375rem;
    flex-shrink: 0;
}

@media (max-width: 968px) {
    .perfil {
        max-width: 90%;
        margin-top: 100px;
    }

    .perfil-header {
        padding: 40px 60px;
    }

    body.perfil-page .cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .perfil {
        max-width: 100%;
        margin-top: 80px;
        padding: 0 10px;
    }

    .perfil-header {
        padding: 30px 20px;
    }

    .perfil-foto {
        width: 60px;
        height: 60px;
    }

    .perfil-estadisticas {
        gap: 20px;
    }

    .tabs {
        gap: 15px;
        flex-wrap: wrap;
    }

    body.perfil-page .cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    body.perfil-page .card {
        max-width: 100%;
    }

    .btn_sesion {
        width: 90%;
        max-width: 300px;
    }

    .formulario-editar-perfil {
        padding: 1.5rem;
    }
}

@media (max-width: 600px) {
    .perfil {
        margin-top: 70px;
    }

    .perfil-header {
        padding: 25px 15px;
    }

    .perfil-foto {
        width: 55px;
        height: 55px;
    }

    .btn_sesion {
        width: 95%;
    }

}
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    max-width: 800px;
    margin: 40px auto;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.modal-overlay.show .modal-container {
    transform: translateY(0);
}

.modal-header {
    background: linear-gradient(135deg, #E8534F 0%, #df3a34 100%);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(158, 46, 46, 0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.modal-header-content {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 1;
}

.modal-icon {
    background: rgba(255, 255, 255, 0.2);
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-close svg {
    color: white;
}

.modal-form {
    padding: 35px 30px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-field {
    margin-bottom: 25px;
}

.form-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #6b3932;
    margin-bottom: 10px;
    font-size: 14px;
}

.input-modern,
.textarea-modern {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.input-modern:focus,
.textarea-modern:focus {
    outline: none;
    border-color: #E8534F;
    box-shadow: 0 0 0 4px rgba(234, 102, 102, 0.1);
    transform: translateY(-1px);
}

.input-readonly {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    cursor: not-allowed;
    color: #6b7280;
}

.textarea-modern {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.field-hint {
    display: block;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 6px;
    font-style: italic;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 2px solid #f3f4f6;
    margin-top: 30px;
}

.btn-primary{
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #e4453f 0%, #c9423d 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(194, 54, 38, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

@media (max-width: 640px) {
    .modal-container {
        margin: 0;
        border-radius: 0;
    }

    .modal-form {
        padding: 25px 20px;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .btn-primaryy{
        width: 100%;
        justify-content: center;
    }
}

.form-field[for="recetaCategoria"] {
    margin-bottom: 20px;
}

.checkbox-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columnas iguales */
    grid-auto-rows: 1fr; 
    gap: 12px;
    margin-top: 12px;
    align-items: stretch;
}

.form-field input[type="checkbox"] {
    display: none;
}

.form-field label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    color: #4b5563;
    gap: 8px;
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
    height: 100%;
    box-sizing: border-box;
    min-height: 45px;
}
#inputOtro {
    padding: 12px 15px;
    border-radius: 12px;
    border: none;
    background-color: #EDE3DF;
    font-size: 14px;
    color: #666;
    outline: none;
    transition: all 0.3s ease;
    width: auto;
    max-width: 200px;
    margin-left: 5px;
}

#inputOtro:focus {
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(232, 83, 79, 0.1);
}
.form-field label:has(input[type="checkbox"]):hover {
    border-color: #E8534F;
    background: #fff5f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(232, 83, 79, 0.15);
}

.form-field label:has(input[type="checkbox"]:checked) {
    background: linear-gradient(135deg, #E8534F 0%, #df3a34 100%);
    border-color: #E8534F;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(232, 83, 79, 0.3);
}

.form-field label:has(input[type="checkbox"])::before {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 5px;
    background: white;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.form-field label:has(input[type="checkbox"]:checked)::before {
    content: '✓';
    background: white;
    border-color: white;
    color: #E8534F;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.form-field label:has(input[type="checkbox"]):active {
    transform: scale(0.95);
}

@media (max-width: 640px) {
    .checkbox-container {
        grid-template-columns: 1fr;
    }
    
    .form-field label:has(input[type="checkbox"]) {
        padding: 10px 12px;
        font-size: 13px;
        min-height: 45px;
    }
}
