/* ==========================================================
   EVENT CARD
   ========================================================== */

.modal-card {
    width: 100%;
    max-width: min(100%, 680px);
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);

    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;

    background: var(--surface);
    border-radius: 28px;

    box-shadow: var(--shadow);

    position: relative;

    border: 1px solid var(--border);

    animation: popup .25s ease;

    padding: 0;
}

.event-card {
    display: flex;
    flex-direction: column;
}

.event-cover {
    position: relative;
    margin: 0;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
}

.event-cover img {
    width: 100%;
    height: clamp(148px, 28vw, 230px);
    object-fit: cover;
    display: block;
    object-position: center 62%;
}

.event-cover.category-standup img,
.event-cover.category-concert img,
.event-cover.category-picnic img,
.event-cover.category-nature img,
.event-cover.category-party img,
.event-cover.category-excursion img,
.event-cover.category-quest img,
.event-cover.category-masterclass img,
.event-cover.category-shelter img { object-position: center; }

.event-cover::after { content: ""; position: absolute; z-index: 1; right: 0; bottom: 0; left: 0; height: 28px; pointer-events: none; background: linear-gradient(to bottom, transparent, var(--surface)); }

.event-cover-overlay {
    position: absolute;
    inset: 0;

    display: flex;
    flex-direction: column;

    justify-content: flex-end;
    /* вместо space-between */

    padding: 16px;
}

.event-cover-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.event-cover-bottom {
    margin-top: auto;

    display: flex;
    align-items: flex-end;
}

.event-cover-title {
    display: flex;
    align-items: center;
    gap: 10px;

    width: 100%;
    max-width: none;
    min-width: 0;

    color: #fff;

    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
}

.event-cover-title span {
    flex: 1;
}

.event-cover-icon {
    width: 22px;
    height: 22px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;
}

.event-cover-name {
    flex: 1;
    min-width: 0;

    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;

    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    text-shadow: 0 4px 14px rgba(0, 0, 0, .65);
}

.event-cover-date {
    color: #fff;
    font-size: 14px;
    font-weight: 600;

    text-shadow: 0 2px 8px rgba(0, 0, 0, .7);
}

.modal-close-image {

    width: 42px;
    height: 42px;

    border: none;
    border-radius: 12px;

    background: rgba(20, 20, 25, .55);

    color: #fff;

    cursor: pointer;

    backdrop-filter: blur(10px);
}

.favorite-btn {
    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;

    background: var(--surface-2);
    border: 1px solid var(--border);

    color: #fff;
    font-size: 22px;

    cursor: pointer;

    transition: .2s;
}

.favorite-btn:hover {
    background: var(--surface-3);
}

.favorite-btn.is-favorite {
    background: rgba(214, 64, 69, .24);
    border-color: rgba(255, 116, 124, .55);
    color: #ff747c;
}

.favorite-btn.is-favorite svg {
    fill: currentColor;
}

.event-actions-top {
    display: flex;
    justify-content: flex-end;
    margin: -8px 0 -6px;
}

.event-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);

    padding: 12px clamp(18px, 5vw, 32px) max(28px, env(safe-area-inset-bottom));
}

.event-meta {
    position: relative;

    display: flex;
    flex-direction: column;
    gap: 10px;
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 16px;

    color: var(--text-secondary);
}

.meta-row svg {
    width: 22px;
    height: 22px;

    flex-shrink: 0;
}

.info-box {

    width: 100%;

    padding: 18px;

    border-radius: 16px;

    background: var(--surface-2);

    box-sizing: border-box;

}

.info-title {

    font-size: 18px;

    margin: -2px 0 10px;

    font-weight: 700;

}

.event-card-description {

    margin: 0;

    font-size: 16px;

    line-height: 1.8;

    color: var(--text-secondary);
    white-space: pre-wrap;
    overflow-wrap: anywhere;

}

.event-card-description {

    margin: 0;

    line-height: 1.7;

    color: var(--text-secondary);
}

.event-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 0;
}

.event-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 10px;

    width: 100%;
}

.event-actions button {
    display: flex;
    justify-content: center;
    align-items: center;

    width: 100%;
    height: 46px;

    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;

    background: var(--surface-2);
    color: var(--text);

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;
    transition: .2s;
}

.event-actions button:hover {
    background: rgba(255, 175, 119, .14);
}

