﻿/* Container & Layout */
.vote-container {
    max-width: 800px;
    margin: 0 auto 4rem auto;
    padding: 0 1.5rem;
    font-family: system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    position: relative;
}

/* Sticky Dot Tracker */
.sticky-tracker-wrapper {
    position: sticky;
    top: 0rem;
    z-index: 100;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
    pointer-events: none; /* Let clicks pass through empty space */
}

.dot-tracker {
    pointer-events: auto; /* Re-enable clicks on the actual tracker */
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    background: rgba(var(--bg-surface-rgb, 30, 30, 35), 0.85); /* Fallback rgb if variable not explicitly rgb */
    background: var(--bg-surface);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0.75rem 1.25rem;
    border-radius: 100px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: slideDown 0.5s ease;
}

.tracker-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

.dots-visual {
    display: flex;
    gap: 0.35rem;
}

.visual-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .visual-dot.spent {
        background: transparent;
        border: 2px solid var(--border-color);
        box-shadow: none;
        transform: scale(0.8);
        opacity: 0.5;
    }

.badge {
    background: var(--bg-base);
    color: var(--text-main);
    font-weight: 800;
    font-size: 1.125rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    min-width: 40px;
    text-align: center;
}

/* Header */
.vote-header {
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--text-main);
}

.page-description {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
    line-height: 1.5;
    max-width: 600px;
}

/* Add Option Form */
.add-option-form {
    display: flex;
    gap: 0.75rem;
    background: var(--bg-surface);
    padding: 0.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 3rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: border-color 0.3s ease;
}

    .add-option-form:focus-within {
        border-color: var(--accent);
    }

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.75rem;
}

.input-icon {
    flex-shrink: 0;
}

#newOptionText {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.05rem;
    outline: none;
    padding: 0.75rem 0;
}

    #newOptionText::placeholder {
        color: var(--text-muted);
    }

.primary-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: var(--text-main);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

    .primary-btn:hover {
        filter: brightness(1.15);
        transform: translateY(-2px);
    }

    .primary-btn:active {
        transform: translateY(0);
    }

/* Options Section */
.options-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

    .options-section-header h2 {
        font-size: 1.25rem;
        font-weight: 600;
        margin: 0;
        color: var(--text-main);
    }

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    background: transparent;
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    color: var(--text-muted);
    animation: fadeIn 0.5s ease;
}

.empty-icon-wrapper {
    background: var(--bg-surface);
    padding: 1rem;
    border-radius: 50%;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

/* --- JS Generated Option Cards --- */
.option-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    transition: all 0.2s ease;
    animation: slideUpFade 0.4s ease forwards;
}

    .option-card:hover {
        background: var(--bg-surface-hover);
        border-color: var(--accent);
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    }

.option-info {
    flex: 1;
    padding-right: 1.5rem;
}

.option-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    word-break: break-word;
}

/* Creator Info inside the card */
.creator-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.creator-avatar {
    width: 22px;
    height: 22px;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-main);
}

.option-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.vote-count {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--accent);
    min-width: 2rem;
    text-align: center;
}

.vote-btn {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .vote-btn:hover:not(:disabled) {
        background: var(--accent);
        border-color: var(--accent);
        color: var(--bg-base);
        transform: scale(1.1);
    }

    .vote-btn:disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(255, 255, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .sticky-tracker-wrapper {
        justify-content: center;
        top: 0.5rem;
    }

    .dot-tracker {
        width: 100%;
        justify-content: space-between;
    }

    .add-option-form {
        flex-direction: column;
        padding: 0.75rem;
    }

    .input-wrapper {
        padding: 0.5rem;
    }

    .primary-btn {
        width: 100%;
        justify-content: center;
    }

    .option-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }

    .option-info {
        padding-right: 0;
    }

    .option-controls {
        width: 100%;
        justify-content: space-between;
        background: var(--bg-base);
        padding: 0.5rem 1rem;
        border-radius: 8px;
    }
}
