/* Veridian Vault - Main Stylesheet */

:root {
    --primary: #bdce89;
    --primary-dark: #8b9b5e;
    --primary-light: #d9eaa3;
    --background: #131313;
    --surface: #1f2020;
    --surface-light: #2a2a2a;
    --text: #e4e2e1;
    --text-muted: #c3c8c1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #131313;
    color: #e4e2e1;
    font-family: 'Manrope', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Header */
header {
    background: #131313 !important;
    border-bottom: 1px solid rgba(189, 206, 137, 0.2) !important;
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
}

/* Green Text */
.text-primary {
    color: #bdce89 !important;
}

.material-symbols-outlined.text-primary {
    color: #bdce89 !important;
}

.border-primary {
    border-color: #bdce89 !important;
}

.bg-primary\/20 {
    background-color: rgba(189, 206, 137, 0.2);
}

/* Buttons */
.bg-gradient-to-br,
button.bg-gradient-to-br,
#openModalBtn,
#heroBackupBtn,
#vaultBackupBtn,
#executeBackupBtn {
    background: linear-gradient(to bottom right, #bdce89, #8b9b5e) !important;
    color: #ffffff !important;
    font-weight: bold;
}

/* Modal */
.modal-container {
    background: linear-gradient(135deg, #1f2020, #131313);
    border-radius: 0 !important;
    max-width: 950px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid rgba(189, 206, 137, 0.3);
    padding-bottom: 2rem !important;
    scrollbar-width: thin;
    scrollbar-color: #bdce89 #1f2020;
}

.modal-container::-webkit-scrollbar,
.wallet-select-menu::-webkit-scrollbar {
    width: 8px;
}

.modal-container::-webkit-scrollbar-track,
.wallet-select-menu::-webkit-scrollbar-track {
    background: #1f2020;
}

.modal-container::-webkit-scrollbar-thumb,
.wallet-select-menu::-webkit-scrollbar-thumb {
    background: #bdce89;
    border-radius: 999px;
}

.modal-container::-webkit-scrollbar-thumb:hover,
.wallet-select-menu::-webkit-scrollbar-thumb:hover {
    background: #aebf77;
}

/* Wallet Dropdown */
.wallet-select-wrap {
    position: relative;
    margin-bottom: 1rem;
}

.wallet-native-select {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    inset: 0;
    height: 0;
    padding: 0;
    border: 0;
}

.wallet-select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #2a2a2a;
    border: 1px solid #434843;
    border-radius: 12px;
    padding: 12px 14px;
    color: #e4e2e1;
    cursor: pointer;
    text-align: left;
}

.wallet-select-trigger:focus-visible {
    outline: 1px solid #bdce89;
    border-color: #bdce89;
}

.wallet-selected-value,
.wallet-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.wallet-option-logo,
.wallet-fallback-icon,
.wallet-selected-logo {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    flex-shrink: 0;
}

.wallet-option-logo {
    object-fit: contain;
    background: #ffffff;
    padding: 2px;
}

.wallet-fallback-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(189, 206, 137, 0.18);
    color: #bdce89;
    font-size: 0.7rem;
    font-weight: 700;
}

.wallet-chevron {
    transition: transform 0.2s ease;
}

.wallet-select-wrap.open .wallet-chevron {
    transform: rotate(180deg);
}

.wallet-select-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 10px);
    z-index: 30;
    background: #1f2020;
    border: 1px solid #434843;
    border-radius: 14px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
    max-height: min(320px, calc(85vh - 260px));
    overflow-y: auto;
    padding: 0.4rem;
    display: none;
    scrollbar-width: thin;
    scrollbar-color: #bdce89 #1f2020;
}

.wallet-select-wrap.open .wallet-select-menu {
    display: block;
}

.wallet-option {
    width: 100%;
    background: transparent;
    border: 0;
    color: #e4e2e1;
    padding: 0.7rem 0.8rem;
    border-radius: 10px;
    cursor: pointer;
}

.wallet-option:hover,
.wallet-option.active {
    background: rgba(189, 206, 137, 0.12);
}

