/* Modern results card layout */
.custom-poll-result-cards {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 20px 0;
}

.custom-poll-result-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(127,71,100,0.08);
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border: 1px solid #eee;
}

.custom-poll-result-label {
    font-size: 16px;
    font-weight: 600;
    color: #7f4764;
    margin-bottom: 8px;
}

.custom-poll-result-bar-container {
    width: 100%;
    height: 28px;
    border-radius: 14px;
    overflow: hidden;
    background: #e9ecef;
    position: relative;
    margin-bottom: 8px;
}

.custom-poll-result-bar {
    background: linear-gradient(90deg, #7f4764 0%, #9a5a7d 100%);
    height: 100%;
    transition: width 0.8s ease;
    box-shadow: 0 2px 4px rgba(127, 71, 100, 0.3);
}

.custom-poll-result-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.custom-poll-result-votes {
    font-size: 14px;
    color: #666;
    margin-top: 2px;
}

.custom-poll-total-votes {
    margin-top: 20px;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    text-align: center;
}
.custom-poll-total-votes span {
    font-weight: 700;
    color: #7f4764;
}
/* ============================
   Custom Poll Plugin Styles
   ============================ */

/* Poll container */
.custom-poll-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 40px 30px;
    background: #fff;
    font-family: 'Montserrat', Helvetica, Arial, Lucida,sans-serif;
    text-align: center;
}

/* Header & title */
.custom-poll-header {
    margin-bottom: 30px;
    text-align: center;
    .custom-poll-results-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 15px;
        font-size: 14px;
        overflow-x: auto;
        display: block;
    }

    .custom-poll-results-table thead,
    .custom-poll-results-table tbody,
    .custom-poll-results-table tr {
        display: block;
        width: 100%;
    }
}

.custom-poll-title {
    margin: 0 0 25px 0;
    font-size: 32px;
    font-weight: 400;
    line-height: 1.2;
    font-family: 'Montserrat', Helvetica, Arial, Lucida,sans-serif;
    color: #666;
    text-align: center;
    letter-spacing: 0.5px;
}

.custom-poll-description {
    color: #888;
    font-size: 16px;
    line-height: 1.5;
    .custom-poll-results-table th,
    .custom-poll-results-table td {
        border: 1px solid #ddd;
        padding: 10px 8px;
        text-align: left;
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .custom-poll-results-table th {
        background: #7f4764;
        color: #fff !important;
        font-weight: 600;
        border-radius: 0;
    }

    .custom-poll-results-table td {
        background: #fff;
        border-radius: 0;
    }

    .custom-poll-results-only {
        padding: 10px;
    }
    margin-bottom: 30px;
    text-align: center;
}

/* Options - Styled for UL/LI structure */
.custom-poll-options,
ul.custom-poll-options {
    margin-bottom: 30px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 40px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    overflow-x: auto;
    padding: 0 10px;
    list-style: none; /* Remove bullet points */
}

/* Style the LI elements that contain each option */
.custom-poll-options li {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: fit-content;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Style the radio input */
.custom-poll-option,
input.custom-poll-option[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #7f4764;
    border-radius: 7px;
    margin: 0 12px 0 0; /* Right margin for spacing */
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    background-color: transparent;
}

.custom-poll-option:checked::before,
input.custom-poll-option[type="radio"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background-color: #7f4764;
    border-radius: 7px;
    transform: translate(-50%, -50%);
}

.custom-poll-option:hover,
input.custom-poll-option[type="radio"]:hover {
    border-color: #9a5a7d;
}

.custom-poll-option:focus,
input.custom-poll-option[type="radio"]:focus {
    outline: 0px solid #7f4764;
    outline-offset: 2px;
}

/* Style the labels */
.custom-poll-options li label {
    display: inline-block;
    margin: 0;
    color: #666;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    padding: 15px 10px;
    white-space: nowrap;
}

/* Email field */
.custom-poll-email {
    margin: 30px 10px;
    max-width: 400px;
    padding: 15px 10px !important;
    
}
.custom-poll-email input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Montserrat', Helvetica, Arial, Lucida,sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}
.custom-poll-code{
    margin: 30px 10px;
    max-width: 400px;
    padding: 15px 10px !important;
    font-size: 16px;
    font-family: 'Montserrat', Helvetica, Arial, Lucida,sans-serif;
}
.custom-poll-code input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Montserrat', Helvetica, Arial, Lucida,sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.custom-poll-email input:focus {
    border-color: #7f4764;
    box-shadow: 0 0 0 3px rgba(127, 71, 100, 0.1);
    outline: none;
}

.custom-poll-email input:invalid {
    border-color: #dc3545;
}

.custom-poll-email input::placeholder {
  font-weight: bold;
  opacity: 0.5;
  font-family: 'Montserrat', Helvetica, Arial, Lucida,sans-serif;
    color: #666;
}
/* Submit button */
.custom-poll-submit {
    text-align: center;
    margin-top: 30px;
}

.Button {
    color: #ffffff;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Montserrat', Helvetica, Arial, Lucida,sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    background-color: #7f4764;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(127, 71, 100, 0.3);
}

.Button:hover:not(:disabled) {
    background-color: #9a5a7d;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(127, 71, 100, 0.4);
}

.Button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(127, 71, 100, 0.3);
}

