.post-image img {
    width: 100%;
    max-width: 450px;
    height: auto;
    margin-top: 10px;
}
.d-flex {
    display: flex; /* Habilita Flexbox */
    justify-content: space-between; /* Espacio entre los elementos */
    align-items: center; /* Alineación vertical */
}
.btn-heart {
    background-color: rgb(39, 213, 135);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 15px;
    cursor: pointer;
}
.icon-heart {
    font-size: 15px; /* Tamaño del icono de corazón */
}
.icon-edit, .icon-share, .icon-warning-sign, .icon-trash {
    font-size: 15px; /* Tamaño de los iconos de acción */
}
.pp {
    border-radius: 50%;
    height: 70px;
    width: 70px;
    margin-top: 5px;
}
.post-container {
    margin-top: 15px;
    width: 100%;
    position: relative;
    border-collapse: separate;
    display: table;
    border-radius: 10px;
    padding: 10px;
    background-color: #fff
}
textarea {
    border: 2px solid;
    border-radius: 10px;
    height: 80px;
    margin-top: 15px;
    width: 100%;
    resize: none;
}
#masthead p {
    text-align: left;
    margin-top: 10px;
}
/* Oculta el input real del botón de archivo */
.upload-btn input[type="file"] {
    display: none; 
}
/* Botones uniformes */
.upload-btn, .post-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 10px; 
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 23%;
    font-size: 14px; 
    margin: 0px;
    text-align: center;
    min-height: 30px; 
}
/* Colores específicos */
.upload-btn {
    background-color: #007bff; /* Azul */
}

.upload-btn:hover {
    background-color: #0056b3; /* Azul más oscuro */
}

.post-btn {
    background-color: #5cb85c; /* Verde */
}

.post-btn:hover {
    background-color: #4cae4c; /* Verde más oscuro */
}

/* Iconos */
.upload-btn i, .post-btn i {
    margin-right: 5px;
    font-size: 14px; 
}
/* Fila de botones */
.button-row {
    display: flex;
    justify-content: center; /* CENTRA los botones horizontalmente */
    align-items: center;
    width: 100%;
    margin-top: 10px;
    gap: 10px; /* Espaciado entre botones */
    flex-wrap: wrap; /* Evita que se salgan si hay muchos */
}
/* Contenedor de imágenes seleccionadas */
.preview-container {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(17, 163, 156, 0.16);
    border-radius: 22px;
    background: rgba(248, 251, 253, 0.92);
}

.preview-container.has-previews {
    display: grid;
}

.preview-summary {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 2px 8px;
    color: #14222f;
}

.preview-summary span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 900;
}

.preview-summary i {
    color: #11a39c;
}

.preview-summary small {
    color: #64748b;
    font-size: 12px;
}

.preview-container .preview-item {
    position: relative;
    display: grid;
    grid-template-rows: 150px auto;
    overflow: hidden;
    min-width: 0;
    border: 1px solid rgba(17, 163, 156, 0.14);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(7, 20, 36, 0.09);
}

.preview-media {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(17, 163, 156, 0.12), rgba(99, 102, 241, 0.09));
}

.preview-container img,
.preview-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.preview-container video {
    background: #071424;
}

.preview-meta {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 10px 12px 12px;
    text-align: left;
}

.preview-meta strong {
    color: #14222f;
    font-size: 13px;
    font-weight: 900;
}

.preview-meta span {
    overflow: hidden;
    color: #64748b;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-meta small {
    color: #11a39c;
    font-size: 12px;
    font-weight: 800;
}

.preview-container .delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(217, 77, 93, 0.96);
    color: white;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(7, 20, 36, 0.24);
    transition:
        transform 0.2s ease,
        background 0.2s ease;
}

.preview-container .delete-btn:hover {
    transform: scale(1.04);
    background: #c83247;
}

.gallery-preview-wrap {
    display: none;
    justify-content: center;
    margin: 14px auto 4px;
}

.gallery-preview-wrap.is-visible {
    display: flex;
}

.gallery-preview-card {
    position: relative;
    width: min(100%, 360px);
    overflow: hidden;
    border: 1px solid rgba(17, 163, 156, 0.16);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 16px 34px rgba(7, 20, 36, 0.12);
}

.gallery-preview-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #f8fbfd;
}

.gallery-preview-label {
    position: absolute;
    left: 12px;
    bottom: 12px;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(7, 20, 36, 0.72);
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
}

#removeImageButton {
    position: absolute;
    top: 10px;
    right: 10px;
    display: none;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #d94d5d, #ef6b55);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(217, 77, 93, 0.28);
}

body.dark-mode .preview-container,
body.dark-mode .preview-container .preview-item,
body.dark-mode .gallery-preview-card {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(20, 27, 34, 0.94);
}

body.dark-mode .preview-summary,
body.dark-mode .preview-meta strong {
    color: #eef6f7;
}

body.dark-mode .preview-summary small,
body.dark-mode .preview-meta span {
    color: #aebbc7;
}

@media (max-width: 640px) {
    .preview-container {
        grid-template-columns: 1fr;
        padding: 12px;
        border-radius: 18px;
    }

    .preview-summary {
        display: grid;
    }

    .preview-container .preview-item {
        grid-template-rows: 190px auto;
    }

    .gallery-preview-card {
        width: 100%;
        border-radius: 18px;
    }
}
