/**
 * Polls Styles
 *
 * @package IncuCommunity
 * @since 1.0.0
 */

/* Container */
.incuc-poll {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.incuc-poll-container {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Loading State */
.incuc-poll-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: #666;
}

.incuc-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: incuc-spin 0.8s linear infinite;
}

@keyframes incuc-spin {
    to { transform: rotate(360deg); }
}

/* Poll Header */
.incuc-poll-header {
    margin-bottom: 20px;
}

.incuc-poll-question {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.incuc-poll-description {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px 0;
}

.incuc-poll-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #888;
}

.incuc-poll-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.incuc-poll-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.incuc-poll-status.active {
    background: #e8f5e9;
    color: #2e7d32;
}

.incuc-poll-status.closed {
    background: #fbe9e7;
    color: #c62828;
}

/* Options List */
.incuc-poll-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

/* Option Item */
.incuc-poll-option {
    position: relative;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.incuc-poll-option:hover {
    background: #e8e8e8;
}

.incuc-poll-option.is-voted {
    border-color: #007bff;
    background: #e3f2fd;
}

.incuc-poll-option.is-disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Progress Bar */
.incuc-poll-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(0, 123, 255, 0.1);
    transition: width 0.5s ease;
    z-index: 0;
}

.incuc-poll-option.is-voted .incuc-poll-progress {
    background: rgba(0, 123, 255, 0.2);
}

/* Option Content */
.incuc-poll-option-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.incuc-poll-option-text {
    font-size: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.incuc-poll-option-check {
    display: none;
    color: #007bff;
}

.incuc-poll-option.is-voted .incuc-poll-option-check {
    display: inline-block;
}

.incuc-poll-option-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.incuc-poll-option-percentage {
    font-weight: 600;
    color: #333;
    min-width: 45px;
    text-align: right;
}

.incuc-poll-option-votes {
    font-size: 13px;
    color: #888;
}

/* Footer */
.incuc-poll-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.incuc-poll-total-votes {
    font-size: 14px;
    color: #666;
}

.incuc-poll-actions {
    display: flex;
    gap: 8px;
}

/* Buttons */
.incuc-poll-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.incuc-poll-btn-primary {
    background: #007bff;
    color: #fff;
}

.incuc-poll-btn-primary:hover {
    background: #0056b3;
}

.incuc-poll-btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.incuc-poll-btn-secondary:hover {
    background: #d0d0d0;
}

.incuc-poll-btn-danger {
    background: #dc3545;
    color: #fff;
}

.incuc-poll-btn-danger:hover {
    background: #c82333;
}

.incuc-poll-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Add Option */
.incuc-poll-add-option-form {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.incuc-poll-add-option-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.incuc-poll-add-option-input:focus {
    outline: none;
    border-color: #007bff;
}

/* Create Form */
.incuc-poll-create-form {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.incuc-poll-create-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 20px 0;
}

.incuc-poll-form-group {
    margin-bottom: 20px;
}

.incuc-poll-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.incuc-poll-input,
.incuc-poll-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.incuc-poll-input:focus,
.incuc-poll-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Options List in Form */
.incuc-poll-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.incuc-poll-option-input {
    display: flex;
    gap: 8px;
}

.incuc-poll-option-input input {
    flex: 1;
}

.incuc-poll-remove-option {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.incuc-poll-remove-option:hover:not(:disabled) {
    background: #dc3545;
    color: #fff;
}

.incuc-poll-remove-option:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.incuc-poll-add-option {
    background: none;
    border: 2px dashed #ddd;
    color: #666;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.incuc-poll-add-option:hover {
    border-color: #007bff;
    color: #007bff;
}

/* Settings Checkboxes */
.incuc-poll-settings {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.incuc-poll-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.incuc-poll-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Form Actions */
.incuc-poll-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.incuc-poll-cancel {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background: #fff;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.incuc-poll-cancel:hover {
    background: #f5f5f5;
}

.incuc-poll-submit {
    padding: 10px 24px;
    border: none;
    background: #007bff;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.incuc-poll-submit:hover {
    background: #0056b3;
}

.incuc-poll-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Empty State */
.incuc-poll-empty {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 15px;
}

/* Responsive */
@media (max-width: 600px) {
    .incuc-poll-container {
        padding: 16px;
    }

    .incuc-poll-question {
        font-size: 16px;
    }

    .incuc-poll-option {
        padding: 12px;
    }

    .incuc-poll-option-text {
        font-size: 14px;
    }

    .incuc-poll-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .incuc-poll-actions {
        justify-content: center;
    }

    .incuc-poll-create-form {
        padding: 16px;
    }

    .incuc-poll-form-actions {
        flex-direction: column;
    }

    .incuc-poll-cancel,
    .incuc-poll-submit {
        width: 100%;
    }
}

/* Animation */
.incuc-poll-option {
    animation: incuc-fadeIn 0.3s ease;
}

@keyframes incuc-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toast Notification */
.incuc-poll-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    animation: incuc-slideUp 0.3s ease;
}

.incuc-poll-toast.success {
    background: #2e7d32;
}

.incuc-poll-toast.error {
    background: #c62828;
}

@keyframes incuc-slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
