/* Estilos para la sección de stories */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #f2fff5;
}

.stories-section {
    padding: 10px;
    background-color: #000000;
    border-bottom: 1px solid #000000;
    margin-top: 15%;
    
}

.stories-container {
    display: flex;
    overflow-x: auto;
    gap: 15px;
}

.story-item {
    text-align: center;
    cursor: pointer;
}

.story-ring {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    padding: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.story-item.unread .story-ring {
    border: 2px solid #28a745;
}

.story-item.read .story-ring {
    border: 2px solid #ccc;
}

.story-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.story-username {
    font-size: 12px;
    color: #333;
}

/* Estilos para la lista de promociones */
.promotions-list {
    padding: 20px;
}

.promotion-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.promotion-card h2 {
    margin-top: 0;
    color: #333;
}

.promotion-card p {
    color: #666;
}

.btn-promo {
    display: inline-block;
    background-color: #007bff;
    color: #fff;
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 10px;
}

/* Estilos para el botón de descuento/inicio, proociones en index */
.discount-toggle-btn {
    background-color: #079e37; /* Color primario de Waygo */
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.3s;
}

.discount-toggle-btn:hover {
    background-color: #057d2b; /* Un verde más oscuro al pasar el mouse */
}

/* Estilos para el modal de publicación (Nuevo Diseño) */
.publish-modal-container {
    display: none;
    position: fixed;
    z-index: 1002; /* Aumentado para que esté sobre el header */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Un poco más oscuro */
    justify-content: center;
   
}

.publish-modal-content {
    background-color: #f7f7f7;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    animation: fade-in 0.3s ease-out;
    
}

.publish-modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
}

.publish-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.publish-modal-header .close-modal-btn {
    position: absolute;
    left: 0px;
}

.close-modal-btn {
    order: -1; /* Mueve el botón de cerrar a la izquierda */
    background: #e4e6eb;
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    font-size: 1.2em;
    cursor: pointer;
    color: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-left: 20px;
}

.publish-modal-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    
}

.publish-modal-body textarea {
    width: 100%;
    height: 80px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    font-size: 16px;
    resize: none;
    background-color: #fff;
    box-sizing: border-box;
}

.publish-business-name-input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    font-size: 16px;
    background-color: #fff;
    box-sizing: border-box;
}

.publish-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.publish-option-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid #ccc;
    background-color: #fff;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s;
}

.publish-option-btn:hover {
    background-color: #f2f2f2;
}

.publish-option-btn.selected {
    border-color: #079e37; /* Verde principal */
    color: #079e37;
    background-color: #e6f7eb; /* Verde muy claro */
}

.publish-option-btn i {
    font-size: 1.1em;
}

.publish-modal-footer {
    padding: 0;
    border-top: none;
}

.publish-submit-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background-color: #079e37; /* Verde principal */
    color: white;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.publish-submit-btn:hover {
    background-color: #057d2b; /* Verde más oscuro */
}

.publish-submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Media Queries para Mobile --- */
@media (max-width: 480px) {
    .publish-modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
        justify-content: flex-start;
    }

    .publish-options {
        grid-template-columns: 1fr 1fr;
        display: grid;
    }

    .post-header {
        padding: 10px 8px;
        gap: 8px;
    }

    .post-options-btn {
        padding: 8px;
    }
}

/* --- Estilos para el Feed de Publicaciones --- */
#feed-publicaciones {
    padding: 80px 0px 0px;
    background-color: #f2fff5; /* Fondo blanco para el feed */
    max-width: 650px; /* Ancho máximo para el feed */
    margin: 0 auto; /* Centrar el feed */
}

/* Ocultar la cabecera cuando un modal está abierto */
body.modal-open .main-header {
    display: none;
}

.post-card {
    background-color: #fff;
    border: none;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 16px;
}
/*foto de perfil de posts, promociones*/
.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 0 12px;
}

.post-author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.post-author-info {
    flex-grow: 1; /* Allows this element to take up available space */
    min-width: 0; /*  VERY IMPORTANT: Allows flex items to shrink below their content size */
    display: flex;
    flex-direction: column;
}

