/* Atom Polls - Inspired Styles */

/* 1. Base Variables & Reset */
.atom-poll-container {
    --atom-bg: #fff;
    --atom-text: #333;
    --atom-question-color: #333;
    /* Default */
    --atom-btn: #2271b1;
    --atom-btn-text: #fff;
    --atom-border: #e2e4e7;
    --atom-radius: 12px;
    --atom-option-bg: #fff;
    --atom-option-hover: #f1f3f5;
    --atom-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);

    background-color: var(--atom-bg);
    color: var(--atom-text);
    border-radius: var(--atom-radius);
    padding: 24px;
    max-width: 600px;
    margin: 20px auto;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
    box-shadow: var(--atom-shadow);
    transition: all 0.3s ease;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    /* Important for header styles */
}

.atom-poll-container * {
    box-sizing: border-box;
}

/* 2. Typography */
.atom-poll-question {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.4;
    color: var(--atom-question-color, inherit);
    background: var(--atom-question-bg, transparent);
    padding: var(--atom-question-padding, 0);
    /* 15px if bg set */
    border-radius: var(--atom-radius);
    background-image: var(--atom-question-bg-img, none);
    background-size: cover;
    background-position: center;
}

/* 3. Options List */
.atom-poll-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    counter-reset: atom-counter;
    background: var(--atom-options-bg, transparent);
    padding: var(--atom-options-padding, 0);
    border-radius: var(--atom-radius);
    background-image: var(--atom-options-bg-img, none);
    background-size: cover;
    background-position: center;
    /* For Rounded template */
}

.atom-poll-option {
    position: relative;
    padding: 14px 18px;
    background: var(--atom-option-bg);
    border: 1px solid var(--atom-border);
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.atom-poll-option:hover {
    background: var(--atom-option-hover);
    transform: translateY(-1px);
    border-color: #cbd5e1;
}

.atom-poll-option.atom-selected {
    border-color: var(--atom-btn);
    box-shadow: 0 0 0 1px var(--atom-btn) inset;
    background: rgba(0, 0, 0, 0.01);
}

.atom-poll-container.has-voted .atom-poll-option,
.atom-poll-container.atom-expired .atom-poll-option {
    cursor: default;
    transform: none;
}

.atom-poll-container.atom-expired .atom-poll-option {
    opacity: 0.7;
    pointer-events: none;
}

.atom-option-text {
    position: relative;
    z-index: 2;
    font-weight: 500;
    flex-grow: 1;
}

/* Progress Bar */
.atom-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--atom-btn);
    opacity: 0;
    /* Hidden by default */
    width: 0%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    z-index: 1;
}

.atom-poll-container.has-voted .atom-progress-bar,
.atom-poll-container.atom-expired .atom-progress-bar {
    opacity: 0.15;
}

.atom-option-percent {
    position: relative;
    z-index: 2;
    font-weight: 700;
    margin-left: 10px;
    opacity: 0;
    /* Hidden by default */
    transition: opacity 0.3s ease;
}

.atom-poll-container.has-voted .atom-option-percent,
.atom-poll-container.atom-expired .atom-option-percent {
    opacity: 1;
}

.atom-option-image {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    margin-right: 12px;
    background-color: #ddd;
    flex-shrink: 0;
}

/* 4. Footer & Button */
.atom-poll-footer {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--atom-text);
    opacity: 0.7;
}

