/* ===========================
   NadirAuth Popup Styles - Attractive Modern Theme
   =========================== */

.nadirauth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: auto;
}

.nadirauth-overlay.active {
    opacity: 1;
    visibility: visible;
}

.nadirauth-popup {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.1);
    max-width: 380px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    position: relative;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.nadirauth-popup.active {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.nadirauth-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 24px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    border-radius: 20px 20px 0 0;
    position: relative;
    overflow: hidden;
}

.nadirauth-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    pointer-events: none;
}

.nadirauth-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.nadirauth-content {
    padding: 24px;
    background: #ffffff;
}

.nadirauth-instruction {
    text-align: center;
    color: #475569;
    font-size: 14px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.5;
}

.nadirauth-difficulty {
    text-align: center;
    color: #3b82f6;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 16px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid #bfdbfe;
    border-radius: 8px;
    display: inline-block;
    width: 100%;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.nadirauth-target-number {
    text-align: center;
    font-size: 56px;
    font-weight: 900;
    color: #000000;
    margin: 20px 0;
    padding: 24px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 16px;
    border: 3px solid #3b82f6;
    letter-spacing: 4px;
    font-family: 'Inter', 'Arial', sans-serif;
    word-break: break-all;
    overflow-wrap: break-word;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.nadirauth-target-number::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(59, 130, 246, 0.2), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.nadirauth-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 20px;
}

/* Flexible grid for different number of options */
.nadirauth-options-3 {
    grid-template-columns: repeat(3, 1fr);
}

.nadirauth-options-4 {
    grid-template-columns: repeat(2, 1fr);
}

.nadirauth-options-5 {
    grid-template-columns: repeat(3, 1fr);
}

.nadirauth-options-6 {
    grid-template-columns: repeat(3, 1fr);
}

.nadirauth-options-7 {
    grid-template-columns: repeat(3, 1fr);
}

.nadirauth-options-8 {
    grid-template-columns: repeat(4, 1fr);
}

.nadirauth-options-9 {
    grid-template-columns: repeat(3, 1fr);
}

.nadirauth-option-btn {
    padding: 18px 12px;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', 'Arial', sans-serif;
    letter-spacing: 1.5px;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-all;
    overflow-wrap: break-word;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.nadirauth-option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s;
}

.nadirauth-option-btn:hover::before {
    left: 100%;
}

/* Smaller buttons when there are more options */
.nadirauth-options-5 .nadirauth-option-btn,
.nadirauth-options-6 .nadirauth-option-btn,
.nadirauth-options-7 .nadirauth-option-btn,
.nadirauth-options-8 .nadirauth-option-btn,
.nadirauth-options-9 .nadirauth-option-btn {
    font-size: 20px;
    letter-spacing: 1px;
    padding: 14px 8px;
    min-height: 60px;
}

.nadirauth-option-btn:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.2);
    color: #000000;
}

.nadirauth-option-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.15);
}

.nadirauth-option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
}

.nadirauth-option-btn.nadirauth-correct {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    animation: correctPulse 0.5s ease;
}

.nadirauth-option-btn.nadirauth-wrong {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    animation: wrongShake 0.5s ease;
}

@keyframes correctPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes wrongShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

.nadirauth-message {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.nadirauth-message.nadirauth-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 2px solid #10b981;
}

.nadirauth-message.nadirauth-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 2px solid #ef4444;
}

.nadirauth-message i {
    font-size: 18px;
}

/* Responsive Design */
@media (max-width: 480px) {
    .nadirauth-popup {
        width: 95%;
        max-width: 340px;
        border-radius: 16px;
    }

    .nadirauth-header {
        padding: 16px 20px;
    }

    .nadirauth-header h3 {
        font-size: 18px;
    }

    .nadirauth-content {
        padding: 20px;
    }

    .nadirauth-target-number {
        font-size: 48px;
        padding: 20px;
        margin: 16px 0;
    }
    
    .nadirauth-options {
        gap: 10px;
        margin-top: 16px;
    }

    .nadirauth-option-btn {
        padding: 14px 8px;
        font-size: 20px;
        min-height: 65px;
    }
}