.Button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Results */
.custom-poll-results {
    margin-top: 35px;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    background: #fafafa;
}

.custom-poll-result-item {
    margin-bottom: 20px;
}

.custom-poll-result-label {
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.custom-poll-result-bar-container {
    width: 100%;
    height: 28px;
    border-radius: 14px;
    overflow: hidden;
    background: #e9ecef;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.custom-poll-result-bar {
    background: linear-gradient(90deg, #7f4764 0%, #9a5a7d 100%);
    height: 100%;
    transition: width 0.8s ease;
    box-shadow: 0 2px 4px rgba(127, 71, 100, 0.3);
}

.custom-poll-result-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.custom-poll-total-votes {
    margin-top: 20px;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    text-align: center;
}

.custom-poll-total-votes span {
    font-weight: 700;
    color: #7f4764;
}

/* Messages */
.custom-poll-message {
    margin: 20px auto;
    max-width: 500px;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
}

.success {
    background-color: #d4edda !important;
    color: #155724;
    border: 1px solid #c3e6cb !important;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Results shortcode */
.custom-poll-results-only {
    margin: 30px auto;
    max-width: 600px;
    padding: 20px;
    border: 1px solid #ddd;
    background: #fafafa;
    border-radius: 12px;
}

.custom-poll-results-only h3 {
    margin-bottom: 15px;
    color: #7f4764;
    text-align: center;
}

.custom-poll-results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.custom-poll-results-table th,
.custom-poll-results-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.custom-poll-results-table th {
    background: #7f4764;
    color: #fff !important;
    font-weight: 600;
}

.custom-poll-results-table td {
    background: #fff;
}

/* Responsive - Improved mobile handling */
@media (max-width: 768px) {
    .custom-poll-container {
        padding: 30px 20px;
        margin: 20px 10px;
    }
    
    .custom-poll-title { 
        font-size: 24px; 
    }
    
    .custom-poll-options {
        gap: 25px;
        padding: 0 15px;
        flex-wrap: wrap; /* Allow wrapping on mobile */
    }
    
    .custom-poll-option label {
        font-size: 15px;
        padding: 12px 8px;
    }
    
    .Button {
        width: 100%;
        padding: 18px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .custom-poll-result-cards {
        gap: 12px;
    }
    .custom-poll-result-card {
        padding: 12px 8px;
    }
    .custom-poll-result-label {
        font-size: 15px;
    }
    .custom-poll-result-bar-container {
        height: 22px;
    }
    .custom-poll-result-percentage {
        font-size: 12px;
    }
    .custom-poll-result-votes {
        font-size: 13px;
    }
    .custom-poll-total-votes {
        font-size: 14px;
    }
    .custom-poll-container {
        padding: 25px 15px;
    }

    .custom-poll-title {
        font-size: 20px;
    }

    .custom-poll-options {
        gap: 15px;
        flex-direction: column; /* Stack vertically on very small screens */
        align-items: stretch;
        width: 100%;
    }

    .custom-poll-options li {
        width: 100%;
        display: flex;
        flex-direction: row;
        align-items: center;
        margin-bottom: 10px;
    }

    .custom-poll-option {
        width: auto;
        margin-right: 10px;
        justify-content: flex-start;
    }

    .custom-poll-options li label {
        font-size: 15px;
        width: auto;
        justify-content: flex-start;
        padding: 10px 0;
        margin: 0;
    }

    .custom-poll-email, .custom-poll-code {
        display: block;
        width: 100% !important;
        margin: 15px 0 !important;
        box-sizing: border-box;
    }

    .Button {
        width: 100%;
        padding: 15px;
        font-size: 16px;
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .custom-poll-container {
        background: #2c3e50;
        border-color: #34495e;
        color: #ecf0f1;
    }
    
    .custom-poll-title { 
        color: #ecf0f1; 
    }
    
    .custom-poll-description { 
        color: #bdc3c7; 
    }
    
    .custom-poll-option label {
        color: #ecf0f1;
    }
    
    .custom-poll-email input {
        background: #34495e;
        border-color: #7f4764;
        color: #ecf0f1;
    }
    
    .custom-poll-email input::placeholder { 
        color: #95a5a6; 
    }
    
    .custom-poll-results {
        background: #2c3e50;
        border-color: #4a5a6e;
    }
    
    .custom-poll-result-bar-container { 
        background-color: #4a5a6e; 
    }
    
    .custom-poll-result-label {
        color: #ecf0f1;
    }
}