/* ==========================================================================
   HuddleSuite Polls (Terminfindung / date finding)
   Container design identical to pinnwand.css (Nicole's rule for new modules):
   gray section, white cards, theme-tinted card header.
   Mobile-first, hs- prefix
   ========================================================================== */

/* --------------------------------------------------------------------------
   Main container – same background + spacing as Pinnwand
   -------------------------------------------------------------------------- */
.hs-polls-section {
    background: #E1E3EB;
    border-radius: 10px;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    color: #222;
    box-sizing: border-box;
}

@media (max-width: 767px) {
    .hs-polls-section {
        padding: 12px;
    }
}

.hs-polls-title {
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #000;
    margin: 0 0 16px;
    padding: 0;
}

/* --------------------------------------------------------------------------
   New poll button row
   -------------------------------------------------------------------------- */
.hs-polls-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap; /* two buttons: stay side by side, wrap on narrow phones */
    margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   New poll form – white card like the pinnwand form.
   Hidden by default (CSS!), toggled via jQuery slideToggle.
   -------------------------------------------------------------------------- */
.hs-poll-form {
    display: none;
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.hs-poll-form input[type="text"],
.hs-poll-form textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 9px 10px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    margin-bottom: 8px;
    color: #222;
    background: #fff;
}

.hs-poll-form input[type="text"].hs-poll-title-input {
    font-weight: 700;
}

.hs-poll-form textarea {
    resize: vertical;
    min-height: 50px;
}

.hs-poll-form input:focus,
.hs-poll-form textarea:focus {
    outline: none;
    border-color: #aaa;
}

.hs-poll-form-label {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin: 8px 0 6px;
}

.hs-poll-options-inputs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.hs-poll-option-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Date + time are two fields (event-form pattern, 19.07.2026): the time
   list stays compact beside the date field. */
.hs-poll-option-row select.hs-poll-option-time,
.hs-poll-opt-add-form select.hs-poll-opt-add-time {
    flex: 0 0 auto;
    width: auto;
}

/* Matches both kinds of option field: the date picker and the text answer. */
.hs-poll-option-row .hs-poll-option-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    color: #222;
    background: #fff;
    min-width: 0;
    min-height: 44px; /* touch-friendly */
}

.hs-poll-option-row input:focus {
    outline: none;
    border-color: #aaa;
}

/* Remove option button – transparent, no theme override */
.hs-poll-option-remove {
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: #cc0000 !important;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 0 6px !important;
    flex-shrink: 0;
    border-radius: 0 !important;
}

.hs-poll-option-remove:hover {
    background-color: transparent !important;
    color: #900 !important;
}

/* Add option link-style button */
.hs-poll-add-option {
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    border-radius: 0 !important;
    color: #333 !important;
    font-size: 13px !important;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 0 !important;
    text-decoration: underline;
    font-family: inherit;
}

.hs-poll-add-option:hover {
    background-color: transparent !important;
    color: #000 !important;
}

.hs-poll-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

/* --------------------------------------------------------------------------
   Polls list
   -------------------------------------------------------------------------- */
.hs-polls-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hs-polls-empty {
    text-align: center;
    color: #666;
    padding: 24px 0;
    font-size: 14px;
}

.hs-polls-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
}

/* --------------------------------------------------------------------------
   Single poll card – white card, theme-tinted header (like .hs-board-post)
   -------------------------------------------------------------------------- */
.hs-poll {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
}

.hs-poll-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 14px 8px;
    gap: 8px;
}

