/**
 * IKI Competition — Voting Styles (Frontend)
 *
 * Styles for vote buttons, OTP modal, toast notifications,
 * and Top 50 page layout.
 */

/* ==========================================================================
   Vote Button
   ========================================================================== */

.iki-vote-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.iki-vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 2px solid #e54d26;
    background: #e54d26;
    color: #fff;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.2;
}

.iki-vote-btn:hover {
    background: #c94420;
    border-color: #c94420;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(229, 77, 38, 0.3);
}

.iki-vote-btn:active {
    transform: translateY(0);
}

.iki-vote-btn.iki-voted {
    background: #198754;
    border-color: #198754;
    cursor: default;
    pointer-events: none;
}

.iki-vote-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.iki-vote-count {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.iki-vote-count-label {
    font-size: 12px;
    color: #999;
}

/* ==========================================================================
   OTP Modal
   ========================================================================== */

.iki-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}

.iki-modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    max-width: 420px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: ikiModalFadeIn 0.2s ease;
}

@keyframes ikiModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.iki-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.iki-modal-close:hover {
    color: #333;
}

.iki-modal-content h3 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #1d2327;
}

.iki-modal-content p {
    margin: 0 0 20px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.iki-otp-form {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.iki-otp-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.iki-otp-form input:focus {
    border-color: #e54d26;
}

.iki-btn-primary {
    padding: 12px 24px;
    background: #e54d26;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.iki-btn-primary:hover {
    background: #c94420;
}

.iki-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.iki-btn-link {
    background: none;
    border: none;
    color: #e54d26;
    cursor: pointer;
    font-size: 14px;
    text-decoration: underline;
    padding: 0;
}

.iki-btn-link:hover {
    color: #c94420;
}

.iki-otp-error {
    color: #dc3545;
    font-size: 13px;
    min-height: 18px;
    margin-bottom: 8px;
}

.iki-otp-timer {
    text-align: center;
    font-size: 13px;
    color: #666;
    margin-top: 10px;
}

.iki-otp-timer strong {
    color: #e54d26;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.iki-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 100000;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.iki-toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.iki-toast-success {
    background: #198754;
    color: #fff;
}

.iki-toast-error {
    background: #dc3545;
    color: #fff;
}

/* ==========================================================================
   Top 50 Page
   ========================================================================== */

.iki-top50-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;
}

.iki-top50-header {
    text-align: center;
    margin-bottom: 30px;
}

.iki-top50-title {
    font-size: 28px;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 10px;
}

.iki-top50-subtitle {
    font-size: 16px;
    color: #666;
    margin: 0;
}

.iki-top50-filters {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.iki-filter-btn {
    padding: 8px 18px;
    border: 2px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    text-decoration: none;
    transition: all 0.2s;
}

.iki-filter-btn:hover {
    border-color: #e54d26;
    color: #e54d26;
}

.iki-filter-btn.active {
    background: #e54d26;
    border-color: #e54d26;
    color: #fff;
}

.iki-top50-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.iki-top50-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    transition: box-shadow 0.2s;
}

.iki-top50-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.iki-top50-card.iki-rank-top3 {
    border-color: #ffd700;
    background: linear-gradient(135deg, #fff 0%, #fffcf0 100%);
}

.iki-top50-card.iki-rank-top10 {
    border-color: #e0e0e0;
    background: #fafafa;
}

.iki-top50-rank {
    flex-shrink: 0;
    width: 45px;
    text-align: center;
}

.iki-rank-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f0f0;
    font-weight: 700;
    font-size: 15px;
    color: #333;
}

.iki-rank-top3 .iki-rank-number {
    background: linear-gradient(135deg, #ffd700, #ffb300);
    color: #fff;
    font-size: 17px;
}

.iki-rank-top10 .iki-rank-number {
    background: #e54d26;
    color: #fff;
}

.iki-top50-thumb {
    flex-shrink: 0;
}

.iki-top50-thumb img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.iki-top50-info {
    flex: 1;
    min-width: 0;
}

.iki-top50-entry-title {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    text-decoration: none;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.iki-top50-entry-title:hover {
    color: #e54d26;
}

.iki-top50-meta {
    display: flex;
    gap: 10px;
    font-size: 13px;
    color: #888;
}

.iki-top50-code {
    font-family: monospace;
    background: #f5f5f5;
    padding: 1px 6px;
    border-radius: 4px;
}

.iki-top50-votes {
    flex-shrink: 0;
    text-align: right;
}

.iki-vote-count-number {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #e54d26;
    line-height: 1.2;
}

.iki-top50-votes .iki-vote-count-label {
    font-size: 12px;
    color: #999;
}

.iki-top50-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

.iki-top50-empty {
    text-align: center;
    padding: 30px;
    color: #999;
}

/* Responsive */
@media (max-width: 768px) {
    .iki-top50-card {
        padding: 12px 15px;
        gap: 10px;
    }

    .iki-top50-thumb img {
        width: 45px;
        height: 45px;
    }

    .iki-vote-count-number {
        font-size: 16px;
    }

    .iki-top50-entry-title {
        font-size: 14px;
    }

    .iki-otp-form {
        flex-direction: column;
    }

    .iki-modal-content {
        padding: 20px;
    }
}