/* Poll Maker Frontend Styles - Modern Design Matching Screenshots */

.pmv-poll {
    --pmv-accent: #27366a;
    --pmv-accent-dark: #1e2a4f;
    --pmv-accent-light: #3d4f7a;
    --pmv-success: #86c348;
    --pmv-success-dark: #6fa035;
    --pmv-radius: 12px;
    --pmv-font-size: 16px;

    border-radius: var(--pmv-radius);
    background: #ffffff;
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    position: relative;
}

/* Theme Presets */
.pmv-theme-minimal.pmv-poll {
    box-shadow: none;
    border: 1px solid #e5e7eb;
    background: #fafafa;
}

.pmv-theme-compact.pmv-poll {
    padding: 28px 32px;
    max-width: 600px;
}

.pmv-theme-compact.pmv-poll .pmv-title {
    font-size: 20px;
    margin-bottom: 12px;
}

.pmv-theme-compact.pmv-poll .pmv-option label {
    padding: 12px 16px;
    font-size: 15px;
    min-height: 48px;
}

.pmv-theme-dark.pmv-poll {
    background: #1a1a1a;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    color: #f9fafb;
    border: 1px solid #2d2d2d;
}

.pmv-theme-dark.pmv-poll .pmv-option label {
    background: #252525;
    border-color: #3d3d3d;
    color: #e5e7eb;
}

.pmv-theme-dark.pmv-poll .pmv-option label:hover {
    background: #2d2d2d;
    border-color: #4d4d4d;
}

.pmv-theme-dark.pmv-poll .pmv-result-bar-wrap {
    background: #2d2d2d;
}

.pmv-theme-dark.pmv-poll .pmv-total-votes {
    border-color: #3d3d3d;
    color: #9ca3af;
}

/* Title - Bold and Clean */
.pmv-title {
    margin: 0 0 16px 0;
    font-size: 24px;
    font-weight: 700;
    text-align: left;
    color: #1a1a1a;
    line-height: 1.4;
    letter-spacing: -0.3px;
}

.pmv-theme-dark .pmv-title {
    color: #ffffff;
}

/* Description - Subtle Gray */
.pmv-description {
    margin: 0 0 28px 0;
    font-size: 14px;
    color: #6b7280;
    text-align: left;
    line-height: 1.6;
    font-weight: 400;
}

/* Question Title for Multi-Question */
.pmv-question-title {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.2px;
}

.pmv-question-description {
    margin: 0 0 24px 0;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
    font-weight: 400;
}

/* Progress bar for multi-question */
.pmv-progress {
    margin-bottom: 28px;
}

.pmv-progress-text {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
}

.pmv-progress-bar {
    position: relative;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.pmv-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--pmv-accent), var(--pmv-accent-dark));
    transition: width 300ms ease-out;
}

/* Voting Options - Enhanced Design */
.pmv-options {
    list-style: none;
    padding: 0;
    margin: 0 0 32px 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pmv-option {
    margin: 0;
}

.pmv-option label {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    font-size: var(--pmv-font-size);
    color: #1a1a1a;
    padding: 18px 22px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    font-weight: 500;
    min-height: 64px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pmv-option label:hover {
    background: #fafbfc;
    border-color: var(--pmv-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 54, 106, 0.12);
}

/* Radio button styling - Custom styled */
.pmv-option input[type="radio"] {
    width: 22px;
    height: 22px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--pmv-accent);
    flex-shrink: 0;
    position: relative;
}

.pmv-option input[type="radio"]:checked ~ .pmv-option-label,
.pmv-option input[type="radio"]:checked + .pmv-option-icon + .pmv-option-image-wrap + .pmv-option-label,
.pmv-option input[type="radio"]:checked + .pmv-option-icon + .pmv-option-label,
.pmv-option input[type="radio"]:checked + .pmv-option-image-wrap + .pmv-option-label {
    background: linear-gradient(135deg, rgba(39, 54, 106, 0.06), rgba(39, 54, 106, 0.1));
    border-color: var(--pmv-accent);
    border-width: 2px;
    color: var(--pmv-accent);
    font-weight: 600;
    box-shadow: 0 0 0 4px rgba(39, 54, 106, 0.08), 0 4px 12px rgba(39, 54, 106, 0.15);
    transform: translateY(-1px);
}

.pmv-option input[type="radio"]:checked + .pmv-option-icon {
    background: var(--pmv-accent);
    color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(39, 54, 106, 0.3);
}

/* Enhanced Icon Display */
.pmv-option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(39, 54, 106, 0.08), rgba(39, 54, 106, 0.12));
    font-size: 20px;
    flex-shrink: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.pmv-option label:hover .pmv-option-icon {
    background: linear-gradient(135deg, rgba(39, 54, 106, 0.12), rgba(39, 54, 106, 0.18));
    transform: scale(1.05);
}

