@import url('https://fonts.cdnfonts.com/css/digital-7-mono');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
    --bg-color: #050505; /* Deep Black */
    --window-bg: #1a1a1a; /* Lighter Charcoal */
    --primary-color: #00ffbd; /* Ghost Green/Cyan - kept for accents/buttons */
    --text-color: #ffffff;
    --text-muted: #888888;
    --danger-color: #ff4d4d;
    --font-ui: 'Inter', sans-serif;
    --font-lcd: 'Digital-7 Mono', monospace;
}

html, body {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-ui);
    overflow-x: hidden;
}

.screen {
    width: 100%;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Setup Screen Specifics */
#setup-screen .btn-primary, #setup-screen .btn-secondary {
    padding: 20px; /* Wider buttons */
    font-size: 18px;
    margin-bottom: 20px;
}

/* Sunken LCD Window Style */
.sunken-window {
    background-color: var(--window-bg);
    border-radius: 8px;
    box-shadow: inset 4px 4px 8px rgba(0,0,0,0.8),
                inset -1px -1px 2px rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 20px;
    margin-bottom: 20px;
}

/* Glass/Modern Buttons */
button {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    padding: 15px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s;
    width: 100%;
    margin-bottom: 15px;
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #00aaff);
    color: #000;
    box-shadow: 0 4px 15px rgba(0, 255, 189, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 189, 0.5);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.btn-danger {
    background: linear-gradient(135deg, #ff4d4d, #990000);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 77, 77, 0.3);
}

.btn-text {
    background: none;
    color: var(--text-muted);
    font-size: 14px;
}

/* Inputs */
input, select, textarea {
    width: 100%;
    padding: 15px;
    height: 50px; /* Explicit height for mobile */
    line-height: 20px; /* Center text vertically */
    background: var(--window-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.5); /* Sunken input */
    border-radius: 8px;
    color: var(--text-color);
    box-sizing: border-box;
    margin-bottom: 15px;
    font-family: var(--font-lcd);
    font-size: 18px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Specific Styles */
.logo-container {
    text-align: center;
    margin-top: 50px;
    margin-bottom: 40px;
}

.logo-container img {
    width: 80px;
    height: 80px;
}

.logo-container h2 {
    font-family: var(--font-lcd);
    font-size: 36px;
    margin-top: 10px;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

/* Mnemonic Grid */
.mnemonic-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns for wider layout */
    gap: 15px;
    margin: 30px 0;
}

.mnemonic-word {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
}

.checkbox-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
}

.checkbox-container input {
    width: auto;
    margin-right: 15px;
    margin-bottom: 0;
    box-shadow: none;
}

/* Header */
.wallet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.network-indicator {
    font-size: 14px;
    background: rgba(255,255,255,0.05);
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.1);
}

.dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 5px var(--primary-color);
}

.settings-icon {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.settings-icon:hover {
    color: var(--text-color);
}

/* Balance Card (Sunken Window) */
.balance-card {
    background-color: var(--window-bg);
    border-radius: 12px;
    box-shadow: inset 4px 4px 10px rgba(0,0,0,0.8),
                inset -1px -1px 2px rgba(255,255,255,0.1);
    padding: 25px;
    margin-bottom: 25px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-around; /* Side-by-side */
    align-items: center;
}

.balance-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 45%;
}

.balance-amount {
    font-family: var(--font-lcd);
    font-size: 32px; /* Adjusted size */
    font-weight: normal;
    color: #fff;
    margin-bottom: 5px;
    text-shadow: 0 0 5px rgba(255,255,255,0.3);
}

.balance-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.address-pill {
    font-family: var(--font-lcd);
    font-size: 14px;
    background: rgba(0,0,0,0.5); /* Darker pill inside window */
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.1);
    color: #ccc;
    width: 100%;
    justify-content: center;
}

.chain-icon {
    font-weight: bold;
    margin-right: 8px;
    color: var(--primary-color);
}

/* Actions */
.actions-row {
    display: flex;
    justify-content: space-around; /* Spread out */
    margin-bottom: 30px;
}

.action-btn {
    background: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: auto;
    padding: 0;
    margin: 0;
}

.action-btn .icon {
    width: 60px; /* Larger buttons */
    height: 60px;
    background: linear-gradient(135deg, #333, #111);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 24px;
    margin-bottom: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    transition: all 0.2s;
}

.action-btn:hover .icon {
    background: linear-gradient(135deg, var(--primary-color), #00aaff);
    color: #000;
    transform: translateY(-2px);
}

.action-btn span {
    font-size: 14px;
    font-weight: 600;
    color: #fff; /* Ensure white text */
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    margin-bottom: 15px;
}

.tab-btn {
    background: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    width: 50%;
    color: var(--text-muted);
    font-size: 16px;
    padding: 15px;
    margin: 0;
}

.tab-btn.active {
    color: var(--text-color);
    border-bottom-color: var(--primary-color);
}

/* Token List */
.list-container {
    flex-grow: 1;
    overflow-y: auto;
}

.token-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.02);
    margin-bottom: 5px;
    border-radius: 8px;
}

.token-item:hover {
    background: rgba(255,255,255,0.05);
}

.token-left {
    display: flex;
    flex-direction: column;
}

.token-symbol {
    font-weight: bold;
    font-size: 18px;
}

.token-name {
    font-size: 14px;
    color: var(--text-muted);
}

.token-right {
    text-align: right;
}

.token-amount {
    font-family: var(--font-lcd);
    font-size: 24px;
    color: #fff;
}

/* Headers */
.sub-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.sub-header h3 {
    margin: 0;
    font-family: var(--font-lcd);
    font-size: 28px;
    font-weight: normal;
    letter-spacing: 1px;
}

.back-btn {
    width: auto;
    padding: 5px 15px;
    margin: 0;
    margin-right: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
}

/* Modal specific for Secret Key display */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--window-bg);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    width: 80%;
    max-width: 500px;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    text-align: center;
}

.modal-content h3 {
    margin-top: 0;
    font-family: var(--font-lcd);
    font-size: 24px;
}

.sensitive-data-box {
    background: #000;
    padding: 15px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    font-family: monospace;
    word-break: break-all;
    margin: 20px 0;
    color: var(--primary-color);
    max-height: 150px;
    overflow-y: auto;
}

/* Toast */
.toast {
    visibility: hidden;
    min-width: 250px;
    background-color: var(--primary-color);
    color: #000;
    text-align: center;
    border-radius: 4px;
    padding: 16px;
    position: fixed;
    z-index: 9999;
    left: 50%;
    top: 20px;
    transform: translateX(-50%);
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(0, 255, 189, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.toast.show {
    visibility: visible;
    opacity: 1;
}

/* Mobile Overrides - Make it fit on phone screen */
@media (max-width: 600px) {
    body {
        width: 100vw;
        height: 100vh;
    }
    .mnemonic-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .total-balance {
        font-size: 42px;
    }
    
    /* Fix Overflow issues on Mobile */
    .detail-value, .token-name, .address-pill, #tx-hash, #tx-from, #tx-to {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
        max-width: 100%;
        display: block;
    }

    .sunken-window {
        padding: 15px;
        overflow-x: hidden;
    }

    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        width: 50%; /* Two tabs side by side */
        font-size: 14px;
        padding: 10px;
    }

    /* Stack Token Items on Mobile */
    .token-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
    }

    .token-left {
        width: 100%;
        margin-bottom: 5px;
    }

    .token-right {
        width: 100%;
        text-align: left;
    }

    .token-amount {
        font-size: 20px; /* Slightly reduced */
    }
}