/* Seed Boxes */
.seed-box {
    background: #2a2a2a;
    border: 1px solid #434843;
    border-radius: 0.75rem;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.seed-box:focus-within {
    border-color: #bdce89;
}

.seed-word {
    background: transparent;
    flex: 1;
    outline: none;
    font-size: 0.875rem;
    color: #e4e2e1;
}

/* Backup Type Buttons */
.backup-type-btn {
    background: #2a2a2a;
    color: #e4e2e1;
    padding: 8px;
    border-radius: 12px;
    cursor: pointer;
}

.backup-type-btn.active-type {
    background: #bdce89 !important;
    color: #131313 !important;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

/* Toast */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1f2020;
    border-left: 4px solid #bdce89;
    padding: 12px 20px;
    border-radius: 12px;
    z-index: 1100;
    transform: translateX(400px);
    transition: 0.3s;
    opacity: 0;
}

.toast-notification.show {
    transform: translateX(0);
    opacity: 1;
}

/* Market Data */
.trend-up {
    color: #bdce89;
}
.trend-down {
    color: #ffb4ab;
}

.coin-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    object-fit: contain;
    padding: 4px;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}
.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Glass Panel */
.glass-panel {
    background: rgba(53, 53, 53, 0.4);
    backdrop-filter: blur(20px);
}

.mesh-texture {
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h40v40H0V0zm20 20L0 40h40L20 20zM20 0L0 20h40L20 0z' fill='%23bdce89' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
}

/* Checkbox */
input[type="checkbox"] {
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
    accent-color: #bdce89;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    min-height: 18px;
    cursor: pointer;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    display: inline-block;
    flex-shrink: 0;
}

/* Form Inputs */
input, textarea, select {
    background: #2a2a2a !important;
    color: #e4e2e1 !important;
    border: 1px solid #434843;
    border-radius: 12px;
    padding: 12px;
    width: 100%;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #bdce89;
}

/* Seed Grid */
.seed-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    .seed-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Menu */
.mobile-menu-overlay {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: #1f2020;
    z-index: 100;
    transform: translateY(-100%);
    transition: transform 0.3s;
    border-bottom: 1px solid rgba(189, 206, 137, 0.2);
}