.pmv-option-image-wrap {
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    transition: all 0.25s ease;
}

.pmv-option-image-wrap img {
    border-radius: 8px;
    max-width: 70px;
    max-height: 70px;
    height: auto;
    display: block;
    object-fit: cover;
}

.pmv-option label:hover .pmv-option-image-wrap {
    border-color: var(--pmv-accent);
    transform: scale(1.02);
}

.pmv-option input[type="radio"]:checked + .pmv-option-image-wrap,
.pmv-option input[type="radio"]:checked + .pmv-option-icon + .pmv-option-image-wrap {
    border-color: var(--pmv-accent);
    box-shadow: 0 0 0 3px rgba(39, 54, 106, 0.1);
}

.pmv-option-label {
    flex: 1;
    line-height: 1.5;
}

/* Other input field */
.pmv-other-input {
    margin-top: 12px;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: #ffffff;
}

.pmv-other-input:focus {
    outline: none;
    border-color: var(--pmv-accent);
    box-shadow: 0 0 0 3px rgba(39, 54, 106, 0.1);
}

/* Submit Button - Vibrant Blue */
.pmv-submit {
    width: 100%;
    background: var(--pmv-accent);
    border: none;
    color: #ffffff;
    padding: 16px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(39, 54, 106, 0.25);
    margin-top: 8px;
    letter-spacing: 0.2px;
}

.pmv-submit:hover {
    background: var(--pmv-accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 54, 106, 0.35);
}

.pmv-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(39, 54, 106, 0.25);
}

/* Navigation buttons */
.pmv-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    gap: 12px;
}

.pmv-prev,
.pmv-next {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #374151;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pmv-prev:hover,
.pmv-next:hover {
    border-color: var(--pmv-accent);
    color: var(--pmv-accent);
    background: rgba(39, 54, 106, 0.08);
}

.pmv-next {
    margin-left: auto;
    background: var(--pmv-accent);
    border-color: var(--pmv-accent);
    color: #ffffff;
}

.pmv-next:hover {
    background: var(--pmv-accent-dark);
    border-color: var(--pmv-accent-dark);
    color: #ffffff;
}

/* View Results Button */
.pmv-view-results {
    width: 100%;
    margin-top: 12px;
    background: transparent;
    border: 1px solid #e5e7eb;
    padding: 12px 20px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: center;
    display: block;
}

.pmv-view-results:hover {
    border-color: var(--pmv-accent);
    color: var(--pmv-accent);
    background: rgba(39, 54, 106, 0.08);
}

/* Results Display - Enhanced with Better Checkmarks */
.pmv-results {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 2px solid #e5e7eb;
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pmv-results-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.pmv-result-item {
    margin: 0;
    position: relative;
    padding-left: 48px;
}

.pmv-result-item.pmv-result-chosen {
    position: relative;
}

.pmv-result-item.pmv-result-chosen::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 4px;
    color: var(--pmv-success);
    font-size: 18px;
    font-weight: 700;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(134, 195, 72, 0.15), rgba(134, 195, 72, 0.2));
    border: 2px solid rgba(134, 195, 72, 0.3);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(134, 195, 72, 0.2);
    animation: checkmarkPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.pmv-result-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
    gap: 20px;
}

