/**
 * IH Voting Public Styles - UN Inspired Theme
 */

/* Container */
.ih-voting-container {
    max-width: 1200px;
    margin: 0 auto;
    font-family: inherit;
}

/* Tabs */
.ih-voting-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
    justify-content: center;
}

.ih-tab-btn {
    padding: 12px 24px;
    border: 2px solid #5B92E5;
    background: transparent;
    color: #5B92E5;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ih-tab-btn:hover {
    background: #5B92E5;
    color: #fff;
}

.ih-tab-btn.active {
    background: #5B92E5;
    color: #fff;
}

/* Tab Content */
.ih-tab-content {
    display: none;
}

.ih-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Category Section */
.ih-category-section {
    margin-bottom: 48px;
}

.ih-category-header {
    text-align: center;
    margin-bottom: 32px;
}

.ih-category-header h3 {
    font-size: 1.75rem;
    color: #0F2847;
    margin: 0 0 12px;
    font-weight: 600;
}

.ih-category-header p {
    color: #5D6D7E;
    font-size: 1rem;
    margin: 0;
    max-width: 600px;
    margin: 0 auto;
}

/* Voted Message */
.ih-voted-message {
    background: linear-gradient(135deg, #5B92E5, #7AABE8);
    color: #fff;
    padding: 24px 32px;
    border-radius: 12px;
    text-align: center;
    font-size: 1.1rem;
}

.ih-check-icon {
    display: inline-block;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    line-height: 32px;
    margin-right: 12px;
    font-weight: bold;
}

/* Icons Grid */
.ih-icons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

/* Icon Card */
.ih-icon-card {
    position: relative;
    background: #fff;
    border: 2px solid #B8D4F0;
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
}

.ih-icon-card:hover {
    border-color: #5B92E5;
    box-shadow: 0 8px 24px rgba(91, 146, 229, 0.15);
    transform: translateY(-2px);
}

.ih-icon-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ih-icon-card input[type="radio"]:checked + .ih-icon-content {
    /* Selected state handled by parent */
}

.ih-icon-card:has(input:checked) {
    border-color: #5B92E5;
    background: linear-gradient(135deg, rgba(91, 146, 229, 0.05), rgba(91, 146, 229, 0.1));
}

.ih-icon-card:has(input:checked) .ih-radio-indicator {
    background: #5B92E5;
    border-color: #5B92E5;
}

.ih-icon-card:has(input:checked) .ih-radio-indicator::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Icon Content */
.ih-icon-content {
    text-align: center;
}

.ih-icon-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #5B92E5, #7AABE8);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 16px;
}

.ih-icon-content h4 {
    font-size: 1.1rem;
    color: #0F2847;
    margin: 0 0 8px;
    font-weight: 600;
}

.ih-icon-content p {
    font-size: 0.875rem;
    color: #5D6D7E;
    margin: 0;
    line-height: 1.5;
}

/* Radio Indicator */
.ih-radio-indicator {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    border: 2px solid #B8D4F0;
    border-radius: 50%;
    transition: all 0.2s;
}

/* Form Footer */
.ih-form-footer {
    text-align: center;
    padding-top: 16px;
}

.ih-vote-btn {
    background: linear-gradient(135deg, #5B92E5, #4A82D0);
    color: #fff;
    border: none;
    padding: 16px 48px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ih-vote-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(91, 146, 229, 0.4);
}

.ih-vote-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading State */
.ih-vote-btn.loading {
    position: relative;
    color: transparent;
}

.ih-vote-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
}

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

/* Results Container */
.ih-results-container {
    max-width: 800px;
    margin: 0 auto;
}

.ih-results-section {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(15, 40, 71, 0.08);
}

.ih-results-section h3 {
    font-size: 1.25rem;
    margin: 0 0 8px;
    color: #0F2847;
}

.ih-total-votes {
    color: #5D6D7E;
    font-size: 0.875rem;
    margin: 0 0 24px;
}

/* Result Item */
.ih-result-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #E8F4FC;
}

.ih-result-item:last-child {
    border-bottom: none;
}

.ih-rank {
    width: 32px;
    height: 32px;
    background: #E8F4FC;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #5B92E5;
    flex-shrink: 0;
}

.ih-result-item:first-child .ih-rank {
    background: linear-gradient(135deg, #D4AF37, #C4A030);
    color: #fff;
}

.ih-result-info {
    flex: 1;
}

.ih-result-info strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.95rem;
    color: #0F2847;
}

.ih-result-bar {
    height: 8px;
    background: #E8F4FC;
    border-radius: 4px;
    overflow: hidden;
}

.ih-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #5B92E5, #7AABE8);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.ih-result-stats {
    font-size: 0.875rem;
    color: #5D6D7E;
    white-space: nowrap;
}

