/* ============================================
   SYREEN WALLET — Styles
   ============================================ */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #222240;
    --accent-1: #6c63ff;
    --accent-2: #00d4aa;
    --accent-3: #ffd93d;
    --accent-4: #ff6b6b;
    --accent-gradient: linear-gradient(135deg, #6c63ff, #00d4aa);
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-dim: #888;
    --border-color: rgba(108, 99, 255, 0.15);
    --border-hover: rgba(108, 99, 255, 0.4);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s ease;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-secondary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-1); text-decoration: none; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(108,99,255,0.3); border-radius: 2px; }

/* ============================================
   Screens
   ============================================ */

.screen {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-primary);
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

.screen-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
}

.screen-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    padding-bottom: 40px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

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

/* ============================================
   Logo
   ============================================ */

.logo-large { margin-bottom: 24px; }

.logo-icon-lg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: var(--accent-gradient);
    border-radius: 24px;
    color: #fff;
    font-weight: 800;
    font-size: 2.5rem;
    box-shadow: 0 8px 32px rgba(108, 99, 255, 0.3);
}

.logo-icon-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--accent-gradient);
    border-radius: 8px;
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
}

h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-dim);
    font-size: 1.05rem;
    margin-bottom: 40px;
    max-width: 460px;
}

.version-tag {
    margin-top: 32px;
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    opacity: 0.6;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
}

.btn-full { width: 100%; }

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 28px rgba(108, 99, 255, 0.4);
}

.btn-primary:active { transform: translateY(0); }

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

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
    border-color: var(--accent-1);
    background: rgba(108, 99, 255, 0.05);
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.85rem;
}

.btn-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 400px;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

.btn-icon-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-icon-sm:hover { background: rgba(255,255,255,0.15); color: var(--text-primary); }

.btn-icon-sm svg { width: 14px; height: 14px; }

.btn-text {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    margin-top: 16px;
    transition: color var(--transition);
}

.btn-text:hover { color: var(--accent-4); }

.btn-text-sm {
    background: none;
    border: none;
    color: var(--accent-1);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    transition: color var(--transition);
}

.btn-text-sm:hover { color: var(--accent-2); }

.btn-inline {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(108, 99, 255, 0.15);
    border: none;
    color: var(--accent-1);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0.05em;
    transition: all var(--transition);
}

.btn-inline:hover { background: rgba(108, 99, 255, 0.25); }

/* ============================================
   Screen Header
   ============================================ */

.screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 12px;
}

.screen-header > div:last-child { width: 40px; }

/* ============================================
   Warning Banner
   ============================================ */

.warning-banner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    background: rgba(255, 217, 61, 0.08);
    border: 1px solid rgba(255, 217, 61, 0.2);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
}

.warning-banner > svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--accent-3);
    margin-top: 2px;
}

.warning-banner strong {
    display: block;
    color: var(--accent-3);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.warning-banner p {
    font-size: 0.82rem;
    color: var(--text-dim);
    line-height: 1.5;
}

/* ============================================
   Mnemonic Grid
   ============================================ */

.mnemonic-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.mnemonic-word {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.mnemonic-word .word-num {
    color: var(--text-dim);
    font-size: 0.7rem;
    min-width: 18px;
}

/* ============================================
   Checkbox
   ============================================ */

.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 20px;
    user-select: none;
}

.checkbox-wrap input { display: none; }

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    flex-shrink: 0;
    transition: all var(--transition);
    position: relative;
}

.checkbox-wrap input:checked + .checkmark {
    background: var(--accent-1);
    border-color: var(--accent-1);
}

.checkbox-wrap input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ============================================
   Forms
   ============================================ */

.form-desc {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition);
    outline: none;
}

.form-group textarea {
    resize: vertical;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.input-with-btn {
    position: relative;
}

.input-with-btn input {
    padding-right: 60px;
}

/* ============================================
   Dashboard
   ============================================ */

.dash-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.dash-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.balance-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 40px 32px;
    text-align: center;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
}

.balance-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.balance-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

#balanceAmount {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.02em;
}

.balance-denom {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-2);
}

.balance-address {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50px;
}

#addressText {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--text-dim);
}

/* ============================================
   Action Buttons
   ============================================ */

.action-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
}

