/* ============================================================
   modal.css — Modals
   Overlay, event/profile cards, action buttons, confirm code.
   ============================================================ */

/* === EVENT CARD === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 100;
}

.modal-overlay.hidden {
    display: none;
}

.modal-overlay.delete {
    z-index: 200;
}

.modal-overlay.success {
    z-index: 200;
}

.modal-overlay.error {
    z-index: 200;
}

.modal-card {
    border-radius: 12px;
    width: 90%;
    max-width: 520px;
    max-height: 70vh;

    padding: 1rem;
    position: relative;
    overflow-y: auto;

    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);

    /* Scroll shadow: hints that more content is available above/below.
       The white covers hide the shadow at the very top/bottom; the
       radial shadows stay pinned while content scrolls (background-attachment:
       local vs scroll), so they only show when there is more to reveal. */
    background-color: var(--primary-background);
    background-image:
        linear-gradient(var(--primary-background) 30%, rgba(255, 255, 255, 0)),
        linear-gradient(rgba(255, 255, 255, 0), var(--primary-background) 70%),
        radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0)),
        radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0));
    background-position: center top, center bottom, center top, center bottom;
    background-repeat: no-repeat;
    background-size: 100% 40px, 100% 40px, 100% 14px, 100% 14px;
    background-attachment: local, local, scroll, scroll;
}

.modal-card.event {
    padding: 0rem;

    /* Scroll shadow: hints that more content is available above/below.
       The white covers hide the shadow at the very top/bottom; the
       radial shadows stay pinned while content scrolls (background-attachment:
       local vs scroll), so they only show when there is more to reveal. */
    background-color: var(--primary-event-background);
    background-image:
        linear-gradient(var(--primary-event-background) 30%, rgba(255, 255, 255, 0)),
        linear-gradient(rgba(255, 255, 255, 0), var(--primary-event-background) 70%),
        radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0)),
        radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0));
}

.event-modal-header {
    display: flex;
    align-items: stretch;

    padding: 0;
    margin: 0;
}

.event-modal-title {
    display: flex;
    align-items: top;

    margin: 0;
    padding: 0.3rem 2.4rem 0.3rem 0.6rem;

    color: var(--primary-text);
    font-size: 0.8rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.modal-card.event .event-image-wrapper {
    border-radius: 0;
}

.event-categories {
    padding: 0.4rem 0.4rem 0;
}

.event-categories-toggle {
    display: none;
}

.event-categories-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    margin: 0;
}

label.event-categories-body {
    cursor: pointer;
}

.event-categories-rows {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.category-row {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.category-row-label {
    display: none;
    font-size: 0.6rem;
    white-space: nowrap;
}

.event-categories.single .category-row-label {
    display: inline;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    color: #fff;
    flex-shrink: 0;
}

.category-badge .material-symbols-outlined {
    font-size: 0.65rem;
}

.event-categories-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.event-categories-chevron .chevron {
    font-size: 1rem;
    color: var(--primary-gray);
    transition: transform 0.2s ease;
}

/* expanded: circles stack in a column and labels appear beside them */
.event-categories-toggle:checked ~ .event-categories-body {
    align-items: flex-start;
}

.event-categories-toggle:checked ~ .event-categories-body .event-categories-rows {
    flex-direction: column;
}

.event-categories-toggle:checked ~ .event-categories-body .category-row-label {
    display: inline;
}

.event-categories-toggle:checked ~ .event-categories-body .chevron {
    transform: rotate(180deg);
}

.event-details {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.4rem;
}

.modal-card hr {
    padding: 0;
    margin: 0.7rem 0;
}

.modal-card.success {
    background-color: var(--primary-success--lighter);
    color: var(--primary-success--text);
}

.modal-card.error {
    background-color: var(--primary-error--lighter);
    color: var(--primary-error--text);
}

.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;

    border: none;
    background: none;
    cursor: pointer;
    color: #666;
    z-index: 100;
}

.modal-close:hover {
    color: #000;
}

.modal-content p {
    font-size: 0.8rem;
    line-height: 1.5;
}

.modal-content.help .help-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.5rem;
    padding-right: 1.5rem;
    color: var(--primary-text);
    font-size: 0.95rem;
}

