/* metanet.css - Erweitert für Wallet & QR Code Features */
:root{
    --bg:#0b1020;
    --fg:#e7ecf3;
    --muted:#9fb3c8;
    --accent:#9ce07b;
    --card:#151d34;
    --ok:#7dd97d;
    --border:#1f2a4b;
    --brand:#0f1730;
    --error:#e74c3c;
    --warn:#e67e22;
}

* {
    box-sizing:border-box;
}

html, body {
    height:100%;
    margin:0;
}

body {
    background:linear-gradient(180deg,#0b1020,#0d1228 40%,#0b1020);
    color:var(--fg);
    font:14px/1.4 system-ui,-apple-system,sans-serif;
}

header {
    display:flex;
    gap:10px;
    align-items:center;
    padding:10px 12px;
    background:#0c1327;
    border-bottom:1px solid var(--border);
    position:sticky;
    top:0;
    z-index:100;
    flex-wrap:wrap;
}

.brand {
    font-weight:800;
    letter-spacing:.2px;
}

.brand .dot {
    color:var(--accent);
}

input, button, select {
    font:inherit;
}

input[type="text"], select {
    flex:1;
    min-width:120px;
    max-width:400px;
    padding:8px 10px;
    border-radius:10px;
    border:1px solid var(--border);
    background:#0e1530;
    color:var(--fg);
    outline:none;
}

#txidInput {
    min-width:300px;
}

input[type="text"]::placeholder {
    color:#91a2ba;
}

button {
    padding:8px 12px;
    border:1px solid var(--border);
    background:#0e1530;
    color:var(--fg);
    border-radius:10px;
    cursor:pointer;
}

button:hover {
    border-color:#2a3b6b;
}

button.secondary {
    background:#0b1328;
}

button.ghost {
    background:transparent;
    border-color:transparent;
    padding:4px 8px;
}

a.ghost {
    background:transparent;
    border:1px solid transparent;
    padding:4px 8px;
    border-radius:10px;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    text-decoration:none;
    color:var(--fg);
    font-size:14px;
}

a.ghost:hover {
    border-color:#2a3b6b;
}

button.primary {
    background:var(--accent);
    color:#00223a;
    border-color:var(--accent);
}

main {
    display:grid;
    grid-template-columns:320px 1fr;
    gap:12px;
    padding:12px;
    align-items:start;
}

aside, section {
    background:var(--card);
    border:1px solid var(--border);
    border-radius:14px;
    overflow:hidden;
}

aside {
    padding:10px;
}

.section-head {
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:10px 12px;
    border-bottom:1px solid var(--border);
    background:#0e1530;
}

.pane {
    padding:10px 12px;
}

.list {
    max-height:280px;
    overflow:auto;
    border:1px solid var(--border);
    border-radius:10px;
    background:#0e1530;
    padding:4px;
}

.muted {
    color:var(--muted);
}

.ok {
    color:var(--ok);
}

.warn {
    color:var(--warn);
}

.error {
    color:var(--error);
}

.grid {
    display:grid;
    gap:10px;
}

#iframeWrap {
    border:1px solid var(--border);
    border-radius:12px;
    overflow:hidden;
    position:relative;
}

#sandbox {
    width:100%;
    height:480px;
    border:0;
    background:#fff;
}

/* Sandbox Security Warning */
#iframeWrap::before {
    content:'🔒 Sandbox (scripts isolated)';
    position:absolute;
    top:4px;
    right:4px;
    background:rgba(11,16,32,0.8);
    color:var(--accent);
    font-size:10px;
    padding:2px 6px;
    border-radius:4px;
    z-index:1;
    pointer-events:none;
}

.row {
    display:flex;
    gap:8px;
    align-items:center;
}

.stack {
    display:flex;
    flex-direction:column;
    gap:6px;
}

.vlist {
    height:240px;
    overflow:auto;
    border:1px solid var(--border);
    border-radius:10px;
}