.action-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.action-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(108, 99, 255, 0.12);
    color: var(--accent-1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-icon svg { width: 22px; height: 22px; }

.action-icon.accent-2 { background: rgba(0, 212, 170, 0.12); color: var(--accent-2); }
.action-icon.accent-3 { background: rgba(255, 217, 61, 0.12); color: var(--accent-3); }
.action-icon.accent-4 { background: rgba(255, 107, 107, 0.1); color: var(--accent-4); }

/* ============================================
   Transactions
   ============================================ */

.tx-section { margin-top: 8px; }

.tx-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.tx-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.tx-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tx-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
    font-size: 0.9rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.tx-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.tx-item:hover { background: var(--bg-card-hover); }

.tx-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tx-icon svg { width: 18px; height: 18px; }

.tx-icon.tx-sent { background: rgba(255, 107, 107, 0.1); color: var(--accent-4); }
.tx-icon.tx-received { background: rgba(0, 212, 170, 0.1); color: var(--accent-2); }

.tx-info {
    flex: 1;
    min-width: 0;
}

.tx-type {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tx-addr {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tx-right {
    text-align: right;
    flex-shrink: 0;
}

.tx-amount {
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.tx-amount.sent { color: var(--accent-4); }
.tx-amount.received { color: var(--accent-2); }

.tx-date {
    font-size: 0.7rem;
    color: var(--text-dim);
}

/* ============================================
   Modals
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100;
    align-items: flex-end;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeInBg 0.2s ease;
}

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

.modal-content {
    position: relative;
    width: 100%;
    max-width: 560px;
    background: var(--bg-secondary);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 24px;
    padding-bottom: 40px;
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.close-modal {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Fee Display */
.fee-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.fee-amount {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Receive */
.receive-content { text-align: center; }

.qr-wrapper {
    background: #ffffff;
    border-radius: var(--radius-sm);
    padding: 20px;
    display: inline-block;
    margin-bottom: 20px;
}

.qr-image {
    width: 200px;
    height: 200px;
    display: block;
}

.receive-address {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.receive-address code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--text-secondary);
    word-break: break-all;
    background: var(--bg-card);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    width: 100%;
    text-align: center;
}

/* Coming Soon */
.coming-soon {
    text-align: center;
    padding: 32px 20px;
}

.coming-soon-icon {
    width: 48px;
    height: 48px;
    color: var(--accent-3);
    margin-bottom: 16px;
}

.coming-soon h4 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.coming-soon p {
    font-size: 0.9rem;
    color: var(--text-dim);
}

/* ============================================
   Toasts
   ============================================ */

#toastContainer {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
}

.toast {
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    pointer-events: auto;
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast.success { background: rgba(0, 212, 170, 0.9); }
.toast.error { background: rgba(255, 107, 107, 0.9); }
.toast.info { background: rgba(108, 99, 255, 0.9); }

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

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

/* ============================================
   Loading Spinner
   ============================================ */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ============================================
   Responsive
   ============================================ */

/* Desktop — full width, no side borders */
@media (min-width: 901px) {
    .screen {
        max-width: 100%;
    }
    .screen-scroll {
        max-width: 960px;
    }
    .screen-center {
        max-width: 960px;
        margin: 0 auto;
    }
    .balance-card {
        padding: 48px 40px;
    }
    #balanceAmount {
        font-size: 3.5rem;
    }
    .action-row {
        max-width: 500px;
        margin: 0 auto 28px;
    }
    .action-btn {
        padding: 20px 12px;
    }
    .action-icon {
        width: 52px;
        height: 52px;
    }
    .mnemonic-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    h1 {
        font-size: 2.4rem;
    }
    .tx-item {
        padding: 16px 20px;
    }
    .modal-content {
        max-width: 600px;
        border-radius: var(--radius);
        margin-bottom: 5vh;
    }
    .modal {
        align-items: center;
    }
}

/* Tablet */
@media (max-width: 900px) and (min-width: 521px) {
    .screen {
        max-width: 100%;
    }
    .mnemonic-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Small mobile */
@media (max-width: 520px) {
    .screen-scroll {
        padding: 20px;
    }
    .mnemonic-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    #balanceAmount {
        font-size: 2.2rem;
    }
    .balance-card {
        padding: 28px 20px;
    }
    h1 {
        font-size: 1.6rem;
    }
}

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

    .action-row {
        grid-template-columns: repeat(2, 1fr);
    }

    #balanceAmount {
        font-size: 1.8rem;
    }

    .balance-card {
        padding: 20px;
    }
}