.post-author-name {
    font-weight: 700;
    color: #050505;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* nombre del negocio padding */
.post-business-name {
    font-family: 'Lato', sans-serif;
    font-size: 0.9em;
    font-weight: 300;
    color: #000000;
    
}

/* tiempo de publicación, hora del post */

/* Contenedor principal de la fecha y privacidad */
.post-meta {
  display: flex;
  align-items: center;
  gap: 5px;               /* Distancia exacta entre elementos */
  color: #65676b;         /* El gris estándar de redes sociales */
  font-size: 13px;        /* Tamaño compacto de letra */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin-top: 2px;
}

/* Estilo del punto intermedio */
.post-separator {
  font-size: 11px;
  line-height: 1;
  color: #8a8d91;
}

/* Alineación e integración del icono del planeta */
.post-privacy {
  display: inline-flex;
  align-items: center;
  color: #00000064;         /* Tono sutil para el icono */
}

.post-privacy svg {
  display: block;
}











/*Cómo llegar texto de post*/
.post-location-link {
    display: inline-flex;
    align-items: center;
    gap: 4px; /* Add some space between icon and text */
    font-size: 0.7em;
    font-weight: 500;
    color: #000000; /* Verde principal */
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
  
   
}
/*como llegar boton  de post */

.post-location {
    background-color: #ffffff7c;
    border-radius:  20px;
    margin-left: 10px;
    border: 1px solid #049c079d;
    padding: 1px 1px;
    
}


.post-location-link:hover {
    text-decoration: underline;
}
/*como llegar icono, ubicacion*/
.location-icon {
    vertical-align: middle;
    margin-bottom: 2px;
    margin-left: 10px;
   
   margin-left: 10px;
}

.post-content {
    padding: 0 15px 15px 15px;
    color: #050505;
    white-space: pre-wrap; /* Para respetar saltos de línea y espacios */
}

.post-media img,
.post-media video {
    width: 100%;
    max-height: 40vh; /* Altura máxima para que no sea demasiado grande */
    object-fit: cover;
    display: block;
}

/* --- Estilos para el Grid de Múltiples Imágenes --- */
.post-media-grid {
    display: grid;
    gap: 4px;
    border-radius: 8px;
    overflow: hidden;
}

.post-media-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Para que la imagen llene el espacio sin deformarse */
}

.post-media-grid video {
    width: 100%;
    height: auto;
    object-fit: cover;
    background-color: #000;
}

/* 1 imagen: ocupa todo el espacio */
.post-media-grid[data-count="1"] {
    grid-template-columns: 1fr;
    
}

/* 2 imágenes: una al lado de la otra */
.post-media-grid[data-count="2"] {
    grid-template-columns: 1fr 1fr;
    aspect-ratio: 16 / 9; /* Mantiene una proporción panorámica */
}

/* 3 imágenes: una grande a la izquierda, dos pequeñas a la derecha */
.post-media-grid[data-count="3"] {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    aspect-ratio: 4 / 3;
}

.post-media-grid[data-count="3"] img:first-child {
    grid-row: span 2;
}

/* 4 imágenes: el grid 2x2 */
.post-media-grid[data-count="4"] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    aspect-ratio: 1 / 1; /* Cuadrado perfecto */
}
.post-options-menu {
    position: relative;
    margin-left: auto;
}

.post-options-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.4em;
    color: #65676b;
    padding: 8px;
}

.post-options-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #fff;
    border: 1px solid #dbdbdb;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 10;
    width: 120px; /* Ancho del menú */
}

.post-options-dropdown.show {
    display: block;
}

.delete-post-btn {
    display: block;
    width: 100%;
    padding: 10px 15px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.9em;
}

.delete-post-btn:hover {
    background-color: #f0f2f5;
}

.edit-post-btn {
    display: block;
    width: 100%;
    padding: 10px 15px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.9em;
    border-bottom: 1px solid #dbdbdb;
}

.edit-post-btn:hover {
    background-color: #f0f2f5;
}

.delete-post-btn {
    color: #e74c3c;
}

/* Estilos para el modal de edición de imágenes */
.current-image-item {
    position: relative;
    width: 100px;
    height: 100px;
}

.current-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.delete-media-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-remove-location {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1.2em;
    padding: 0 5px;
}

.new-preview-label {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #079e37;
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
}

.current-image-item.new-preview img {
    border: 2px dashed #079e37;
}

/* --- Estilos para la nueva barra de búsqueda en promociones (Header) --- */
.mobile-header-default {
    padding: 0 15px;
}

.promo-search-container {
    flex-grow: 1;
    position: relative;
    margin: 0 15px;
}

#promo-search-input {
    width: 100%;
    padding: 10px 15px 10px 40px; /* Padding for icon */
    border-radius: 20px;
    border: 1px solid #ddd;
    background-color: #f1f1f1;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

#promo-search-input:focus {
    border-color: #079e37;
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(7, 158, 55, 0.2);
}

.promo-search-container .fa-search {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

/* --- Estilos para la barra de búsqueda en Desktop --- */

@media (min-width: 1024px) {
    #feed-publicaciones {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
        max-width: 100%;
        padding: 80px 20px 0;
    }

    .post-card {
        margin-bottom: 0; /* Remove default margin as gap is used */
    }
}

.promo-search-container-desktop {
    flex-grow: 1;
    max-width: 400px;
    position: relative;
    margin: 0 20px;
}