.push-item {
    padding:8px 10px;
    border-bottom:1px solid #1b2445;
}

.push-item:last-child {
    border-bottom:0;
}

footer {
    padding:10px 12px;
    color:var(--muted);
}

.kbd {
    border:1px solid #2a3b6b;
    border-bottom-width:2px;
    padding:1px 6px;
    border-radius:6px;
    background:#0f1730;
    color:#b9c6da;
}

.pill {
    padding:2px 8px;
    border-radius:999px;
    background:#0f1730;
    border:1px solid var(--border);
    font-size:12px;
}

.split {
    display:flex;
    gap:12px;
}

.grow {
    flex:1;
}

.small {
    font-size:12px;
}

.monospace {
    font-family:monospace;
}

.hidden {
    display:none !important;
}

#online-status {
    width:8px;
    height:8px;
    border-radius:50%;
    background:#777;
    display:inline-block;
    margin-left:6px;
}

#online-status.online {
    background:#2ecc71;
}

#online-status.offline {
    background:#e67e22;
}

.toast-container {
    position:fixed;
    right:16px;
    bottom:16px;
    display:flex;
    flex-direction:column;
    gap:8px;
    z-index:9999;
}

/* TOAST STYLES MOVED TO css/toast-clean.css */
/* DO NOT ADD TOAST STYLES HERE - THEY ARE CENTRALIZED! */

.tree-node {
    padding: 2px 0;
    margin-left: 15px;
    width: 100%;
    overflow: hidden;
}

.tree-txid {
    color: var(--accent);
    cursor: pointer;
    font-size: 12px;
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-txid.url-link {
    /* URLs: Zeige mehr, nutze volle Breite */
    color: #4caf50;
    font-size: 11px;
}

.tree-txid:hover {
    text-decoration: underline;
    white-space: normal;
    word-break: break-all;
}

.debug-mode .debug-only {
    display:block !important;
}

.debug-only {
    display:none;
}

.error-display {
    padding:10px;
    background:#3a0f19;
    border-radius:8px;
    color:#e74c3c;
    margin:10px 0;
}

/* Progress Bar */
.progress-bar {
    padding:10px;
    background:#0e1530;
    border-radius:8px;
    margin:10px 0;
}

.progress-track {
    height:20px;
    background:#1b2445;
    border-radius:10px;
    overflow:hidden;
    margin-bottom:5px;
}

.progress-fill {
    height:100%;
    background:var(--accent);
    width:0;
    transition:width 0.3s ease;
}

.progress-text {
    font-size:12px;
    color:var(--muted);
}

/* Dialog */
.dialog {
    border:1px solid var(--border);
    border-radius:12px;
    background:var(--card);
    color:var(--fg);
    padding:0;
    min-width:400px;
    max-width:600px;
    box-shadow:0 10px 40px rgba(0,0,0,.5);
}

.dialog::backdrop {
    background:rgba(11,16,32,0.8);
}

.dialog-content {
    padding:20px;
}

.dialog-content h3 {
    margin:0 0 15px 0;
    color:var(--accent);
}

.dialog-label {
    display:block;
    margin-bottom:5px;
    font-size:12px;
    color:var(--muted);
}

.dialog-input {
    width:100%;
    padding:8px 10px;
    border-radius:8px;
    border:1px solid var(--border);
    background:#0e1530;
    color:var(--fg);
    margin-bottom:15px;
}

.dialog-buttons {
    display:flex;
    justify-content:flex-end;
    gap:10px;
}

/* Bookmark Liste mit Namen */
.bookmark-item {
    padding:8px;
    border-bottom:1px solid var(--border);
    cursor:pointer;
}

.bookmark-item:hover {
    background:#1b2445;
}

.bookmark-name {
    font-weight:600;
    color:var(--accent);
    font-size:13px;
}

.bookmark-txid {
    font-size:11px;
    color:var(--muted);
    font-family:monospace;
}

.bookmark-date {
    font-size:10px;
    color:var(--muted);
}

/* Provider Status */
#providerStatus {
    font-weight:600;
}