.mobile-menu-overlay.open {
    transform: translateY(0);
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(189, 206, 137, 0.3);
    border-top-color: #bdce89;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

/* Responsive */
@media (max-width: 768px) {
    .modal-container {
        width: 95%;
        padding: 1rem;
        padding-bottom: 1.25rem !important;
    }
    .backup-type-btn {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
    .wallet-select-menu {
        max-height: min(260px, calc(80vh - 210px));
    }
}

/* Text Colors */
.text-on-surface {
    color: #e4e2e1;
}

.text-on-surface-variant {
    color: #c3c8c1;
}

.bg-surface-container-low {
    background-color: #2a2a2a;
}


/* Prevent header flash before utility CSS finishes */
.site-header .site-brand,
.site-header .site-actions { min-width: 0; }

/* Better wallet dropdown rendering */
.wallet-select-wrap { isolation: isolate; }
.wallet-select-trigger { min-height: 54px; }
.wallet-selected-value,
.wallet-option {
    min-width: 0;
}
.wallet-option,
.wallet-selected-value span:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wallet-option-logo,
.wallet-selected-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.wallet-select-menu {
    overscroll-behavior: contain;
}

/* Mobile menu overlay dropping down from header */
body.menu-open { overflow: hidden; }
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    top: 0;
    background: rgba(8, 10, 8, 0.72);
    backdrop-filter: blur(10px);
    z-index: 1200;
    display: none;
    padding-top: 72px;
    border: 0;
    transform: none;
}
.mobile-menu-overlay.open { display: block; }
.mobile-menu-panel {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 72px);
    background: #1f2020;
    border-top: 1px solid rgba(189, 206, 137, 0.16);
    border-bottom: 1px solid rgba(189, 206, 137, 0.16);
    box-shadow: 0 18px 42px rgba(0,0,0,.38);
    display: flex;
    flex-direction: column;
    transform: translateY(-14px);
    opacity: 0;
    transition: transform .22s ease, opacity .22s ease;
}
.mobile-menu-overlay.open .mobile-menu-panel {
    transform: translateY(0);
    opacity: 1;
}
.mobile-menu-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(189, 206, 137, 0.14);
}
.mobile-menu-close {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(189, 206, 137, 0.22);
    background: #2a2a2a;
    color: #bdce89;
    cursor: pointer;
}
.mobile-menu-links {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}
.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 15px;
    border-radius: 14px;
    color: #e4e2e1;
    text-decoration: none;
    background: transparent;
}
.mobile-menu-link .material-symbols-outlined,
.mobile-menu-link .site-inline-icon {
    font-size: 1.2rem;
    color: #bdce89;
    flex-shrink: 0;
}
.mobile-menu-link.active,
.mobile-menu-link:hover {
    background: rgba(189, 206, 137, 0.12);
    color: #bdce89;
}
.mobile-menu-footer {
    margin-top: auto;
    padding: 18px 16px 20px;
    border-top: 1px solid rgba(189, 206, 137, 0.14);
    background: linear-gradient(180deg, rgba(31,32,32,0.85), #1f2020);
}

@media (max-width: 768px) {
    .wallet-select-wrap { margin-bottom: 0.75rem; }
    .wallet-select-trigger {
        padding: 12px;
        gap: 0.75rem;
    }
    .wallet-option-logo,
    .wallet-fallback-icon,
    .wallet-selected-logo {
        width: 20px;
        height: 20px;
    }
    .wallet-select-menu {
        position: absolute;
        left: 0;
        right: 0;
        top: calc(100% + 8px);
        max-height: 220px;
        margin-top: 0;
        width: 100%;
        box-shadow: 0 14px 28px rgba(0,0,0,.28);
    }
    .wallet-option {
        padding: 0.75rem;
        font-size: 0.92rem;
    }
}


/* Stable wallet option layout on mobile and desktop */
.wallet-option,
.wallet-selected-value {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    column-gap: 0.75rem;
}
.wallet-option > span:last-child,
.wallet-selected-value > span:last-child {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wallet-option-logo,
.wallet-selected-logo,
.wallet-fallback-icon {
    grid-column: 1;
}
.wallet-option > span:last-child,
.wallet-selected-value > span:last-child {
    grid-column: 2;
}

/* Additional critical header styling to reduce hard-refresh distortion */
.site-header,
header.site-header {
    min-height: 73px;
}
.site-header-inner {
    min-height: 73px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-desktop-nav a,
.site-actions button,
.site-actions span,
.site-brand a,
.site-brand span {
    flex-shrink: 0;
}
@media (min-width: 768px) {
    .site-header .site-actions {
        min-width: max-content;
    }
}


/* Final targeted fixes for wallet dropdown, mobile menu, checkboxes, and header stability */
.wallet-native-select{
    position:absolute !important;
    width:1px !important;
    height:1px !important;
    padding:0 !important;
    margin:-1px !important;
    overflow:hidden !important;
    clip:rect(0,0,0,0) !important;
    clip-path:inset(50%) !important;
    white-space:nowrap !important;
    border:0 !important;
    opacity:0 !important;
    pointer-events:none !important;
}
.wallet-select-wrap{position:relative; isolation:isolate;}
.wallet-select-trigger,
.wallet-selected-value,
.wallet-option{
    text-align:left !important;
    justify-content:flex-start !important;
    align-items:center !important;
}
.wallet-selected-value,
.wallet-option{
    display:flex !important;
    gap:0.75rem !important;
}
.wallet-select-trigger{min-height:54px;}
.wallet-select-menu{
    display:none;
    overflow-x:hidden !important;
    overflow-y:auto !important;
}
.wallet-select-wrap.open .wallet-select-menu{display:block;}
.wallet-option{
    width:100%;
    padding:0.75rem 0.85rem;
}
.wallet-option > span:last-child,
.wallet-selected-value > span:last-child{
    flex:1 1 auto;
    min-width:0;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.wallet-option-logo,
.wallet-selected-logo,
.wallet-fallback-icon{
    width:22px;
    height:22px;
    flex:0 0 22px;
}
input[type="checkbox"]{
    appearance:auto !important;
    -webkit-appearance:checkbox !important;
    accent-color:#bdce89;
    width:16px;
    height:16px;
    flex:0 0 16px;
    cursor:pointer;
    pointer-events:auto;
}
label:has(input[type="checkbox"]) { user-select:none; }

body.menu-open{overflow:hidden;}
.mobile-menu-overlay{
    position:fixed;
    inset:0;
    top:0;
    display:none;
    background:rgba(8,10,8,.56);
    backdrop-filter:blur(8px);
    z-index:1200;
    padding-top:72px;
}
.mobile-menu-overlay.open{display:block;}
.mobile-menu-panel{
    margin-left:auto;
    width:min(52vw,280px);
    min-width:220px;
    max-width:280px;
    height:calc(100dvh - 72px);
    max-height:none;
    background:#1f2020;
    border-left:1px solid rgba(189,206,137,.16);
    border-top:1px solid rgba(189,206,137,.16);
    box-shadow:-14px 18px 42px rgba(0,0,0,.38);
    display:flex;
    flex-direction:column;
    transform:translateX(24px);
    opacity:0;
    transition:transform .22s ease, opacity .22s ease;
}
.mobile-menu-overlay.open .mobile-menu-panel{
    transform:translateX(0);
    opacity:1;
}
.mobile-menu-topbar{
    padding:16px 16px 12px;
}
.mobile-menu-close{
    margin-left:auto;
}
.mobile-menu-links{
    display:flex !important;
    flex-direction:column !important;
    gap:10px !important;
    align-items:stretch !important;
    padding:14px 16px;
}
.mobile-menu-link{
    display:flex !important;
    width:100% !important;
    align-items:center;
    justify-content:flex-start;
    gap:12px;
    text-align:left;
}
.mobile-menu-footer{ margin-top:auto; }

@media (max-width:768px){
    .wallet-select-wrap{overflow:visible;}
    .wallet-select-trigger{padding:12px;}
    .wallet-select-menu{
        left:0;
        right:0;
        top:calc(100% + 8px);
        width:100%;
        max-width:100%;
        max-height:220px;
        padding:0.35rem;
    }
    .wallet-selected-value,
    .wallet-option{
        min-width:0;
        width:100%;
        gap:0.65rem !important;
    }
    .wallet-option-logo,
    .wallet-selected-logo,
    .wallet-fallback-icon{
        width:20px;
        height:20px;
        flex:0 0 20px;
    }
    .mobile-menu-panel{
        width:min(50vw,250px);
        min-width:210px;
    }
}


/* Critical icon stability */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined', sans-serif;
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    overflow: hidden;
}
html:not(.material-symbols-ready) .site-header .material-symbols-outlined,
html:not(.material-symbols-ready) #backupModal .material-symbols-outlined,
html:not(.material-symbols-ready) .mobile-menu-overlay .material-symbols-outlined {
    visibility: hidden;
    opacity: 0;
}

.password-field-wrap {
    position: relative;
}
.password-visibility-toggle {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #bdce89;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
}
.password-visibility-toggle svg {
    width: 1.3rem;
    height: 1.3rem;
}
.password-visibility-toggle .eye-slash{
    opacity:1;
    transition:opacity .18s ease;
}
.password-visibility-toggle.is-active .eye-slash{
    opacity:0;
}
.password-visibility-toggle:focus-visible {
    outline: 2px solid rgba(189,206,137,.55);
    outline-offset: 2px;
    border-radius: 0.55rem;
}


/* v8 targeted fixes */
.password-field-wrap{position:relative;}
.password-visibility-toggle{
    position:absolute;
    right:0.7rem;
    top:50%;
    transform:translateY(-50%);
    width:2.25rem;
    height:2.25rem;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:999px;
    border:1px solid rgba(189,206,137,.18);
    background:transparent;
    color:#a7af96;
    transition:background .18s ease,border-color .18s ease,color .18s ease,box-shadow .18s ease;
    z-index:2;
}
.password-visibility-toggle:hover,
.password-visibility-toggle:focus-visible{
    background:rgba(189,206,137,.10);
    border-color:rgba(189,206,137,.36);
    color:#d9e8ae;
    outline:none;
}
.password-visibility-toggle.is-active{
    background:rgba(189,206,137,.18);
    border-color:#bdce89;
    color:#bdce89;
    box-shadow:0 0 0 2px rgba(189,206,137,.12);
}
.password-visibility-toggle svg{width:1.2rem;height:1.2rem;display:block;}
.mobile-menu-shell .material-symbols-outlined{visibility:visible !important;opacity:1 !important;}
@media (max-width:767.98px){
  .md\:hidden{display:inline-flex !important;}
  .site-actions .md\:hidden.mobile-menu-shell{display:inline-flex !important;}
  .password-visibility-toggle{right:0.6rem;width:2.1rem;height:2.1rem;}
}
@media (min-width:768px){
  .md\:hidden{display:none !important;}
}


/* v10 targeted fixes */
.password-field-wrap{min-height:3.25rem;}
.password-field-wrap #zipPassword{padding-right:3.4rem;}
.password-visibility-toggle{
    display:flex !important;
    visibility:visible !important;
    opacity:1 !important;
    pointer-events:auto !important;
    -webkit-appearance:none;
    appearance:none;
}
@media (max-width:767.98px){
  .password-field-wrap{min-height:3.15rem;}
  .password-field-wrap #zipPassword{padding-right:3.2rem;}
  .password-visibility-toggle{
      right:0.55rem;
      width:2.15rem;
      height:2.15rem;
  }
}

.mobile-menu-shell svg,.mobile-menu-shell .site-inline-icon{display:block;width:1.45rem;height:1.45rem;visibility:visible;opacity:1;}

.password-visibility-toggle .eye-slash{opacity:1 !important;}
.password-visibility-toggle.is-active .eye-slash{opacity:0 !important;}
@media (max-width:767.98px){.password-visibility-toggle{display:flex !important;visibility:visible !important;opacity:1 !important;}}