/* Stats Container */
.ih-stats-container {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.ih-stat-item {
    text-align: center;
}

.ih-stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #5B92E5;
    line-height: 1;
}

.ih-stat-label {
    display: block;
    font-size: 0.875rem;
    color: #5D6D7E;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Toast Notification */
.ih-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    z-index: 10000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.ih-toast.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.ih-toast.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Bootstrap Modal Customization */
#ihVoteConfirmModal .modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15, 40, 71, 0.3);
}

#ihVoteConfirmModal .modal-header {
    padding: 24px 24px 0;
}

#ihVoteConfirmModal .modal-title {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: #0F2847;
}

#ihVoteConfirmModal .modal-body {
    padding: 24px;
}

#ihVoteConfirmModal .modal-footer {
    padding: 0 24px 24px;
}

.ih-confirm-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #5B92E5, #7AABE8);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto;
    box-shadow: 0 8px 24px rgba(91, 146, 229, 0.3);
}

#ihVoteConfirmModal h4 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0F2847;
}

#ihVoteConfirmModal .btn-primary {
    background: linear-gradient(135deg, #5B92E5, #4A82D0);
    border: none;
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#ihVoteConfirmModal .btn-primary:hover {
    background: linear-gradient(135deg, #4A82D0, #3A72C0);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(91, 146, 229, 0.4);
}

#ihVoteConfirmModal .btn-outline-secondary {
    border: 2px solid #B8D4F0;
    color: #5D6D7E;
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#ihVoteConfirmModal .btn-outline-secondary:hover {
    background: #E8F4FC;
    border-color: #5B92E5;
    color: #5B92E5;
}

/* Toast with icon */
.ih-toast {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ih-toast svg {
    flex-shrink: 0;
}

/* Voting Status Message */
.ih-voting-status-msg {
    font-size: 0.875rem;
    color: #5B92E5;
    font-weight: 500;
    margin-top: 8px;
}

/* Status Messages */
.ih-status-message {
    background: #E8F4FC;
    border: 2px solid #B8D4F0;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    font-size: 1.1rem;
    color: #5D6D7E;
}

.ih-status-message.ih-not-started {
    background: linear-gradient(135deg, #FEF3E2, #FDE8CC);
    border-color: #D4AF37;
    color: #8B6914;
}

.ih-status-message.ih-ended {
    background: linear-gradient(135deg, #E8F4FC, #D0E8F9);
    border-color: #5B92E5;
    color: #2E5A8C;
}

.ih-status-icon {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 12px;
}

/* Login Prompt */
.ih-login-prompt {
    text-align: center;
    padding: 48px 24px;
    background: linear-gradient(135deg, rgba(91, 146, 229, 0.05), rgba(91, 146, 229, 0.1));
    border: 2px dashed #5B92E5;
    border-radius: 16px;
    margin: 24px 0;
}

.ih-login-prompt-icon {
    color: #5B92E5;
    margin-bottom: 16px;
}

.ih-login-prompt h3 {
    font-size: 1.5rem;
    color: #0F2847;
    margin: 0 0 12px;
}

.ih-login-prompt p {
    color: #5D6D7E;
    margin: 0 0 16px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.ih-institutional-notice {
    background: linear-gradient(135deg, #D4AF37, #C4A030);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-block;
    margin-bottom: 24px;
}

.ih-login-prompt-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.ih-btn {
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #5B92E5;
}

.ih-btn-primary {
    background: linear-gradient(135deg, #5B92E5, #4A82D0);
    color: #fff;
    border-color: transparent;
}

.ih-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(91, 146, 229, 0.4);
}

.ih-btn-outline {
    background: transparent;
    color: #5B92E5;
}

.ih-btn-outline:hover {
    background: #5B92E5;
    color: #fff;
}

/* Voter Welcome */
.ih-voter-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #E8F4FC, #D0E8F9);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.ih-voter-welcome span {
    color: #2E5A8C;
    font-weight: 500;
}

.ih-logout-btn {
    background: transparent;
    border: 1px solid #5B92E5;
    color: #5B92E5;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.ih-logout-btn:hover {
    background: #5B92E5;
    color: #fff;
}

/* Registration Modal Customization */
#ihRegistrationModal .modal-content,
#ihLoginModal .modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15, 40, 71, 0.3);
}

#ihRegistrationModal .modal-header,
#ihLoginModal .modal-header {
    padding: 24px 24px 0;
}

#ihRegistrationModal .modal-body,
#ihLoginModal .modal-body {
    padding: 24px;
}

#ihRegistrationModal .modal-footer,
#ihLoginModal .modal-footer {
    padding: 0 24px 24px;
}