/* Wallet Info */
.wallet-info {
    background:#0e1530;
    border:1px solid var(--border);
    border-radius:8px;
    padding:10px;
    margin:10px 0;
}

#walletBalance {
    color:var(--accent);
    margin-top:5px;
}

/* QR Code Container */
.qr-container {
    display:flex;
    justify-content:center;
    align-items:center;
    padding:20px;
    background:white;
    border-radius:12px;
    margin:20px 0;
}

.qr-info {
    text-align:center;
    padding:10px;
}

.qr-info p {
    margin:5px 0;
}

/* Wallet Button */
#walletBtn {
    color:var(--warn);
}

#walletBtn:hover {
    color:var(--accent);
}

/* Import/Export Buttons */
#importBookmarksBtn, #exportBookmarksBtn {
    padding:4px 8px;
    font-size:11px;
}

/* Unsafe Content Warning Dialog */
.unsafe-content-dialog {
    min-width:480px;
    max-width:600px;
}

.warning-header {
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:16px;
    padding-bottom:12px;
    border-bottom:1px solid var(--border);
}

.warning-icon {
    font-size:32px;
}

.warning-header h3 {
    margin:0;
    color:var(--warn);
}

.warning-body {
    margin-bottom:20px;
}

.warning-body p {
    margin:10px 0;
}

.issue-list {
    background:#0e1530;
    border:1px solid var(--border);
    border-radius:8px;
    padding:12px 12px 12px 30px;
    margin:10px 0;
    color:var(--warn);
}

.issue-list li {
    margin:6px 0;
}

.warning-note {
    background:#0e1530;
    border-left:3px solid var(--accent);
    padding:10px 12px;
    margin:12px 0;
    border-radius:4px;
    font-size:13px;
}

.warning-note.secondary {
    border-left-color:var(--muted);
}

.warning-note strong {
    color:var(--accent);
}

/* OP_RETURN Viewer */
.opreturn-viewer {
    border:1px solid var(--border);
    border-radius:8px;
    overflow:hidden;
    margin:10px 0;
}

.protocol-badge {
    background:var(--accent);
    color:#00223a;
    padding:6px 12px;
    font-weight:600;
    font-size:12px;
}

.json-viewer {
    background:#0e1530;
    padding:12px;
    margin:0;
    overflow-x:auto;
    font-size:12px;
    color:var(--fg);
}

/* WalletMail Message Content */
.message-section {
    margin-top:15px;
    padding-top:15px;
    border-top:1px solid var(--border);
}

.message-header {
    margin:0 0 10px 0;
    color:var(--accent);
    font-size:14px;
    font-weight:600;
}

/* =============================================================================
   VIEW MODES - User vs Expert
   ============================================================================= */

/* Expert Mode (default) - Alles sichtbar */
body[data-view-mode="expert"] main {
    grid-template-columns: 320px 1fr;
}

body[data-view-mode="expert"] aside {
    display: flex;
}

body[data-view-mode="expert"] .section-head .row {
    display: flex;
}

body[data-view-mode="expert"] .pane.grid {
    display: grid;
}

/* User Mode - Clean & Simple */
body[data-view-mode="user"] main {
    grid-template-columns: 1fr;
    gap: 0;
}

body[data-view-mode="user"] aside {
    display: none;
}

body[data-view-mode="user"] .section-head {
    display: none;
}

body[data-view-mode="user"] .pane.grid {
    display: none;
}

body[data-view-mode="user"] footer {
    display: none;
}

body[data-view-mode="user"] #sandbox {
    height: calc(100vh - 120px);
    border-radius: 0;
}

body[data-view-mode="user"] section {
    border: none;
    border-radius: 0;
}