/* Theme-colored header area – same tints as pinnwand */
.hs-theme-yellow .hs-poll-header { background: #FFFFFF; }
.hs-theme-green  .hs-poll-header { background: #FFFFFF; }
.hs-theme-pink   .hs-poll-header { background: #FFFFFF; }
.hs-theme-cyan   .hs-poll-header { background: #FFFFFF; }
.hs-theme-violet .hs-poll-header { background: #FFFFFF; }
/* Magenta — demo society only (brand #FA06C6). */
.hs-theme-magenta .hs-poll-header { background: #FFFFFF; }

.hs-poll-meta {
    flex: 1;
    min-width: 0;
}

.hs-poll-card-title {
    font-weight: 800;
    font-size: 15px;
    color: #111;
    margin-bottom: 2px;
}

.hs-poll-author {
    font-weight: 700;
    font-size: 13px;
    color: #111;
}

.hs-poll-date {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* Status badge */
.hs-poll-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 20px;
    padding: 3px 10px;
    margin-top: 6px;
}

.hs-poll-badge-open      { background: #10A248; color: #fff; }
.hs-poll-badge-closed    { background: #919AB4; color: #fff; }
.hs-poll-badge-converted { background: #000;    color: #fff; }

/* Delete poll button – transparent, no theme override */
.hs-poll-delete {
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: #cc0000 !important;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0 4px !important;
    flex-shrink: 0;
    border-radius: 0 !important;
}

.hs-poll-delete:hover {
    background-color: transparent !important;
    color: #900 !important;
}

.hs-poll-description {
    padding: 10px 14px 0;
    font-size: 14px;
    line-height: 1.55;
    color: #222;
    white-space: pre-wrap;
    word-break: break-word;
}

.hs-poll-location {
    padding: 6px 14px 0;
    font-size: 13px;
    color: #555;
}

/* Result note for converted polls */
.hs-poll-result {
    margin: 10px 14px 0;
    background: #D0EDDB;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 700;
    color: #0B6B30;
}

/* --------------------------------------------------------------------------
   Options (proposed dates)
   -------------------------------------------------------------------------- */
.hs-poll-options {
    padding: 10px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hs-poll-option {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 12px;
}

/* Highlight the option with the most yes votes */
.hs-poll-option.hs-poll-best {
    border-color: #10A248;
    background: #F2FBF5;
}

.hs-poll-option-date {
    font-weight: 700;
    font-size: 14px;
    color: #111;
}

/* Pick date button (creator/admin only) */
.hs-poll-pick-btn {
    background-color: #000 !important;
    background: #000 !important;
    border: none !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    outline: none !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    padding: 8px 14px !important;
    min-height: 36px;
    line-height: 1.2 !important;
    white-space: nowrap;
}

.hs-poll-pick-btn:hover {
    background-color: #3F1C42 !important;
    color: #fff !important;
}

/* --------------------------------------------------------------------------
   Voter names (collapsible per poll) – like pinnwand comments toggle
   -------------------------------------------------------------------------- */
.hs-poll-voters-toggle {
    display: flex !important;
    align-items: center;
    gap: 6px;
    padding: 8px 14px !important;
    border-top: 1px solid #ddd !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    border-radius: 0 !important;
    background-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 13px !important;
    color: #555 !important;
    font-family: inherit;
    line-height: normal !important;
}

.hs-poll-voters-toggle:hover {
    background-color: #f0f0f0 !important;
    color: #111 !important;
}

.hs-poll-voters-toggle .hs-toggle-arrow {
    transition: transform 0.2s;
    display: inline-block;
}

.hs-poll.hs-voters-open .hs-poll-voters-toggle .hs-toggle-arrow {
    transform: rotate(180deg);
}

.hs-poll-voters-section {
    display: none;
    border-top: 1px solid #ddd;
    padding: 12px 14px;
    background: #f7f7f7;
    font-size: 13px;
}

.hs-poll.hs-voters-open .hs-poll-voters-section {
    display: block;
}

.hs-poll-voters-option {
    margin-bottom: 8px;
}

.hs-poll-voters-option:last-child {
    margin-bottom: 0;
}

.hs-poll-voters-date {
    font-weight: 700;
    color: #111;
    margin-bottom: 2px;
}

.hs-poll-voters-line {
    color: #444;
    line-height: 1.5;
}

.hs-poll-voters-line .hs-voters-none {
    color: #999;
}

/* --------------------------------------------------------------------------
   Poll footer (close action for creator/admin)
   -------------------------------------------------------------------------- */
.hs-poll-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0 14px 12px;
}

.hs-poll-close-btn {
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    border-radius: 0 !important;
    color: #777 !important;
    font-size: 12px !important;
    font-family: inherit;
    cursor: pointer;
    padding: 4px 0 !important;
    text-decoration: underline;
}

.hs-poll-close-btn:hover {
    background-color: transparent !important;
    color: #333 !important;
}

/* --------------------------------------------------------------------------
   Responsive tweaks
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {

    .hs-poll-pick-btn {
        width: 100%;
        margin-top: 6px;
    }
}
