/* CSPR.click Login Styles for Game */

/* Wallet Login Overlay */
#wallet-login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    color: #e0e0e0;
}

#wallet-login-overlay.hidden {
    display: none;
}

.wallet-login-container {
    max-width: 400px;
    width: 90%;
    padding: 2rem;
    background: rgba(20, 20, 35, 0.9);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wallet-login-container img {
    display: block;
    margin: 0 auto 15px;
}

.wallet-login-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #ff4b4b, #ff8b4b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.wallet-login-subtitle {
    font-size: 1.2rem;
    color: #888;
    margin-bottom: 2rem;
    text-align: center;
}

.wallet-login-description {
    font-size: 0.95rem;
    color: #aaa;
    margin-bottom: 1.5rem;
    text-align: center;
    line-height: 1.5;
}

/* Top notification bar for wallet operations */
.wallet-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ff6b35 0%, #ff4b4b 100%);
    color: white;
    padding: 12px 20px;
    z-index: 999999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
    font-size: 14px;
    font-weight: 500;
}

.wallet-progress-bar.show {
    transform: translateY(0);
}

.wallet-progress-bar .progress-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.wallet-progress-bar .progress-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.wallet-progress-bar .progress-text {
    text-align: center;
}

.wallet-progress-bar .progress-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.wallet-progress-bar .progress-message {
    font-size: 12px;
    opacity: 0.9;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Login Button */
.cspr-login-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #ff6b35 0%, #ff4b4b 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.cspr-login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.5);
}

.cspr-login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.cspr-login-button.loading {
    position: relative;
    color: transparent;
}

.cspr-login-button.loading::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    top: 50%;
    left: 50%;
    margin-left: -12px;
    margin-top: -12px;
    border: 3px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Wallet Status */
.wallet-status {
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.wallet-connected {
    background-color: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.5);
    color: #81c784;
}

.wallet-disconnected {
    background-color: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.5);
    color: #e57373;
}

/* Error Container */
#errorContainer {
    margin-top: 1rem;
    padding: 12px;
    border-radius: 8px;
    background-color: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.5);
    color: #e57373;
    word-wrap: break-word;
    text-align: center;
}

/* CSPR.click UI Container */
#csprclick-ui {
    margin-bottom: 1rem;
}

/* Ensure CSPR.click SDK modals appear above everything */
.csprclick-modal,
.csprclick-overlay,
[class*="csprclick"],
[class*="cspr-click"],
.ReactModal__Overlay,
.ReactModal__Content,
div[role="dialog"],
.modal-overlay,
iframe[src*="cspr.click"],
iframe[src*="csprclick"] {
    z-index: 999999 !important;
}

/* CSPR.click iframe container */
#csprclick-ui iframe {
    z-index: 999999 !important;
    position: relative;
}

/* Modal Styles (for confirmation) */
.wallet-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.wallet-modal.show {
    display: flex;
}

.wallet-modal-content {
    background: rgba(30, 30, 50, 0.95);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.wallet-modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #e0e0e0;
}

.wallet-modal-body {
    color: #aaa;
    margin-bottom: 1.5rem;
}

.public-key-display {
    display: flex;
    align-items: center;
    background-color: rgba(255, 107, 53, 0.15);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: 8px;
    padding: 12px;
    gap: 8px;
    margin: 1rem 0;
}

.public-key-text {
    flex: 1;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    color: #e0e0e0;
    word-break: break-all;
    line-height: 1.4;
}

.wallet-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.modal-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

.modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.modal-btn-primary {
    background: linear-gradient(135deg, #ff6b35 0%, #ff4b4b 100%);
    color: white;
}

.modal-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

/* Responsive */
@media (max-width: 480px) {
    .wallet-login-container {
        padding: 1.5rem;
    }

    .wallet-login-title {
        font-size: 2rem;
    }

    .cspr-login-button {
        padding: 14px;
        font-size: 16px;
    }
}
