/* Popular Polls Section */
.popular-poll {
    background: linear-gradient(to bottom right, #ffffff, #f8f9fa);
    border: 2px solid #4a90e2;
    position: relative;
    overflow: hidden;
}

.popular-poll::after {
    content: '🎉';
    position: absolute;
    top: -7px;
    right: 7px;
    color: red;
    font-size: 33px;
}

.polls-section-title i.bi-star-fill {
    color: #ffd700;
}

/* Poll List Page Styles */
.polls-container {
    padding: 2rem 1rem;
}

.polls-section {
    margin-bottom: 3rem;
}

.polls-section-header {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.polls-section-title {
    font-size: 2rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.polls-section-title i {
    color: #4a90e2;
    margin-right: 0.5rem;
}

.grid-wrapper {
    max-width: 1200px;
    width: 92%;
    margin: 0 auto;
    padding: 0;
}

.polls-list {
    margin: 0 auto;
}

/* Masonry Grid Layout */
.masonry-grid {
    width: 100%;
}

.grid-sizer,
.polls-list .poll-card {
    width: calc(33.333% - 20px);
}

/* List view poll card */
.polls-list .poll-card {
    margin: 10px;
    display: inline-block;
    vertical-align: top;
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.polls-list .poll-card .poll-header {
    margin-bottom: 1.5rem;
}

.polls-list .poll-card .poll-question {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.polls-list .poll-card .poll-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.polls-list .poll-card .poll-status.active {
    background: #e3f2fd;
    color: #1976d2;
}

.polls-list .poll-card .poll-status.expired {
    background: #f5f5f5;
    color: #757575;
}

.polls-list .poll-card .poll-options {
    margin-bottom: 1.25rem;
}

.polls-list .poll-card .poll-option {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.polls-list .poll-card .poll-option:hover {
    background: #e9ecef;
}

.polls-list .poll-card .poll-option.selected {
    background: #e3f2fd;
    border: 1px solid #90caf9;
}

.polls-list .poll-card .poll-option-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.polls-list .poll-card .poll-option-text {
    font-size: 0.95rem;
    color: #333;
    flex: 1;
    margin-right: 1rem;
}

.polls-list .poll-card .poll-option-percentage {
    font-size: 0.875rem;
    color: #666;
    min-width: 45px;
    text-align: right;
}

.polls-list .poll-card .poll-progress-container {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.polls-list .poll-card .poll-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4a90e2, #357abd);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.polls-list .poll-card .poll-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #666;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.polls-list .poll-card .poll-votes {
    color: #4a90e2;
    font-weight: 500;
}

.polls-list .poll-card .poll-end-date {
    font-style: italic;
}

.polls-list .poll-card .poll-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.polls-list .poll-card .edit-poll-btn,
.polls-list .poll-card .delete-poll-btn {
    flex: 1;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.polls-list .poll-card .edit-poll-btn {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #90caf9;
}

.polls-list .poll-card .edit-poll-btn:hover {
    background: #bbdefb;
}

.polls-list .poll-card .delete-poll-btn {
    background: #ffebee;
    color: #d32f2f;
    border: 1px solid #ef9a9a;
}

.polls-list .poll-card .delete-poll-btn:hover {
    background: #ffcdd2;
}

.polls-list .poll-card .vote-btn {
    background: none;
    border: none;
    color: #4a90e2;
    cursor: pointer;
    padding: 0.25rem;
    transition: transform 0.2s ease;
}

.polls-list .poll-card .vote-btn:hover {
    transform: scale(1.1);
}

.polls-list .poll-card .vote-btn:disabled {
    color: #ccc;
    cursor: not-allowed;
}

.polls-list .poll-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* List view responsive */
@media (max-width: 1200px) {
    .grid-sizer,
    .polls-list .poll-card {
        width: calc(50% - 20px);
    }
}

@media (max-width: 768px) {
    .grid-sizer,
    .polls-list .poll-card {
        width: calc(100% - 20px);
    }
}

/* Poll Detail View Page Styling */
.poll-view {
    margin: 2rem auto;
}

.poll-view .poll-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.poll-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

.poll-question {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.poll-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
    color: #666;
    font-size: 0.95rem;
}

/* Voting Form Styling */
.poll-options-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.poll-option-vote {
    position: relative;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.poll-option-vote:hover {
    background: #fff;
    border-color: #4a90e2;
    transform: translateX(5px);
}

.poll-option-vote.selected {
    background-color: #ebf8ff;
    border-color: #4a90e2;
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.15);
}

.poll-option-vote input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.poll-option-vote label {
    display: block;
    padding-left: 2rem;
    cursor: pointer;
    font-size: 1.1rem;
    color: #333;
    position: relative;
    font-weight: 500;
}

.poll-option-vote label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #4a90e2;
    border-radius: 50%;
    background-color: white;
    transition: all 0.2s ease;
}

.poll-option-vote input[type="radio"]:checked + label::before {
    background: #4a90e2;
    box-shadow: inset 0 0 0 4px #fff;
}

.submit-vote-btn {
    margin-top: 1.5rem;
    background: linear-gradient(to right, #4a90e2, #357abd);
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-vote-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.3);
}

.submit-vote-btn:active {
    transform: translateY(-1px);
}

.submit-vote-btn i {
    font-size: 1.1rem;
}

/* Chart Container Styling */
.chart-container {
    height: 300px;
    margin-bottom: 2rem;
    position: relative;
    width: 100%;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 10px;
    background-color: #fff;
}

/* Create Poll Button */
.btn-create-poll {
    background: linear-gradient(90deg, #4a90e2, #357abd);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.btn-create-poll:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

.btn-create-poll i {
    font-size: 1.2rem;
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.8rem;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

#modalTitle {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
}

/* Form Styling */
.form-group {
    margin-bottom: 2rem;
    position: relative;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.form-group label small {
    color: #666;
    font-weight: normal;
}

.form-group input[type="text"],
.form-group input[type="datetime-local"] {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #4a90e2;
}

.option-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.option-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.char-count {
    position: absolute;
    right: 0.5rem;
    bottom: -1.2rem;
    font-size: 0.8rem;
    color: #666;
    z-index: 1;
}

.near-limit {
    color: #f57c00;
}

.at-limit {
    color: #d32f2f;
}

#addOption {
    background: #f8f9fa;
    color: #4a90e2;
    border: 2px solid #e9ecef;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

#addOption:hover {
    background: #fff;
    border-color: #4a90e2;
}

/* Make sure chart canvas renders correctly */
#resultsChart {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Poll Results Section */
.poll-results-section {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.poll-results-section.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.results-hidden-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    padding: 3rem 2rem;
    border-radius: 15px;
    text-align: center;
    color: #666;
}

.results-hidden-message i {
    font-size: 3rem;
    color: #cbd5e0;
    margin-bottom: 1rem;
}

.results-hidden-message p {
    font-size: 1.1rem;
    max-width: 300px;
}

.results-visualization {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.detailed-results {
    margin-bottom: 1.5rem;
}

.poll-option {
    margin-bottom: 1.25rem;
}

.poll-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.poll-option-text {
    font-size: 1.05rem;
    color: #333;
    font-weight: 500;
}

.poll-option-count {
    color: #666;
    font-size: 0.9rem;
    font-weight: 600;
}

.poll-option-bar {
    height: 10px;
    background: #f1f3f5;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    margin-bottom: 0.3rem;
}

.poll-option-progress {
    height: 100%;
    background: linear-gradient(90deg, #4a90e2, #63b3ed);
    border-radius: 5px;
    transition: width 1.5s cubic-bezier(0.215, 0.610, 0.355, 1.000);
}

.poll-option-percentage {
    display: block;
    font-size: 0.9rem;
    color: #666;
    text-align: right;
    font-weight: 600;
}

.poll-total {
    margin-top: 2rem;
    padding: 1.25rem;
    background-color: #f8f9fa;
    border-radius: 12px;
    color: #333;
    font-size: 1.1rem;
    text-align: center;
}

.poll-total p {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.poll-total i {
    color: #4a90e2;
}

.poll-total strong {
    color: #1a1a1a;
    font-weight: 700;
}

/* Poll Actions */
.poll-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.poll-actions .btn {
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.poll-actions .btn i {
    font-size: 1rem;
}

.poll-actions .btn-secondary {
    background-color: #f8f9fa;
    color: #333;
    border: 2px solid #e9ecef;
}

.poll-actions .btn-secondary:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
}

.poll-actions .btn-edit {
    background-color: #ebf8ff;
    color: #3182ce;
    border: 2px solid #bee3f8;
}

.poll-actions .btn-edit:hover {
    background-color: #bee3f8;
    transform: translateY(-2px);
}

/* Responsive Styles */
@media (max-width: 991px) {
    .poll-info-section, 
    .poll-voting-section,
    .poll-results-section {
        padding: 2rem;
    }
    
    .poll-question {
        font-size: 1.8rem;
    }
    
    .chart-container {
        height: 250px;
    }
}

@media (max-width: 767px) {
    .poll-info-section, 
    .poll-voting-section,
    .poll-results-section {
        padding: 1.5rem;
    }
    
    .poll-header h1 {
        font-size: 2rem;
    }
    
    .poll-question {
        font-size: 1.5rem;
    }
    
    .poll-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .submit-vote-btn {
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
    }
    
    .chart-container {
        height: 200px;
    }
}

/* Animations */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(74, 144, 226, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 144, 226, 0);
    }
}

.animate__animated {
    animation-duration: 0.8s;
}

.text-danger {
    color: #e53e3e;
}

/* Poll Error Message */
.poll-error {
    padding: 2rem;
    background-color: #fff5f5;
    border-radius: 12px;
    text-align: center;
    color: #e53e3e;
    margin: 2rem auto;
    max-width: 600px;
}

.poll-error i {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.poll-error p {
    font-size: 1.1rem;
    margin: 0;
}
.poll-view-container {margin-top: 30px;}
.textred {color:#ff0000;}
.poll-footer a {float: right;}