/**
 * IH Voting Public Styles
 */

/* 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 #503AA8;
    background: transparent;
    color: #503AA8;
    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: #503AA8;
    color: #fff;
}

.ih-tab-btn.active {
    background: #503AA8;
    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: #111;
    margin: 0 0 12px;
    font-weight: 600;
}

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

/* Voted Message */
.ih-voted-message {
    background: linear-gradient(135deg, #503AA8, #7c5fd6);
    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 #e5e5e5;
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
}

.ih-icon-card:hover {
    border-color: #503AA8;
    box-shadow: 0 8px 24px rgba(80, 58, 168, 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: #503AA8;
    background: linear-gradient(135deg, rgba(80, 58, 168, 0.05), rgba(80, 58, 168, 0.1));
}

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

.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, #503AA8, #7c5fd6);
    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: #111;
    margin: 0 0 8px;
    font-weight: 600;
}

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

/* Radio Indicator */
.ih-radio-indicator {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 24px;
    height: 24px;
    border: 2px solid #ddd;
    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, #FFEE58, #ffd600);
    color: #111;
    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(255, 238, 88, 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 #111;
    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(0, 0, 0, 0.08);
}

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

.ih-total-votes {
    color: #666;
    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 #eee;
}

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

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

.ih-result-item:first-child .ih-rank {
    background: linear-gradient(135deg, #FFEE58, #ffd600);
    color: #111;
}

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

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

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

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

.ih-result-stats {
    font-size: 0.875rem;
    color: #666;
    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: #FFEE58;
    line-height: 1;
}

.ih-stat-label {
    display: block;
    font-size: 0.875rem;
    color: #999;
    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(0, 0, 0, 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: #111;
}

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

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

.ih-confirm-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #503AA8, #7c5fd6);
    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(80, 58, 168, 0.3);
}

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

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

#ihVoteConfirmModal .btn-primary:hover {
    background: linear-gradient(135deg, #3d2a82, #503AA8);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(80, 58, 168, 0.4);
}

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

#ihVoteConfirmModal .btn-outline-secondary:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #333;
}

/* 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: #503AA8;
    font-weight: 500;
    margin-top: 8px;
}

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

.ih-status-message.ih-not-started {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border-color: #ffb74d;
    color: #e65100;
}

.ih-status-message.ih-ended {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-color: #64b5f6;
    color: #1565c0;
}

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

/* 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;
    }
}
