/* Activites autour (Premium): cartoes das atividades perto das do dia */

.nearby-content {
    border: 0;
    border-radius: 28px;
    background: linear-gradient(180deg, #F6F7FB 0%, #FFFFFF 100%);
    padding: 18px 18px 22px;
    overflow: hidden;
}

.nearby-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nearby-day {
    font-size: 22px;
    font-weight: 700;
    color: #1D1D1F;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nearby-city {
    font-size: 15px;
    color: #1D1D1F;
    display: flex;
    align-items: center;
    gap: 4px;
    padding-left: 14px;
    border-left: 2px solid #D9D9DE;
    min-width: 0;
}

.nearby-city span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nearby-close {
    margin-left: auto;
    border: 0;
    background: none;
    padding: 0;
    font-size: 26px;
    color: #1D1D1F;
}

.nearby-pill {
    margin: 12px auto 0;
    width: fit-content;
    background: #ECEBFB;
    color: #5146D8;
    font-weight: 600;
    font-size: 14px;
    border-radius: 20px;
    padding: 6px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nearby-pill:empty, .nearby-pill.d-none {
    display: none;
}

.nearby-stack {
    position: relative;
    height: 470px;
    margin: 16px 6px 0;
}

.nearby-card {
    position: absolute;
    inset: 0;
    background: white;
    border-radius: 26px;
    box-shadow: 0 10px 30px rgba(20, 20, 40, 0.14);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    will-change: transform, opacity;
    backface-visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.35s ease;
    cursor: grab;
}

/* Saindo da tela: continua do ponto onde o dedo soltou (tempo = NEARBY_FLY_MS do JS) */
.nearby-card.flying {
    transition: transform 0.42s cubic-bezier(0.3, 0.5, 0.4, 1), opacity 0.42s ease-in;
    pointer-events: none;
    z-index: 5;
}

.nearby-card.dragging {
    transition: none;
    cursor: grabbing;
}

/* Os de tras aparecem inclinados, como no baralho; o 3 e o que esta entrando (escondido) */
.nearby-card[data-depth="0"] { z-index: 4; }
.nearby-card[data-depth="1"] { z-index: 3; transform: translate3d(26px, 0, 0) rotate(4deg) scale(0.95); }
.nearby-card[data-depth="2"] { z-index: 2; transform: translate3d(-26px, 0, 0) rotate(-4deg) scale(0.92); }
.nearby-card[data-depth="3"] { z-index: 1; transform: scale(0.88); opacity: 0; }

.nearby-photo {
    position: relative;
    flex: 0 0 58%;
    background: #E9E9EE center / cover no-repeat;
}

.nearby-photo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 54px;
    color: #C5C5CF;
}

.nearby-badge {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    color: #1D1D1F;
    font-size: 13px;
    font-weight: 600;
    border-radius: 14px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nearby-badge-distance { top: 14px; left: 14px; }
.nearby-badge-photos { bottom: 14px; right: 14px; background: rgba(29, 29, 31, 0.6); color: white; }

/* Carimbo que aparece ao arrastar */
.nearby-stamp {
    position: absolute;
    top: 22px;
    font-size: 22px;
    font-weight: 800;
    border: 3px solid;
    border-radius: 10px;
    padding: 2px 10px;
    opacity: 0;
    text-transform: uppercase;
}

.nearby-stamp-add { right: 18px; color: #1E8A5F; transform: rotate(12deg); }
.nearby-stamp-skip { left: 18px; color: #E0475B; transform: rotate(-12deg); }

.nearby-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}

.nearby-name {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.15;
    color: #1D1D1F;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nearby-category {
    font-size: 14px;
    color: #55555C;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nearby-description {
    font-size: 14px;
    color: #3A3A40;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nearby-rating {
    font-size: 14px;
    font-weight: 600;
    color: #1D1D1F;
}

.nearby-rating i { color: #F5B301; margin-right: 4px; }

.nearby-message {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    color: #55555C;
    font-size: 16px;
    padding: 0 30px;
}

.nearby-message i { font-size: 40px; color: #5146D8; }

.nearby-btn-close {
    margin-top: 8px;
    border: 0;
    background: #5146D8;
    color: white;
    font-weight: 600;
    font-size: 15px;
    border-radius: 24px;
    padding: 10px 36px;
}

.nearby-btn-close:hover { background: #4239C4; }

.nearby-actions.d-none { display: none !important; }

.nearby-actions {
    display: flex;
    justify-content: center;
    gap: 44px;
    margin-top: -30px;
    position: relative;
    z-index: 5;
}

.nearby-btn {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 0;
    background: white;
    box-shadow: 0 6px 18px rgba(20, 20, 40, 0.16);
    font-size: 30px;
    transition: transform 0.15s ease;
}

.nearby-btn:active { transform: scale(0.92); }
.nearby-btn:disabled { opacity: 0.4; }
.nearby-btn-skip { color: #E0475B; }
.nearby-btn-add { color: #1E8A5F; background: #E4F5EC; }

.nearby-toast {
    position: absolute;
    left: 50%;
    bottom: 110px;
    transform: translateX(-50%) translateY(10px);
    background: #1D1D1F;
    color: white;
    font-size: 14px;
    border-radius: 18px;
    padding: 8px 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 10;
    white-space: nowrap;
}

.nearby-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 575px) {
    /* Tela cheia: o baralho ocupa o que sobrar entre o cabecalho e os botoes (no app iOS o
       modal-iphone ainda soma 44px no topo, como nas outras janelas) */
    .nearby-content { border-radius: 0; padding: 16px 16px 24px; display: flex; flex-direction: column; }
    /* Os 44px do topo no iOS (iphone.js pinta de branco, inline) ficam do cinza do topo do modal */
    #modalNearby { background-color: #F6F7FB !important; }
    .nearby-stack { flex: 1 1 auto; height: auto; min-height: 0; max-height: 560px; }
}

/* Toque no cartao abre o detalhe da atividade */
.nearby-badge-more { bottom: 14px; right: 14px; font-size: 12px; }
.nearby-badge-more i { font-size: 10px; }

/* Detalhe aberto de um cartao: ele e o fundo escuro dele por cima dos cartoes (nearby-activities.js) */
#modalActivityDetail.modal-over-nearby { z-index: 1065; }
.modal-backdrop.modal-backdrop-over-nearby { z-index: 1062; }

/* Adicionada ao dia: selo verde no meio (nearby-activities.js, NearbyAdded) */
.nearby-added {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
}

.nearby-added.show {
    visibility: visible;
    animation: nearby-added-fade 1.5s ease forwards;
}

/* Brilho verde atras do selo */
.nearby-added::before {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(34, 160, 107, 0.28) 0%, rgba(34, 160, 107, 0) 70%);
}

.nearby-added-badge {
    position: relative;
    width: 96px;
    height: 96px;
}

.nearby-added-badge svg {
    position: relative;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 22px rgba(34, 160, 107, 0.45));
}

.nearby-added-badge circle { fill: #22A06B; }

.nearby-added-badge path {
    fill: none;
    stroke: white;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
}

.nearby-added-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 9px;
    height: 9px;
    margin: -4.5px 0 0 -4.5px;
    border-radius: 50%;
    background: #22A06B;
    opacity: 0;
}

.nearby-added-dot:nth-child(3n+2) { background: #7BD3A3; width: 7px; height: 7px; }
.nearby-added-dot:nth-child(3n) { background: #0F7A4F; width: 6px; height: 6px; border-radius: 2px; }

.nearby-added-text {
    position: relative;
    background: #22A06B;
    color: white;
    font-weight: 700;
    font-size: 15px;
    padding: 9px 20px;
    border-radius: 22px;
    box-shadow: 0 10px 24px rgba(34, 160, 107, 0.35);
}

.nearby-added-name {
    position: relative;
    max-width: 80%;
    text-align: center;
    background: rgba(255, 255, 255, 0.96);
    color: #0F7A4F;
    font-weight: 600;
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nearby-added.show .nearby-added-badge { animation: nearby-added-pop 0.55s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.nearby-added.show .nearby-added-badge path { animation: nearby-added-check 0.35s ease-out 0.25s forwards; }
.nearby-added.show .nearby-added-dot { animation: nearby-added-burst 0.75s ease-out 0.12s both; }
.nearby-added.show .nearby-added-text { animation: nearby-added-rise 0.4s ease-out 0.15s both; }
.nearby-added.show .nearby-added-name { animation: nearby-added-rise 0.4s ease-out 0.25s both; }

@keyframes nearby-added-fade {
    0% { opacity: 0; }
    8% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes nearby-added-pop {
    0% { transform: scale(0.3); }
    100% { transform: scale(1); }
}

@keyframes nearby-added-check {
    to { stroke-dashoffset: 0; }
}

@keyframes nearby-added-burst {
    0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(0.3); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: rotate(var(--a)) translateY(-80px) scale(1); }
}

@keyframes nearby-added-rise {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .nearby-added.show .nearby-added-badge,
    .nearby-added.show .nearby-added-dot,
    .nearby-added.show .nearby-added-text,
    .nearby-added.show .nearby-added-name { animation: none; }
    .nearby-added-badge path { stroke-dashoffset: 0; }
    .nearby-added.show .nearby-added-badge path { animation: none; }
}