.atom-vote-btn {
    background-color: var(--atom-btn);
    color: var(--atom-btn-text);
    border: none;
    padding: 10px 24px;
    border-radius: 50px;
    /* Pill shape standard */
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.1s ease, filter 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.atom-vote-btn:hover {
    filter: brightness(110%);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.atom-vote-btn:active {
    transform: translateY(0);
}


/* ===========================
   THEMES (Templates)
   =========================== */

/* --- 1. Business Blue (Header Card) --- */
.atom-template-business {
    --atom-bg: #f8f9fa;
    --atom-option-bg: #ffffff;
    --atom-border: #e9ecef;
    padding: 0 0 24px 0;
    /* Remove top padding for header */
}

.atom-template-business .atom-poll-question {
    background: #0d47a1;
    /* Deep Blue Header */
    color: var(--atom-question-color, #fff);
    padding: 24px;
    margin-bottom: 24px;
    border-radius: 12px 12px 0 0;
    /* Top rounded only */
}

.atom-template-business .atom-poll-options,
.atom-template-business .atom-poll-footer {
    padding: 0 24px;
}

.atom-template-business .atom-poll-option {
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.atom-template-business .atom-progress-bar {
    background: #42a5f5;
    /* Light blue bar */
    opacity: 0.3;
}


/* --- 2. Dark Void (Gaming/Tech) --- */
.atom-template-dark_void {
    --atom-bg: #121212;
    --atom-text: #e0e0e0;
    --atom-border: #2c2c2c;
    --atom-option-bg: #1e1e1e;
    --atom-option-hover: #292929;
    --atom-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
}

.atom-template-dark_void .atom-poll-option {
    border: 1px solid #333;
}

.atom-template-dark_void .atom-poll-option.atom-selected {
    border-color: #bb86fc;
    box-shadow: 0 0 8px rgba(187, 134, 252, 0.4);
}

.atom-template-dark_void .atom-progress-bar {
    background: #bb86fc;
    opacity: 0.2;
}

.atom-template-dark_void .atom-vote-btn {
    background: #bb86fc;
    color: #000;
}


/* --- 3. Rounded Green (Playful) --- */
.atom-template-rounded_green {
    --atom-bg: #ffffff;
    --atom-border: transparent;
    padding: 0;
    /* Full card needed for header effect */
    background: #4caf50;
    /* Outer bg becomes header color */
}

.atom-template-business .atom-poll-question {
    background: #0d47a1;
    /* Deep Blue Header */
    color: var(--atom-question-color, #fff);
    padding: 24px;
    margin-bottom: 24px;
    border-radius: 12px 12px 0 0;
    /* Top rounded only */
}

.atom-template-rounded_green .atom-poll-question {
    color: var(--atom-question-color, #fff);
    padding: 25px;
    margin: 0;
    text-align: center;
}

.atom-template-rounded_green .atom-poll-options {
    background: #fff;
    padding: 30px 20px 20px 20px;
    border-radius: 20px 20px 12px 12px;
}

.atom-template-rounded_green .atom-poll-footer {
    background: #fff;
    padding: 0 20px 20px 20px;
    border-radius: 0 0 12px 12px;
    margin-top: 0;
}

.atom-template-rounded_green .atom-poll-option {
    border-radius: 50px;
    /* Capsule */
    border: 2px solid #e0e0e0;
    padding: 12px 20px;
}

/* A/B Indicators */
.atom-template-rounded_green .atom-poll-option::before {
    counter-increment: atom-counter;
    content: counter(atom-counter, upper-alpha);
    background: #e0e0e0;
    color: #555;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    margin-right: 12px;
    flex-shrink: 0;
}

.atom-template-rounded_green .atom-poll-option.atom-selected {
    border-color: #4caf50;
}

.atom-template-rounded_green .atom-poll-option.atom-selected::before {
    background: #4caf50;
    color: #fff;
}


/* --- 4. Soft Gradient (App Style) --- */
.atom-template-soft_gradient {
    --atom-bg: #ffffff;
    --atom-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.atom-template-soft_gradient .atom-poll-option {
    border: none;
    background: #f3f4f6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.atom-template-soft_gradient .atom-poll-option:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.atom-template-soft_gradient .atom-progress-bar {
    background: linear-gradient(90deg, #b388ff, #7c4dff);
    opacity: 0.15;
}

.atom-template-soft_gradient .atom-vote-btn {
    background: linear-gradient(135deg, #b388ff 0%, #7c4dff 100%);
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.4);
}

/* Admin Fix */
.atom-drag-handle {
    display: none;
}

/* --- 5. News List (Image Left) --- */
.atom-template-news_list {
    --atom-bg: #ffffff;
    --atom-border: #e0e0e0;
}

.atom-template-news_list .atom-poll-option {
    border: none;
    border-bottom: 1px solid #f0f0f1;
    border-radius: 0;
    padding: 16px 8px;
    background: transparent;
}

.atom-template-news_list .atom-poll-option:last-child {
    border-bottom: none;
}

.atom-template-news_list .atom-poll-option:hover {
    background: #fcfcfc;
    transform: none;
    padding-left: 12px;
    /* Slight nudge */
}

.atom-template-news_list .atom-option-image {
    width: 60px;
    height: 40px;
    border-radius: 4px;
}

.atom-template-news_list .atom-progress-bar {
    height: 4px;
    top: auto;
    bottom: 0;
    opacity: 0.5;
}


/* --- 6. Feedback (Stars/Centered) --- */
.atom-template-feedback {
    text-align: center;
    --atom-bg: #ffffff;
}

.atom-template-feedback .atom-poll-question {
    font-size: 1.4rem;
    margin-bottom: 30px;
}

.atom-template-feedback .atom-poll-options {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.atom-template-feedback .atom-poll-option {
    flex-direction: column;
    padding: 15px;
    width: 80px;
    height: 80px;
    justify-content: center;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    background: #fff;
}

.atom-template-feedback .atom-poll-option:hover {
    border-color: var(--atom-btn);
    transform: translateY(-4px);
}

.atom-template-feedback .atom-poll-option.atom-selected {
    background: var(--atom-btn);
    color: #fff;
    border-color: var(--atom-btn);
}

.atom-template-feedback .atom-poll-option.atom-selected .atom-option-text {
    color: #fff;
}

/* Hide bars/percents for Feedback to keep it clean, show only on result */
.atom-template-feedback .atom-progress-bar {
    display: none;
    /* Just simple selection */
}


/* --- 7. Slider (Range) --- */
.atom-template-slider .atom-poll-options {
    position: relative;
    padding: 40px 10px;
    flex-direction: row;
    justify-content: space-between;
}

/* Track */
.atom-template-slider .atom-slider-track {
    position: absolute;
    top: 50%;
    left: 10px;
    right: 10px;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    z-index: 0;
    transform: translateY(-50%);
}

.atom-template-slider .atom-slider-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--atom-btn);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

/* Dots */
.atom-template-slider .atom-poll-option {
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e0e0e0;
    z-index: 1;
    justify-content: center;
    font-size: 0;
    /* Hide text inside dot */
    overflow: visible;
    /* Allow label popup */
}

.atom-template-slider .atom-poll-option:hover {
    transform: scale(1.2);
    border-color: var(--atom-btn);
}

.atom-template-slider .atom-poll-option.atom-selected {
    background: var(--atom-btn);
    border-color: var(--atom-btn);
    transform: scale(1.3);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

/* Label below dot */
.atom-template-slider .atom-option-text {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--atom-text);
    white-space: nowrap;
    opacity: 0.7;
}

.atom-template-slider .atom-poll-option.atom-selected .atom-option-text {
    opacity: 1;
    font-weight: 700;
}


/* --- 8. Cyberpunk (Neon) --- */
.atom-template-cyberpunk {
    --atom-bg: #0a0a12;
    --atom-text: #00ffff;
    /* Cyan */
    --atom-border: #ff00ff;
    /* Pink */
    --atom-option-bg: #121216;
    --atom-radius: 4px;
    border: 2px solid var(--atom-border);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
    font-family: 'Courier New', monospace;
}

.atom-template-cyberpunk .atom-poll-question {
    color: #00ffff;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.atom-template-cyberpunk .atom-poll-option {
    border: 1px solid #333;
    border-left: 4px solid var(--atom-border);
    color: #fff;
}

.atom-template-cyberpunk .atom-poll-option:hover {
    background: #1a1a24;
    box-shadow: 0 0 10px var(--atom-border);
}

.atom-template-cyberpunk .atom-progress-bar {
    background: #00ffff;
    opacity: 0.4;
    box-shadow: 0 0 10px #00ffff;
}

.atom-template-cyberpunk .atom-vote-btn {
    background: #ff00ff;
    color: #000;
    text-transform: uppercase;
    border-radius: 0;
    box-shadow: 4px 4px 0 #00ffff;
    font-weight: 900;
    letter-spacing: 1px;
}

.atom-template-cyberpunk .atom-vote-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #00ffff;
}


/* --- 9. Minimalist (Clean) --- */
.atom-template-minimalist {
    --atom-bg: #ffffff;
    --atom-text: #000000;
    --atom-border: #000000;
    --atom-radius: 0;
    border: none;
    box-shadow: none;
    padding: 0;
    font-family: 'Georgia', 'Playfair Display', serif;
}

.atom-template-minimalist .atom-poll-question {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 30px;
    border-bottom: 1px solid #000;
    padding-bottom: 20px;
}

.atom-template-minimalist .atom-poll-option {
    border: 1px solid transparent;
    border-bottom: 1px solid #ddd;
    background: transparent;
    padding: 15px 0;
    border-radius: 0;
}

.atom-template-minimalist .atom-poll-option:last-child {
    border-bottom: 1px solid #000;
    /* Final line strong */
}

.atom-template-minimalist .atom-poll-option:hover {
    padding-left: 10px;
    background: transparent;
}

.atom-template-minimalist .atom-poll-option.atom-selected {
    font-weight: 700;
    padding-left: 10px;
    box-shadow: none;
    background: transparent;
}

.atom-template-minimalist .atom-progress-bar {
    background: #000;
    opacity: 0.05;
}

.atom-template-minimalist .atom-vote-btn {
    background: #000;
    color: #fff;
    border-radius: 0;
    padding: 12px 30px;
    margin-top: 20px;
    font-family: sans-serif;
    /* Contrast font */
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

/* --- Background Presets --- */
.atom-bg-1,
.atom-bg-2,
.atom-bg-3,
.atom-bg-4 {
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

/* Cyan/Teal (Matches bg-1) */
.atom-bg-1 {
    background-image: linear-gradient(135deg, #e0f7fa 0%, #80deea 100%) !important;
    border: none;
}

/* Light Gray/Blue (Matches bg-2) */
.atom-bg-2 {
    background-image: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%) !important;
    border: none;
}

/* Soft Blue (Matches bg-3) */
.atom-bg-3 {
    background-image: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%) !important;
    color: #fff;
    border: none;
}

/* Warm/Pink (Matches bg-4) */
.atom-bg-4 {
    background-image: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%) !important;
    border: none;
}
/* --- WordPress Alignment Support --- */
.aligncenter {
    display: block;
    margin: 5px auto;
    text-align: center;
}

.alignleft {
    float: left;
    margin: 5px 15px 5px 0;
}

.alignright {
    float: right;
    margin: 5px 0 5px 15px;
}

.alignnone {
    display: inline-block;
    margin: 5px 0;
}

/* Ensure images inside centered elements respect it */
.atom-poll-question p[style*="text-align: center"],
.atom-poll-question p[style*="text-align:center"] {
    display: block;
    width: 100%;
}