.pmv-result-label {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    flex: 1;
    line-height: 1.5;
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pmv-result-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(39, 54, 106, 0.08);
    font-size: 18px;
    flex-shrink: 0;
}

.pmv-theme-dark .pmv-result-label {
    color: #ffffff;
}

.pmv-result-meta {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pmv-result-meta .pmv-vote-count {
    color: #6b7280;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.2px;
}

.pmv-result-meta .pmv-vote-percent {
    color: #f97316;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.3px;
    min-width: 45px;
    text-align: right;
}

/* Progress Bar for Results - Enhanced Design */
.pmv-result-bar-wrap {
    position: relative;
    width: 100%;
    background: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
    height: 20px;
    margin-top: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.pmv-result-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    border-radius: 999px;
    transition: width 1000ms cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, var(--pmv-accent), var(--pmv-accent-dark));
    box-shadow: 0 1px 4px rgba(39, 54, 106, 0.2);
}

.pmv-result-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2));
    border-radius: 999px;
}

/* Color variations for different options - Using brand colors */
.pmv-result-item:nth-child(1) .pmv-result-bar {
    background: linear-gradient(90deg, var(--pmv-accent), var(--pmv-accent-dark));
}

.pmv-result-item:nth-child(2) .pmv-result-bar {
    background: linear-gradient(90deg, var(--pmv-success), var(--pmv-success-dark));
}

.pmv-result-item:nth-child(3) .pmv-result-bar {
    background: linear-gradient(90deg, #f97316, #ea580c);
}

.pmv-result-item:nth-child(4) .pmv-result-bar {
    background: linear-gradient(90deg, #8b5cf6, #7c3aed);
}

.pmv-result-item:nth-child(5) .pmv-result-bar {
    background: linear-gradient(90deg, #ec4899, #db2777);
}

.pmv-result-item:nth-child(6) .pmv-result-bar {
    background: linear-gradient(90deg, #06b6d4, #0891b2);
}

/* Total Votes - Enhanced Design */
.pmv-total-votes {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #e5e7eb;
    font-size: 15px;
    color: #4b5563;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.pmv-theme-dark .pmv-total-votes {
    border-color: #3d3d3d;
    color: #9ca3af;
}

/* State Messages */
.pmv-state {
    padding: 16px 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    margin: 20px 0;
    font-size: 14px;
}

.pmv-state-upcoming {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.pmv-state-closed {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.pmv-state-login {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pmv-poll {
        padding: 28px 24px;
        max-width: 100%;
        margin: 0 16px;
    }

    .pmv-title {
        font-size: 22px;
    }

    .pmv-option label {
        padding: 14px 16px;
        font-size: 15px;
        min-height: 52px;
    }

    .pmv-result-label {
        font-size: 15px;
    }

    .pmv-result-item.pmv-result-chosen::before {
        left: -28px;
        font-size: 20px;
        width: 22px;
        height: 22px;
    }

    .pmv-result-row {
        flex-wrap: wrap;
    }
}

/* Loading State */
.pmv-loading {
    opacity: 0.6;
    pointer-events: none;
}

.pmv-loading .pmv-submit {
    position: relative;
    color: transparent;
}

.pmv-loading .pmv-submit::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Smooth transitions */
.pmv-poll * {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Better focus states for accessibility */
.pmv-option input[type="radio"]:focus-visible {
    outline: 2px solid var(--pmv-accent);
    outline-offset: 2px;
}

.pmv-submit:focus-visible {
    outline: 3px solid rgba(39, 54, 106, 0.3);
    outline-offset: 2px;
}