@media (max-width: 380px) {
    .event-content {
        gap: 12px;
        padding-inline: 18px;
    }

    .event-cover-actions {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .event-cover-actions button,
    .favorite-btn {
        width: 40px;
        height: 40px;
    }
}

@media (min-width: 600px) {
    .event-cover-title,
    .event-cover-name {
        font-size: 22px;
    }

    .event-cover-date {
        font-size: 16px;
    }

    .event-content {
        gap: 20px;
        padding-inline: clamp(24px, 4vw, 36px);
    }

    .meta-row {
        gap: 12px;
        font-size: 18px;
    }

    .meta-row svg {
        width: 25px;
        height: 25px;
    }

    .info-box {
        padding: 22px;
    }

    .info-title {
        font-size: 21px;
    }

    .event-card-description {
        font-size: 18px;
    }

    .event-actions button,
    .delete-btn-full {
        height: 52px;
        font-size: 17px;
    }
}

.admin-event-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.delete-btn-full {
    margin: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    width: 100%;
    height: 46px;

    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;

    background: #d64045;
    color: #fff;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;
    transition: .2s;
}

.delete-btn-full:hover {
    filter: brightness(.95);
}

.event-meta-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.event-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.event-back {
    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;

    background: var(--surface-2);
    border: 1px solid var(--border);

    color: #fff;
    font-size: 22px;

    cursor: pointer;

    transition: .2s;
}

.event-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.event-back:hover {
    background: var(--surface-3);
}

.event-cover-actions {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;

    display: flex;
    justify-content: space-between;

    z-index: 5;
}

.event-cover-secondary-actions {
    display: flex;
    gap: 8px;
}

.event-cover-actions button {
    width: 44px;
    height: 44px;

    border: none;
    border-radius: 14px;

    background: rgba(15, 18, 28, .45);
    backdrop-filter: blur(12px);

    color: #fff;
    font-size: 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    border: 1px solid rgba(255, 255, 255, .12);

    transition: .2s;
}

.event-cover-actions svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.2;
}

.favorite-btn svg {
    width: 20px;
    height: 20px;
}

.share-toast {
    position: fixed;
    z-index: 1000;
    top: 50%;
    left: 50%;
    max-width: calc(100% - 32px);
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
    box-shadow: var(--shadow);
    color: var(--text);
    font-size: 14px;
    opacity: 0;
    pointer-events: auto;
    transform: translate(-50%, calc(-50% + 8px));
    transition: opacity .2s ease, transform .2s ease;
}

.share-toast.is-visible { opacity: 1; transform: translate(-50%, -50%); }

/* Detailed event card: participation and compact metadata. */
.event-card-title { display: flex; align-items: flex-start; gap: 10px; color: var(--text); }
.event-card-title h2 { margin: 0; font: 700 19px/1.3 "Manrope", sans-serif; }
.event-card-title .event-cover-icon { color: var(--text); }
.event-card-title + .event-meta { margin-top: -4px; }
.meta-row-location { align-items: flex-start; flex-wrap: wrap; }
.meta-row-location > span { min-width: 0; flex: 1 1 150px; }
.event-map-link { flex: 0 0 auto; padding: 0; border: 0; background: transparent; color: #67b8ff; font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; }
.event-location-button { min-width: 0; flex: 1 1 150px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.public-event-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.public-event-actions:has(:only-child) { grid-template-columns: 1fr; }
.public-event-actions a { min-width: 0; min-height: 46px; padding: 10px 8px; font-size: 14px; text-align: center; }
.attendance-block { width: 100%; }
.attendance-going, .attendance-cancel { display: flex; align-items: center; justify-content: center; min-height: 54px; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.attendance-going { width: 100%; gap: 10px; padding: 0 18px; text-align: left; }
.attendance-going strong { margin-left: auto; color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.attendance-going svg { width: 27px; height: 27px; }
.attendance-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.attendance-actions .attendance-going { color: #eaffef; background: rgba(92,161,63,.68); border-color: rgba(142,224,104,.65); }
.attendance-going:disabled, .attendance-cancel:disabled { cursor: wait; opacity: .72; }
.attendance-count, .attendance-final, .attendance-feedback, .attendance-loading { margin: 8px 0 0; text-align: center; color: var(--text-secondary); font-size: 14px; }
.attendance-final { margin-top: 0; }
.attendance-feedback { color: #8edfa7; margin-bottom: 0; }
.attendance-feedback.is-error { color: #ff9da5; }

.primary-button,
.secondary-button,
.edit-btn,
.duplicate-btn,
.delete-btn-full {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.primary-button svg,
.secondary-button svg,
.edit-btn svg,
.duplicate-btn svg,
.delete-btn-full svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
