/**
 * dtElection Poll Embed Styles
 * Branded styling that matches dtelection.com
 * Version: 1.6.0
 */

/* Container */
.dtelection-poll {
    width: 100%;
    margin: 1em 0;
}

/* Poll card */
.dte-poll {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    overflow: hidden;
}

.dte-poll *,
.dte-poll *::before,
.dte-poll *::after {
    box-sizing: border-box;
}

/* Hero image */
.dte-hero-image {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    display: block;
}

/* Content padding (applied to elements after hero image) */
.dte-header,
.dte-desc,
.dte-location,
.dte-external-link,
.dte-form,
.dte-results,
.dte-footer {
    padding-left: 24px;
    padding-right: 24px;
}

/* Header */
.dte-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-top: 24px;
    margin-bottom: 12px;
    gap: 12px;
}

/* Adjust header padding when hero image is present */
.dte-hero-image + .dte-header {
    padding-top: 16px;
}

.dte-title {
    font-family: 'Sora', 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.dte-brand {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #94a3b8;
    text-decoration: none;
    padding: 2px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.dte-brand:hover {
    color: #14b8a6;
    border-color: #14b8a6;
}

.dte-brand-icon {
    width: 14px;
    height: 14px;
}

/* Description */
.dte-desc {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

/* Location */
.dte-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
}

.dte-location-icon {
    font-size: 14px;
    line-height: 1;
}

.dte-location-link {
    color: #6366f1;
    text-decoration: none;
    transition: color 0.15s ease;
}

.dte-location-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}

.dte-location-text {
    color: #64748b;
}

/* External link */
.dte-external-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}

.dte-external-link-icon {
    font-size: 14px;
    line-height: 1;
}

.dte-external-link-url {
    color: #6366f1;
    text-decoration: none;
    transition: color 0.15s ease;
}

.dte-external-link-url:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* Form */
.dte-form {
    margin: 0;
    padding-bottom: 0;
}

/* Name/Email input */
.dte-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 12px;
    background: #fff;
    color: #1e293b;
    transition: all 0.15s ease;
}

.dte-input::placeholder {
    color: #94a3b8;
}

.dte-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Options */
.dte-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Simple option (checkbox/radio mode) */
.dte-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: #fff;
    margin: 0;
    font-weight: normal;
}

.dte-option:hover {
    border-color: #6366f1;
    background: #f8fafc;
}

.dte-option:has(input:checked) {
    border-color: #6366f1;
    background: #eef2ff;
}

.dte-option input[type="checkbox"],
.dte-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #6366f1;
    cursor: pointer;
}

.dte-option span {
    font-size: 14px;
    color: #1e293b;
    line-height: 1.4;
}

/* Option row (Yes/Maybe/No button mode) */
.dte-option-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.dte-option-label {
    font-size: 14px;
    color: #1e293b;
    line-height: 1.4;
}

.dte-vote-buttons {
    display: flex;
    gap: 6px;
}

.dte-vote-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #64748b;
}

.dte-vote-btn:hover {
    background: #f8fafc;
}

/* Yes button */
.dte-vote-btn.dte-vote-yes.active {
    background: #dcfce7;
    border-color: #22c55e;
    color: #15803d;
}

.dte-vote-btn.dte-vote-yes:hover {
    border-color: #22c55e;
}

/* Maybe button */
.dte-vote-btn.dte-vote-maybe.active {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #b45309;
}

.dte-vote-btn.dte-vote-maybe:hover {
    border-color: #f59e0b;
}

/* No button */
.dte-vote-btn.dte-vote-no.active {
    background: #fee2e2;
    border-color: #ef4444;
    color: #b91c1c;
}

.dte-vote-btn.dte-vote-no:hover {
    border-color: #ef4444;
}

/* Submit button */
.dte-submit {
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dte-submit:hover {
    background: #4f46e5;
}

.dte-submit:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* Footer */
.dte-footer {
    padding-top: 16px;
    padding-bottom: 24px;
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
}

/* States */
.dte-loading,
.dte-error,
.dte-success {
    padding: 40px;
    text-align: center;
    font-size: 14px;
    border-radius: 16px;
}

.dte-loading {
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.dte-error {
    color: #ef4444;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.dte-success {
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

/* Results (closed polls or after voting) */
.dte-results {
    padding-top: 8px;
    padding-bottom: 0;
}

.dte-closed {
    font-size: 14px;
    color: #64748b;
    text-align: center;
    margin: 0 0 16px 0;
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
}

/* Result item with bar */
.dte-result-item {
    margin-bottom: 12px;
}

.dte-result-label {
    font-size: 13px;
    color: #475569;
    margin-bottom: 4px;
    line-height: 1.4;
}

.dte-result-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 24px;
    background: #f1f5f9;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.dte-result-bar {
    height: 100%;
    background: linear-gradient(90deg, #5eead4, #14b8a6);
    border-radius: 6px;
    min-width: 4px;
    transition: width 0.3s ease;
}

.dte-result-bar.dte-leading {
    background: linear-gradient(90deg, #fdba74, #f97316);
}

.dte-result-count {
    position: absolute;
    right: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

/* Voted message */
.dte-voted-msg {
    font-size: 13px;
    color: #059669;
    text-align: center;
    margin: 16px 0 0 0;
    padding: 10px;
    background: #f0fdf4;
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 480px) {
    .dte-hero-image {
        max-height: 150px;
    }

    .dte-header,
    .dte-desc,
    .dte-location,
    .dte-external-link,
    .dte-form,
    .dte-results,
    .dte-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .dte-header {
        padding-top: 16px;
    }

    .dte-footer {
        padding-bottom: 16px;
    }

    .dte-title {
        font-size: 16px;
    }

    .dte-option {
        padding: 10px;
    }

    .dte-option-row {
        padding: 10px;
    }

    .dte-vote-buttons {
        flex-wrap: wrap;
    }

    .dte-vote-btn {
        min-width: calc(33.33% - 4px);
    }
}