#ihRegistrationModal .btn-primary,
#ihLoginModal .btn-primary {
    background: linear-gradient(135deg, #5B92E5, #4A82D0);
    border: none;
}

#ihRegistrationModal .btn-primary:hover,
#ihLoginModal .btn-primary:hover {
    background: linear-gradient(135deg, #4A82D0, #3A72C0);
}

/* Votes Remaining */
.ih-votes-remaining {
    text-align: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #E8F4FC, #D0E8F9);
    border-radius: 8px;
    margin-bottom: 24px;
    color: #2E5A8C;
    font-weight: 500;
}

/* Checkbox Indicator */
.ih-icon-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ih-checkbox-indicator {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    border: 2px solid #B8D4F0;
    border-radius: 6px;
    transition: all 0.2s;
    background: #fff;
}

.ih-icon-card.selected .ih-checkbox-indicator {
    background: #5B92E5;
    border-color: #5B92E5;
}

.ih-icon-card.selected .ih-checkbox-indicator::after {
    content: '\2713';
    display: block;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    line-height: 20px;
}

.ih-icon-card.selected {
    border-color: #5B92E5;
    background: linear-gradient(135deg, rgba(91, 146, 229, 0.05), rgba(91, 146, 229, 0.1));
}

/* Already Voted Badge */
.ih-icon-card.ih-already-voted {
    opacity: 0.7;
    cursor: default;
}

.ih-icon-card.ih-already-voted:hover {
    transform: none;
    box-shadow: none;
}

.ih-voted-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* ImpactPilot Star Rating */
.ih-impact-rating {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #E8F4FC;
    text-align: center;
}

.ih-rating-label {
    display: block;
    font-size: 0.8rem;
    color: #5D6D7E;
    margin-bottom: 8px;
    font-weight: 500;
}

.ih-star-rating {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.ih-star {
    font-size: 1.5rem;
    color: #B8D4F0;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

.ih-star:hover {
    transform: scale(1.2);
}

.ih-star.active {
    color: #D4AF37;
}

.ih-star-rating:hover .ih-star {
    color: #B8D4F0;
}

.ih-star-rating:hover .ih-star:hover,
.ih-star-rating:hover .ih-star:hover ~ .ih-star {
    color: #B8D4F0;
}

.ih-star-rating .ih-star:hover,
.ih-star-rating .ih-star:hover ~ .ih-star {
    color: #B8D4F0;
}

.ih-star-rating:hover .ih-star {
    color: #B8D4F0;
}

.ih-star-rating .ih-star:hover ~ .ih-star {
    color: #B8D4F0 !important;
}

.ih-star-rating .ih-star:hover,
.ih-star-rating .ih-star.active {
    color: #D4AF37;
}

/* Confirm Modal - Multiple Icons */
.ih-confirm-icons-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
}

.ih-confirm-icon-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: #E8F4FC;
    border-radius: 8px;
    margin-bottom: 8px;
}

.ih-confirm-icon-item:last-child {
    margin-bottom: 0;
}

.ih-confirm-icon-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #5B92E5, #7AABE8);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

.ih-confirm-icon-details {
    flex: 1;
    text-align: left;
}

.ih-confirm-icon-details strong {
    display: block;
    font-size: 1rem;
    color: #0F2847;
    margin-bottom: 4px;
}

.ih-confirm-rating {
    font-size: 0.85rem;
    color: #5D6D7E;
}

.ih-mini-star {
    color: #B8D4F0;
    font-size: 0.9rem;
}

.ih-mini-star.active {
    color: #D4AF37;
}

/* Comment Section */
.ih-comment-section {
    background: #E8F4FC;
    padding: 16px;
    border-radius: 8px;
}

.ih-comment-section .form-label {
    font-weight: 500;
    color: #0F2847;
    margin-bottom: 8px;
}

.ih-comment-section .form-control {
    border: 1px solid #B8D4F0;
    border-radius: 8px;
    resize: vertical;
}

.ih-comment-section .form-control:focus {
    border-color: #5B92E5;
    box-shadow: 0 0 0 3px rgba(91, 146, 229, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .ih-voting-tabs {
        flex-direction: column;
    }

    .ih-tab-btn {
        width: 100%;
    }

    .ih-icons-grid {
        grid-template-columns: 1fr;
    }

    .ih-stats-container {
        gap: 24px;
    }

    .ih-stat-number {
        font-size: 2rem;
    }

    .ih-login-prompt-buttons {
        flex-direction: column;
    }

    .ih-btn {
        width: 100%;
    }

    .ih-confirm-icon-item {
        flex-direction: column;
        text-align: center;
    }

    .ih-confirm-icon-details {
        text-align: center;
    }
}