.modal-content.help ul {
    margin: 0.3rem 0;
    padding-left: 1.1rem;
    font-size: 0.8rem;
    line-height: 1.5;
}

.error-message {
    color: var(--primary-error--text);
    font-size: 0.6rem;
    line-height: 1.4;
    margin-top: 0.2rem;
    padding-left: 0.2rem;
}

.modal-description {
    color: var(--primary-text);
    padding-left: 0.2rem;
    font-style: italic;
    font-size: 0.6rem;
    line-height: 1.5;
    white-space: pre-line;
    /* base text font + color-emoji fallback so raw emoji render */
    font-family: var(--md-text-font-family, "Roboto"), "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
}

.modal-description a {
    color: #4527a0;
    font-style: normal;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
    overflow-wrap: anywhere;
}

.modal-description a:hover {
    color: #673ab7;
}

.modal-description a:active {
    color: #311b92;
}

.modal-actions {
    display: flex;
    gap: 0.8rem;
    flex-direction: column;
    justify-content: center;
    margin-top: 0rem;
}

.modal-actions.row {
    flex-direction: row;
    justify-content: right;
    gap: 0.3rem;
    padding: 1rem;
}

.modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;

    border: 1.5px solid var(-primary-textarea);
    border-radius: 999px;
    background-color: transparent;
    color: var(-primary-textarea);

    font-size: 0.5rem;
    cursor: pointer;

    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        transform 0.1s ease;
}

.modal-btn.hidden {
    display: none;
}

.modal-btn.confirm {
    padding: 0.5rem;
    font-size: 0.8rem;
}

.modal-btn.basic {
    border: 1.5px solid var(--primary-basic);
    color: var(--primary-basic);
}

.modal-btn.info {
    border: 1.5px solid var(--primary-info);
    color: var(--primary-info);
}

.modal-btn.delete {
    border: 1.5px solid var(--primary-error);
    color: var(--primary-error);
}

.modal-btn.basic:hover {
    background-color: var(--primary-basic--lighter);
}

.modal-btn.info:hover {
    background-color: var(--primary-info--lighter);
}

.modal-btn.delete:hover {
    background-color: var(--primary-error--lighter);
}

.modal-btn:active {
    transform: scale(0.97);
}

.modal-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: transparent;
    pointer-events: none;
}

.modal-small {
    max-width: 420px;
}

.confirm-code-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    margin: 0.8rem 0;
}

.confirm-code {
    flex: 1;
    padding: 0.5rem;

    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.3rem;

    background: #f7f8fc;
    border-radius: 8px;
    color: var(--primary-fg);
}

#confirm-input {
    flex: 1;
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}
    
.details-textarea {
    width: 100%;
    min-height: 120px;

    padding: 0.6rem 0.7rem;
    font-size: 0.8rem;
    line-height: 1.5;

    color: var(-primary-textarea);
    border: none;
    border-left: 4px solid #ccc;
    border-radius: 10px;
    background-color: #fcfcfc;

    resize: vertical;
    outline: none;

    /* transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease; */
}

.details-textarea::placeholder {
    color: var(--primary-gray);
}

.details-textarea:focus {
    border-color: var(--primary-fg);
    /* box-shadow: 0 0 0 2px rgba(63, 81, 181, 0.15); */
}

.textarea-wrapper {
    position: relative;
}

.char-counter {
    position: absolute;
    bottom: 6px;
    right: 10px;
    font-size: 0.65rem;
    color: #888;
}

.confirm-title.hidden {
    display: none;
}

.confirm-reasons {
    margin: 0.6rem 0;
    text-align: left;
}

.confirm-reasons.hidden {
    display: none;
}

.confirm-reasons-title {
    margin: 0 0 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-text);
}

.confirm-reasons-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

.confirm-reason-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--primary-textarea);
    cursor: pointer;
}

.confirm-reason-option input {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.confirm-reason-text {
    min-height: 60px;
}