body[data-view-mode="user"] #errorDisplay {
    margin: 20px;
}

body[data-view-mode="user"] #progressBar {
    margin: 20px;
}

/* View Toggle Button Indicator */
#viewToggleBtn[data-mode="user"] {
    color: var(--accent);
    font-weight: bold;
}

/* =============================================================================
   METANET DESKTOP STATUS
   ============================================================================= */

.metanet-status {
    background: #0e1530;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--muted);
    animation: pulse 2s infinite;
}

.status-dot.available {
    background: var(--ok);
    animation: none;
}

.status-dot.unavailable {
    background: var(--error);
    animation: none;
}

.status-text {
    font-size: 13px;
    color: var(--muted);
}

.status-text.available {
    color: var(--ok);
    font-weight: 600;
}

.status-text.unavailable {
    color: var(--error);
}

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

#metanetImport, #metanetDownload {
    width: 100%;
    margin-top: 8px;
}

/* =============================================================================
   RESPONSIVE NAVIGATION
   ============================================================================= */

/* Menu Toggle Button (Hamburger) */
.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--fg);
    font-size: 20px;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 8px;
}

.menu-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Main Navigation */
.main-nav {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-item .label {
    display: inline;
}

.nav-item .icon {
    display: inline;
}

/* Status Pill - Always visible */
.status-pill {
    margin-left: auto;
}

/* Pitchdeck Link Styling */
#pitchdeckBtn {
    color: var(--accent);
    font-weight: 600;
}

#pitchdeckBtn:hover {
    background: rgba(156, 224, 123, 0.1);
}

/* =============================================================================
   RESPONSIVE BREAKPOINTS
   ============================================================================= */

/* Tablet: 768px - 1024px */
@media (max-width: 1024px) {
    .nav-item .label {
        display: none;
    }

    .nav-item .icon {
        font-size: 18px;
    }

    #txidInput {
        min-width: 200px;
    }
}

/* Mobile: Below 768px */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        order: -1;
    }

    header {
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .brand {
        order: 0;
        flex: 1;
    }

    #txidInput {
        order: 1;
        width: 100%;
        min-width: 100%;
        flex: 1 1 100%;
    }

    #loadBtn {
        order: 2;
    }

    #retryBtn {
        order: 3;
    }

    .status-pill {
        order: 4;
        margin-left: auto;
    }

    .main-nav {
        order: 5;
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 8px;
        padding: 12px 0;
        border-top: 1px solid var(--border);
        margin-top: 8px;
    }

    .main-nav.open {
        display: flex;
    }

    .nav-item {
        width: 100%;
        justify-content: flex-start;
        padding: 10px 12px;
        border-radius: 8px;
        background: #0e1530;
        border: 1px solid var(--border);
    }

    .nav-item .label {
        display: inline;
        margin-left: 8px;
    }

    .nav-item .icon {
        font-size: 18px;
        min-width: 24px;
    }

    .nav-item:hover {
        background: #1b2445;
        border-color: var(--accent);
    }

    select.nav-item {
        width: 100%;
    }

    /* Adjust main layout for mobile */
    main {
        grid-template-columns: 1fr;
        padding: 8px;
    }

    aside {
        display: none;
    }

    body[data-view-mode="expert"] main {
        grid-template-columns: 1fr;
    }

    body[data-view-mode="expert"] aside {
        display: none;
    }
}

/* Small Mobile: Below 480px */
@media (max-width: 480px) {
    header {
        padding: 8px;
        gap: 6px;
    }

    .brand {
        font-size: 14px;
    }

    #loadBtn, #retryBtn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .nav-item {
        font-size: 13px;
    }

    #sandbox {
        height: 400px;
    }
}

/* ===== REFACTOR BUTTON - Normal Style ===== */
#refactorBtn {
    /* Wie die anderen ghost buttons, aber etwas sichtbarer */
}