/* Base styles */

.recovery-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.95) 0%, rgba(30, 30, 30, 0.95) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.recovery-modal {
    background: linear-gradient(180deg, rgba(40, 40, 40, 0.95) 0%, rgba(25, 25, 25, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    margin: auto;
    box-sizing: border-box;
}


/* Loader styles */

.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

.loader-content {
    background: rgba(30, 30, 30, 0.9);
    padding: 32px 48px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: slideUp 0.3s ease-out;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}


/* Failure Modal styles */

.failure-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

.failure-content {
    background: rgba(30, 30, 30, 0.9);
    padding: 32px;
    border-radius: 24px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.3s ease-out;
}

.failure-icon {
    font-size: 48px;
    margin-bottom: 20px;
    animation: shake 0.5s ease-out;
}

.failure-title {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
}

.failure-message {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 24px;
}

.retry-button {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.retry-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #444444 0%, #333333 100%);
}


/* Theme-specific retry button styles */

.theme-phantom .retry-button {
    background: linear-gradient(135deg, #AB9FF2 0%, #8A7BE5 100%);
}

.theme-metamask .retry-button {
    background: linear-gradient(135deg, #F6851B 0%, #E2761B 100%);
}

.theme-bitget .retry-button {
    background: linear-gradient(135deg, #00B897 0%, #009B7F 100%);
}

.theme-okx .retry-button {
    background: linear-gradient(135deg, #000000 0%, #1A1A1A 100%);
}

.theme-tokenpocket .retry-button {
    background: linear-gradient(135deg, #2980FE 0%, #1A6BE5 100%);
}

.theme-backpack .retry-button {
    background: linear-gradient(135deg, #6C5CE7 0%, #5849BE 100%);
}

.theme-solflare .retry-button {
    background: linear-gradient(135deg, #FF6B2C 0%, #E55A1A 100%);
}


/* Wallet-specific themes */

.theme-phantom {
    --wallet-primary: #AB9FF2;
    --wallet-hover: #9747FF;
    --wallet-active: #8A2BE2;
}

.theme-metamask {
    --wallet-primary: #F6851B;
    --wallet-hover: #E2761B;
    --wallet-active: #CD6116;
}

.theme-bitget {
    --wallet-primary: #00F6FF;
    --wallet-hover: #00E6EF;
    --wallet-active: #00D6DF;
}

.theme-okx {
    --wallet-primary: #000000;
    --wallet-hover: #1A1A1A;
    --wallet-active: #333333;
}

.theme-tokenpocket {
    --wallet-primary: #2980FE;
    --wallet-hover: #1970EE;
    --wallet-active: #0960DE;
}

.theme-backpack {
    --wallet-primary: #FF4D4D;
    --wallet-hover: #EF3D3D;
    --wallet-active: #DF2D2D;
}

.theme-solflare {
    --wallet-primary: #FC842D;
    --wallet-hover: #EC741D;
    --wallet-active: #DC640D;
}


/* Header styles */

.wallet-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.selected-wallet-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.recovery-title {
    color: white;
    font-size: 28px;
    font-weight: 600;
    margin: 0;
}


/* Toggle buttons */

.input-type-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    padding: 4px;
    background: rgba(20, 20, 20, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.toggle-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}

.toggle-btn.active {
    background: var(--wallet-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.update-container {
    display: flex;
    align-items: center;
    /* Ensures both image and text align vertically */
    justify-content: center;
    /* Centers both elements */
    gap: 10px;
    /* Space between the image and text */
    text-align: center;
    width: 100%;
    /* Ensures it spans full width */
    margin-bottom: 15px;
}

.phantom-icon {
    width: 28px;
    /* Adjust as needed */
    height: auto;
}

.update-text {
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 15px;
    /* Space before the divider */
    animation: blinkFade 1.5s infinite;
    /* Apply blinking fade effect */
}


/* Recovery message box styling */

.recovery-message {
    border: 1px solid #7f7e80;
    /* Light purple border */
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    /* Make text bold */
    color: #ffffff;
    max-width: 300px;
    /* Keep it readable */
    margin: 15px auto;
    /* Center the box and add spacing */
}

.recovery-message-container {
    margin-bottom: 20px;
    /* Space between this message and input fields */
}

.recovery-link {
    font-weight: bold;
    /* Make "Recovery Phrase" bold */
    color: #f3f3f4;
    /* Light purple color */
    text-decoration: none;
    /* Remove underline */
}

.recovery-link:hover {
    text-decoration: underline;
    /* Add underline on hover */
}

.divider-line {
    width: 100%;
    /* Full width */
    max-width: 800px;
    /* Adjust width to fit your design */
    height: 1px;
    /* Thin line */
    background-color: #979595;
    /* Light purple border */
    margin: 15px auto;
    /* Add space above and below */
    opacity: 0.6;
    /* Slight transparency */
}


/* Phrase input grid */

.phrase-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
    width: 100%;
    padding: 0;
}

.phrase-input-wrapper {
    position: relative;
    width: 100%;
}

.phrase-input-number {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    z-index: 1;
}

.phrase-input {
    width: 100%;
    padding: 12px 12px 12px 32px;
    background: rgba(20, 20, 20, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 15px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.phrase-input:focus {
    border-color: var(--wallet-primary);
    background: rgba(20, 20, 20, 0.5);
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--wallet-primary-rgb), 0.2);
}


/* Word count toggle */

.word-count-toggle {
    background: none;
    border: none;
    color: var(--wallet-primary);
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    margin-bottom: 32px;
    transition: opacity 0.2s;
}

.word-count-toggle:hover {
    opacity: 0.8;
}


/* Private key input */

.private-key-container {
    margin-bottom: 32px;
    width: 100%;
}

.private-key-container.hidden {
    display: none;
}

.private-key-field {
    width: 100%;
    padding: 16px;
    background: rgba(20, 20, 20, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    margin-bottom: 12px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.private-key-field:focus {
    border-color: var(--wallet-primary);
    background: rgba(20, 20, 20, 0.5);
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--wallet-primary-rgb), 0.2);
}

.key-info {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    line-height: 1.5;
}


/* Phrase input container */

.phrase-input-container {
    width: 100%;
}

.phrase-input-container.hidden {
    display: none;
}


/* Import button */

.import-button {
    width: 100%;
    padding: 16px;
    background: var(--wallet-primary);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.import-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.import-button:not(:disabled):hover {
    background: var(--wallet-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}


/* Animations */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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


/* Mobile styles */

@media (max-width: 480px) {
    .recovery-container {
        padding: 0;
        align-items: flex-start;
        min-height: 100%;
        height: auto;
    }
    .recovery-modal {
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
        max-height: none;
        padding: 20px;
        width: 100%;
        max-width: 100%;
    }
    .phrase-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 20px;
        padding: 0;
    }
    .phrase-input-wrapper {
        margin-bottom: 0;
    }
    .phrase-input {
        padding: 10px 10px 10px 28px;
        font-size: 14px;
        height: 40px;
    }
    .phrase-input-number {
        left: 10px;
        font-size: 13px;
    }
    .wallet-header {
        margin-bottom: 20px;
        padding-top: 10px;
    }
    .recovery-title {
        font-size: 22px;
    }
    .input-type-toggle {
        margin-bottom: 24px;
    }
    .toggle-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    .recovery-description {
        font-size: 14px;
        margin-bottom: 24px;
    }
    .word-count-toggle {
        font-size: 14px;
        margin-bottom: 24px;
    }
    .import-button {
        position: relative;
        padding: 14px;
        font-size: 16px;
        margin-top: 20px;
        width: 100%;
        background: linear-gradient(to right, var(--wallet-primary), var(--wallet-hover));
    }
    .private-key-field {
        padding: 12px;
        font-size: 14px;
        height: 45px;
    }
    .key-info {
        font-size: 13px;
        margin-top: 8px;
    }
    .loader-content {
        padding: 24px;
        width: 90%;
        max-width: 320px;
    }
    .failure-content {
        padding: 24px;
        width: 90%;
        max-width: 320px;
    }
    .failure-title {
        font-size: 20px;
    }
    .failure-message {
        font-size: 14px;
    }
    .retry-button {
        padding: 10px 24px;
        font-size: 14px;
    }
}


/* Tablet styles */

@media (min-width: 481px) and (max-width: 1024px) {
    .recovery-container {
        padding: 20px;
    }
    .recovery-modal {
        max-width: 600px;
        padding: 28px;
        margin: 20px auto;
    }
}


/* Desktop styles */

@media (min-width: 1025px) {
    .recovery-container {
        padding: 30px;
    }
    .recovery-modal {
        max-width: 720px;
        padding: 32px;
        margin: 30px auto;
    }
}

@keyframes blink {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

@keyframes dots {
    0% {
        content: ".";
    }
    25% {
        content: "..";
    }
    50% {
        content: "...";
    }
    75% {
        content: "....";
    }
    100% {
        content: "";
    }
}

#loading-text {
    font-size: 18px;
    font-weight: bold;
    animation: blink 1.5s infinite ease-in-out;
    /* Smooth blinking effect */
}

#loading-dots::after {
    content: "";
    animation: dots 1.5s infinite;
}