:root {
    --bg-color: #0d1117;
    --text-color: #c9d1d9;
    --accent-color: #f7931a;
    --accent-glow: rgba(247, 147, 26, 0.4);
    --inscription-color: #58a6ff;
    --surface-color: #161b22;
    --border-color: #30363d;
    --terminal-bg: #000000;
    --terminal-text: #00ff00;
}

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

body { background-color: var(--bg-color); color: var(--text-color); font-family: 'Inter', sans-serif; min-height: 100vh; display: flex; justify-content: center; align-items: flex-start; padding: 40px 20px; }
.mono { font-family: 'Space Mono', monospace; }
.mt-1 { margin-top: 5px; }
.mt-4 { margin-top: 20px; }
.hidden { display: none !important; }

.container { width: 100%; max-width: 1200px; background: var(--surface-color); border: 1px solid var(--border-color); border-radius: 16px; padding: 30px; box-shadow: 0 20px 40px rgba(0,0,0,0.5); }

header { text-align: center; margin-bottom: 25px; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; }
.brand { display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 5px; }
.logo { font-size: 2.2rem; color: var(--accent-color); text-shadow: 0 0 15px var(--accent-glow); }
h1 { font-size: 1.8rem; font-weight: 700; color: #fff; letter-spacing: -0.5px; }
.subtitle { color: #8b949e; font-size: 0.95rem; margin-bottom: 20px; }

/* Wallet Connect & Tabs */
.wallet-section { margin-bottom: 20px; display: flex; justify-content: center; align-items: center; gap: 10px; }
#walletAddressDisplay { background: #0d1117; border: 1px solid var(--border-color); padding: 8px 15px; border-radius: 6px; color: var(--inscription-color); font-size: 0.9rem; }
.tabs { display: flex; justify-content: center; gap: 10px; }
.tab-btn { background: transparent; color: #8b949e; border: 1px solid var(--border-color); padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: 600; transition: all 0.2s; }
.tab-btn:hover { background: #21262d; color: #fff; }
.tab-btn.active { background: #21262d; color: var(--accent-color); border-color: var(--accent-color); box-shadow: 0 0 10px var(--accent-glow); }

.view { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Minter View */
.dashboard-area { display: flex; gap: 40px; align-items: stretch; }
.control-panel { flex: 1; display: flex; flex-direction: column; gap: 20px; }
.visualization-panel { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #0d1117; border-radius: 12px; border: 1px solid var(--border-color); padding: 30px; }

/* Inputs & Buttons */
.input-section { background: #0d1117; border: 1px solid var(--border-color); padding: 20px; border-radius: 12px; }
.input-section h2 { font-size: 1.2rem; margin-bottom: 15px; color: #fff; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 0.9rem; color: #8b949e; margin-bottom: 6px; }
.form-group input, .form-group textarea { width: 100%; background: var(--surface-color); border: 1px solid var(--border-color); color: #fff; padding: 10px; border-radius: 6px; font-family: 'Space Mono', monospace; font-size: 0.9rem; resize: vertical; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--inscription-color); box-shadow: 0 0 8px rgba(88, 166, 255, 0.3); }

.primary-btn { width: 100%; background: var(--accent-color); color: #000; border: none; padding: 12px; font-size: 1rem; font-weight: 700; font-family: 'Space Mono', monospace; border-radius: 6px; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 4px 15px var(--accent-glow); }
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px var(--accent-glow); background: #ffaa33; }
.primary-btn:active { transform: translateY(0); }
.primary-btn:disabled { background: #444; color: #888; cursor: not-allowed; box-shadow: none; transform: none; }
.secondary-btn { background: #21262d; color: #c9d1d9; border: 1px solid var(--border-color); padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: 600; transition: all 0.2s; }
.secondary-btn:hover { background: #30363d; color: #fff; border-color: #8b949e; }
.small-btn { padding: 6px 12px; font-size: 0.85rem; }

/* Terminal panel */
.terminal-panel { background: var(--terminal-bg); border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; height: 200px; display: flex; flex-direction: column; margin-bottom: 20px; }
.terminal-header { background: #1e1e1e; padding: 8px 12px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid #333; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }
.terminal-header .title { margin-left: auto; margin-right: auto; color: #888; font-size: 0.8rem; font-family: 'Inter', sans-serif; }
.terminal-content { padding: 15px; overflow-y: auto; flex: 1; font-family: 'Space Mono', monospace; font-size: 0.85rem; color: var(--terminal-text); }
.terminal-content p { margin-bottom: 4px; line-height: 1.4; }
.terminal-content .system { color: #58a6ff; }

/* Animation Visuals */
.satoshi-container { position: relative; width: 220px; height: 220px; perspective: 1000px; }
.core-satoshi { width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #444, #111); box-shadow: 0 0 30px rgba(0,0,0,0.8) inset, 0 0 15px var(--accent-glow); border: 2px solid var(--accent-color); animation: pulseBase 4s infinite alternate; transition: all 0.5s ease; }
@keyframes pulseBase { 0% { box-shadow: 0 0 15px var(--accent-glow); } 100% { box-shadow: 0 0 35px var(--accent-glow); } }
.inscription-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 50%; display: flex; justify-content: center; align-items: center; opacity: 0; transition: opacity 1s ease-in-out; transform-style: preserve-3d; }
.inscription-layer.active { opacity: 1; }
.hex-ring { position: absolute; width: 120%; height: 120%; border: 2px dashed var(--inscription-color); border-radius: 50%; top: -10%; left: -10%; animation: rotateRing 15s linear infinite; opacity: 0; transition: opacity 0.5s ease; }
.hex-ring.spinning { opacity: 0.5; }
.data-stream { font-family: 'Space Mono', monospace; color: var(--inscription-color); font-size: 0.75rem; text-align: center; width: 85%; word-break: break-all; text-shadow: 0 0 8px rgba(88, 166, 255, 0.8); position: relative; z-index: 10; }
@keyframes rotateRing { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.status-panel { background: #000; border: 1px solid var(--border-color); width: 100%; padding: 15px; border-radius: 8px; text-align: center; font-size: 0.9rem; }
.status-panel p { margin-bottom: 5px; }
.status-waiting { color: #8b949e; }
.status-inscribed { color: var(--inscription-color); font-weight: bold; text-shadow: 0 0 5px rgba(88,166,255,0.4); }

/* Ecosystem Layout */
.ecosystem-layout { display: flex; gap: 30px; align-items: stretch; }
.mempool-section { flex: 0.35; display: flex; flex-direction: column; }
.gallery-section { flex: 0.65; display: flex; flex-direction: column; }
.section-header { margin-bottom: 20px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.section-header h2 { font-size: 1.3rem; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.gallery-section .section-header { flex-direction: row; justify-content: space-between; align-items: center; }
.pulse-dot { width: 10px; height: 10px; background-color: #27c93f; border-radius: 50%; display: inline-block; box-shadow: 0 0 8px #27c93f; animation: pulse 1.5s infinite alternate; }
@keyframes pulse { 0% { opacity: 0.4; } 100% { opacity: 1; } }

/* Mempool Feed Styles */
.mempool-feed-container { background: #000; border: 1px solid var(--border-color); border-radius: 8px; height: 500px; overflow-y: hidden; overflow-x: hidden; padding: 10px; position: relative; display: flex; flex-direction: column; }
.mempool-placeholder { color: #8b949e; text-align: center; margin-top: 50px; font-style: italic; font-size: 0.9rem; }
.tx-item { animation: slideDown 0.3s ease-out forwards; padding: 10px; border-bottom: 1px dashed #30363d; font-family: 'Space Mono', monospace; font-size: 0.8rem; word-break: break-all; color: #fff; display: flex; flex-direction: column; gap: 5px; }
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.tx-header { display: flex; justify-content: space-between; color: #8b949e; }
.tx-id { color: var(--inscription-color); cursor: pointer; }
.tx-id:hover { text-decoration: underline; }
.tx-value { color: var(--accent-color); font-weight: bold; }

/* Gallery Styles */
.loading-indicator { text-align: center; padding: 40px; color: #8b949e; display: flex; flex-direction: column; align-items: center; gap: 15px; }
.spinner { width: 40px; height: 40px; border: 4px solid rgba(88, 166, 255, 0.2); border-left-color: var(--inscription-color); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.explorer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; max-height: 500px; overflow-y: auto; padding-right: 10px; }
.explorer-card { background: #0d1117; border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; transition: transform 0.2s, box-shadow 0.2s; }
.explorer-card:hover { transform: translateY(-3px); box-shadow: 0 6px 15px rgba(0,0,0,0.5); border-color: #8b949e; }
.card-media { width: 100%; height: 220px; background: #000; display: flex; justify-content: center; align-items: center; overflow: hidden; position: relative; }
.card-media iframe, .card-media img { width: 100%; height: 100%; border: none; object-fit: contain; }
.card-media.html-type iframe { background: #fff; }
.card-details { padding: 15px; font-size: 0.85rem; }
.card-id { font-family: 'Space Mono', monospace; color: var(--inscription-color); margin-bottom: 8px; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.card-row { display: flex; justify-content: space-between; margin-bottom: 6px; }
.card-label { color: #8b949e; }
.card-value { color: #fff; }
.card-badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 0.7rem; font-weight: bold; background: rgba(88, 166, 255, 0.1); color: var(--inscription-color); margin-bottom: 5px; text-transform: uppercase; }

/* Modal Styles */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); display: flex; justify-content: center; align-items: center; z-index: 1000; backdrop-filter: blur(4px); }
.modal-content { background: var(--surface-color); padding: 30px; border-radius: 16px; width: 100%; max-width: 400px; border: 1px solid var(--border-color); box-shadow: 0 20px 50px rgba(0,0,0,0.8); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.modal-header h3 { color: #fff; font-size: 1.3rem; margin: 0; }
.close-btn { background: none; border: none; font-size: 1.5rem; color: #8b949e; cursor: pointer; }
.close-btn:hover { color: #fff; }
.modal-desc { color: #8b949e; font-size: 0.9rem; margin-bottom: 25px; line-height: 1.4; }
.wallet-options { display: flex; flex-direction: column; gap: 12px; }
.wallet-btn { display: flex; align-items: center; gap: 15px; padding: 15px; background: #0d1117; border: 1px solid var(--border-color); border-radius: 10px; color: #fff; font-size: 1rem; cursor: pointer; transition: all 0.2s; font-family: 'Inter', sans-serif; font-weight: 500; }
.wallet-btn:hover { border-color: var(--accent-color); background: #161b22; }
.wallet-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; justify-content: center; align-items: center; font-weight: bold; font-size: 1.2rem; }
.unisat-icon { background: #f7931a; color: #fff; }
.xverse-icon { background: #000; border: 1px solid #333; color: #fff; }
.modal-divider { text-align: center; color: #8b949e; font-size: 0.85rem; margin: 20px 0; position: relative; }
.modal-divider::before, .modal-divider::after { content: ""; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--border-color); }
.modal-divider::before { left: 0; }
.modal-divider::after { right: 0; }
.wallet-error { background: rgba(255, 95, 86, 0.1); color: #ff5f56; padding: 10px; border-radius: 6px; border: 1px solid rgba(255,95,86,0.2); font-size: 0.85rem; text-align: center; margin-bottom: 15px; }

footer { margin-top: 30px; text-align: center; font-size: 0.85rem; color: #6e7681; }

@media (max-width: 900px) {
    .dashboard-area { flex-direction: column; }
    .ecosystem-layout { flex-direction: column; }
    .mempool-section, .gallery-section { flex: 1; }
    .mempool-feed-container { height: 300px; }
    .explorer-grid { max-height: none; }
}
