/* Stylesheet for WordPress WhatsApp Login Gateway */

:root {
    --wal-primary: #25D366;
    --wal-primary-hover: #20ba59;
    --wal-text: #e2e8f0;
    --wal-text-muted: #94a3b8;
    --wal-bg-glass: rgba(17, 24, 39, 0.85);
    --wal-border: rgba(255, 255, 255, 0.08);
}

/* Add custom font or fallback to system fonts */
.wal-modal-wrapper, .wal-login-container button {
    font-family: Tahoma, Geneva, sans-serif;
    direction: rtl;
}

/* WhatsApp Login Button on WordPress Login Form */
.wal-btn-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background-color: var(--wal-primary) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease, transform 0.1s ease !important;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2) !important;
}

.wal-btn-whatsapp:hover {
    background-color: var(--wal-primary-hover) !important;
}

.wal-btn-whatsapp:active {
    transform: scale(0.98) !important;
}

.wal-wa-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Fullscreen Modal Wrapper */
.wal-modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.wal-modal-wrapper.hidden {
    display: none;
    opacity: 0;
}

.wal-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Glassmorphism Modal Content */
.wal-modal-content {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--wal-bg-glass);
    border: 1px solid var(--wal-border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    z-index: 10;
    text-align: center;
    color: var(--wal-text);
    box-sizing: border-box;
}

.wal-modal-close-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: transparent;
    border: none;
    color: var(--wal-text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
    transition: color 0.2s ease;
}

.wal-modal-close-btn:hover {
    color: #fff;
}

.wal-modal-header h2 {
    font-size: 20px;
    margin: 0 0 10px 0;
    color: #fff;
    font-weight: 700;
}

.wal-modal-header p {
    font-size: 12px;
    color: var(--wal-text-muted);
    line-height: 1.6;
    margin: 0 0 25px 0;
}

/* QR Code styling */
.wal-qr-box {
    background: #fff;
    padding: 15px;
    border-radius: 16px;
    display: inline-block;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.wal-qr-box img {
    display: block;
    width: 180px;
    height: 180px;
}

/* Large Action Button inside Modal */
.wal-btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: var(--wal-primary);
    color: #fff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 25px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.wal-btn-action:hover {
    background-color: var(--wal-primary-hover);
    color: #fff;
}

.wal-btn-action:active {
    transform: scale(0.98);
}

/* Generated Code display */
.wal-code-display {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--wal-border);
    padding: 14px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.wal-code-label {
    font-size: 13px;
    color: var(--wal-text-muted);
}

.wal-code-val {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    font-family: monospace;
    letter-spacing: 2px;
}

/* Loading status & spinner */
.wal-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--wal-primary);
    border-radius: 50%;
    animation: wal-spin 1s linear infinite;
    margin-bottom: 12px;
}

.wal-status-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.wal-status-row p {
    font-size: 12px;
    color: var(--wal-text-muted);
    margin: 0;
}

.wal-link-btn {
    background: transparent;
    border: none;
    color: var(--wal-primary);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 10px;
    padding: 0;
}

.wal-link-btn:hover {
    color: var(--wal-primary-hover);
}

.flex-center-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Animations */
@keyframes wal-spin {
    to { transform: rotate(360deg); }
}

/* Responsive Styles - MOBILE FRIENDLY */
@media (max-width: 480px) {
    .wal-modal-content {
        max-width: 90%;
        padding: 20px;
    }
    
    /* HIDE QR CODE on Mobile */
    .wal-qr-box, #wal-qr-container {
        display: none !important;
    }
}