#promo-search-input-desktop {
    width: 100%;
    padding: 10px 15px 10px 40px; /* Padding for icon */
    border-radius: 20px;
    border: 1px solid #ddd;
    background-color: #f1f1f1;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

#promo-search-input-desktop:focus {
    border-color: #079e37;
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(7, 158, 55, 0.2);
}

.promo-search-container-desktop .fa-search {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

/* --- Estilos para el visor de medios --- */
.media-viewer-modal {
    display: none;    position: fixed;
    z-index: 1002;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0,0,0,0.95);
    justify-content: center;
    align-items: center;
}

.media-viewer-content {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.media-viewer-content img,
.media-viewer-content video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.close-media-viewer {
    position: absolute;
    top: 20px;
    right: 45px;
    color: #fff;
    font-size: 50px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1002;
}

.visibility-options {
    display: flex;
    gap: 10px;
    align-items: center;
}

#visibility-duration {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

#visibility-unit {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
}

/* --- Estilos para el Panel de Votación --- */
.voting-panel {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 15px 0;
    border-top: 1px solid #efefef;
    margin-top: 15px;
}

.vote-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px; /* Espacio entre botón, barra y porcentaje */
}

.vote-btn {
    border: none;
    border-radius: 15px;
    padding: 6px 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8em;
    transition: all 0.2s;
    white-space: nowrap; /* Evita el salto de línea */
    width: 100%; /* Ocupa el ancho disponible */
}

.vote-btn.gran-precio {
    background-color: #e6f7eb;
    color: #079e37;
}

.vote-btn.buen-plan {
    background-color: #e7f3ff;
    color: #007bff;
}

.vote-btn.joyita {
    background-color: #ffd900c1; /* Un amarillo dorado sólido */
    color: #000000;
}

.vote-btn:hover {
    opacity: 0.8;
}

.vote-progress-bar {
    width: 100%;
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.vote-progress-bar .progress {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease-in-out;
}

.vote-option[data-vote-type="gran_precio"] .progress {
    background-color: #079e37;
}

.vote-option[data-vote-type="buen_plan"] .progress {
    background-color: #007bff;
}

.vote-option[data-vote-type="joyita"] .progress {
    background-color: #f6cd18;
}

.vote-percentage {
    font-weight: bold;
    font-size: 0.9em;
    color: #333;
}

/* Estilos para la Votación Interactiva --- */

/* Contenedor del panel de votación cuando el usuario ha votado */
.voting-panel.user-voted .vote-option:not(.voted) {
    opacity: 0.6; /* Atenúa las opciones no votadas */
    pointer-events: none; /* Desactiva clics en las no votadas */
}

/* Estilo base para el botón votado */
.vote-option.voted .vote-btn {
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* Colores específicos para cada opción votada */
.vote-option.voted .vote-btn.gran-precio {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
}

.vote-option.voted .vote-btn.buen-plan {
    background-color: #dbeafe !important;
    color: #1e40af !important;
}

.vote-option.voted .vote-btn.joyita {
    background-color: #ffda06ad !important; /* Mantenemos el mismo amarillo */
    color: #000000 !important;
}

/* Estilo para el ícono de check (✓) */
.check-mark {
    font-size: 1.1em;
    line-height: 1;
}

/* Deshabilitar todos los botones una vez que se ha votado */
.voting-panel.user-voted .vote-btn {
    cursor: not-allowed;
}

/* Animación de vibración para cuando se intenta votar de nuevo */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake-animation {
    animation: shake 0.5s ease-in-out;
}

/* --- Animación de carga de voto --- */
@keyframes fill-up {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

.vote-option.is-voting .progress {
    animation: fill-up 0.8s ease-out forwards;
}

/* Ocultar el checkmark por defecto */
.check-mark {
    display: none;
    font-size: 1.1em;
    line-height: 1;
}

/* Mostrar el checkmark cuando la votación ha terminado */
.vote-option.voted .check-mark {
    display: inline;
}

/* --- Estilos para el Modal de Confirmación --- */
.modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 90%;
    width: 320px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-content p {
    margin: 0 0 20px;
    font-size: 1.1em;
    color: #333;
}

.modal-btn {
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    margin: 0 10px;
    transition: background-color 0.2s;
}

.modal-btn.confirm {
    background-color: #e74c3c;
    color: white;
}

.modal-btn.confirm:hover {
    background-color: #c0392b;
}

.modal-btn.cancel {
    background-color: #e0e0e0;
    color: #333;
}

.modal-btn.cancel:hover {
    background-color: #c7c7c7;
}
.video-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    width: 100%;
}

.video-container .play-button {
    position: absolute;
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    transition: background-color 0.3s;
}

.video-container:hover .play-button {
    background-color: rgba(0, 0, 0, 0.8);
}

.video-container .play-button::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 15px 0 15px 26px;
    border-color: transparent transparent transparent white;
    margin-left: 5px;
}