/* public/css/style.css */
:root {
    --primary: #000;
    --accent: #27ae60;
    /* Green for value/money */
    --bg: #fdfdfd;
    --text: #333;
    --gray-light: #f9f9f9;
    --border: #eee;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* LAYOUT CONTAINERS */
.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

.container-small {
    max-width: 420px;
    margin: 0 auto;
    padding: 20px;
}

/* NAVBAR */
nav {
    height: 80px;
    border-bottom: 2px solid #000;
    display: flex;
    align-items: center;
    /* Dette tvinger alt til midten vertikalt */
    justify-content: space-between;
    margin-bottom: 40px;
    padding: 0 10px;
}

nav a.logo {
    text-decoration: none;
    color: var(--primary);
    font-weight: bold;
    font-size: 1.4rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-link {
    text-decoration: none;
    color: #666;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-link:hover {
    color: #000;
}

.nav-btn {
    background-color: #000;
    color: #fff !important;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
}

.nav-btn:hover {
    opacity: 0.8;
}

/* LOGO */
.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
    /* Fjernet color: #000; da emojien har sin egen farge */
}

.logo-svg {
    height: 40px;
    width: 40px;
}

.logo-text {
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: -1px;
}

/* HEADER OVER TREES */
.tree-header {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -1px;
}

/* FOOTER LINKS */
.footer-links {
    margin-top: 30px;
    font-size: 0.8rem;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    margin: 0 10px;
}

.footer-links a:hover {
    color: #000;
    text-decoration: underline;
}

/* HERO TYPOGRAPHY */
.hero-title {
    font-size: 2.8rem;
    margin-bottom: 10px;
    letter-spacing: -1px;
    margin-top: 0;
}

/* FORMS & INPUTS */
label {
    display: block;
    font-weight: bold;
    font-size: 0.85rem;
    margin-bottom: 5px;
    color: #333;
}

input:not([type="checkbox"]),
textarea,
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    display: block;
    background: #fff;
}

input:focus,
textarea:focus {
    border-color: #888;
}

.input-readonly {
    background: #f9f9f9;
    color: #666;
    font-size: 0.9rem;
    cursor: not-allowed;
}

.mono-font {
    font-family: monospace;
}

/* BUTTONS */
.btn-primary {
    background-color: #000;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    width: 100%;
    text-align: center;
    display: block;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-primary-small {
    background-color: #000;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
}

.btn-small {
    background: #f0f0f0;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
    transition: background 0.2s;
}

.btn-cancel {
    background: transparent;
    color: #888;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: 10px;
}

.link-btn {
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    color: #666;
    border-bottom: 1px dotted #999;
}

.btn-small:hover {
    background: #e0e0e0;
    color: #000;
    border-color: #bbb;
}

.btn-follow {
    background: #000;
    color: #fff;
    border-color: #000;
}
.btn-follow:hover {
    background: #333;
    border-color: #333;
    color: #fff;
}
.btn-unfollow {
    background: transparent;
    color: #e0245e;
    border-color: #e0245e;
}
.btn-unfollow:hover {
    background: #fdeef2;
}

/* TABS */
.tab-container {
    display: flex;
    background: #eee;
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.btn-tab {
    flex: 1;
    border: none;
    padding: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 6px;
    background: transparent;
    color: #666;
    transition: all 0.2s;
}

.btn-tab.active {
    background: #fff;
    color: #000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* PECK CARD & FEED */
.peck-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    position: relative;
}

.main-card {
    border: 2px solid #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.peck-reply {
    border-left: 3px solid #ddd;
    background: #fafafa;
    margin-left: 20px;
}

.warn-bg {
    background: #fff5f5;
    border: 1px solid #ffcccc;
}

.shadow {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

/* PECK HEADER ELEMENTS */
.peck-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #666;
}

.peck-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 10px;
    border: 1px solid var(--border);
    background: #fff;
    object-fit: cover;
}

.permalink {
    color: #ddd;
    font-family: monospace;
    text-decoration: none;
    font-size: 0.8rem;
    margin-right: 10px;
}

.permalink:hover {
    color: #999;
}

.reply-link {
    color: #aaa;
    text-decoration: none;
    display: block;
    margin-bottom: 5px;
    font-size: 0.85rem;
}

.reply-link:hover {
    text-decoration: underline;
}

/* VALUE BADGE (Proof of Work/Burn display) */
.badge-val {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: bold;
    background: #eafaf1;
    padding: 3px 8px;
    border-radius: 12px;
    align-self: center;
    white-space: nowrap;
}

/* MEDIA & CONTENT */
.peck-image {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 10px;
    display: block;
    border: 1px solid var(--border);
}

.md-content {
    font-size: 1rem;
    line-height: 1.5;
    color: #222;
    overflow-wrap: break-word;
}

.md-content p {
    margin: 0 0 10px 0;
}

blockquote {
    border-left: 3px solid #ccc;
    margin: 0;
    padding-left: 10px;
    color: #666;
}

code {
    background: #eee;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: monospace;
}

/* FILE ATTACHMENT CARD */
.file-card {
    margin-top: 10px;
    padding: 15px;
    background: var(--gray-light);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.fname {
    font-weight: bold;
    font-size: 0.9rem;
    word-break: break-all;
}

.fmeta {
    font-size: 0.8rem;
    color: #888;
    display: block;
}

.file-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    background: #fff;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.file-dl {
    font-size: 0.8rem;
    color: #000;
    text-decoration: underline;
    font-weight: bold;
    display: block;
    margin-top: 10px;
    text-align: right;
}

/* ACTIONS & REPLY AREA */
.action-bar {
    margin-top: 12px;
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: #888;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.action-link {
    cursor: pointer;
    text-decoration: underline;
}

.tx-link {
    color: inherit;
    text-decoration: none;
}

.tip-btn {
    color: #f5a623;
    font-weight: bold;
}

.reply-box-container {
    margin-top: 10px;
    border-top: 1px dashed var(--border);
    padding-top: 15px;
}

.reply-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.upload-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.file-upload-label {
    cursor: pointer;
    font-size: 0.9rem;
    color: #444;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
}

.status-bar {
    margin-top: 5px;
    font-size: 0.8rem;
    color: #666;
    text-align: right;
    min-height: 15px;
}

/* TIPS OVERLAY */
.tip-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 8px;
    z-index: 10;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.tip-options {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.tip-amt {
    background: #eee;
    color: #333;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
}

/* PROFILE & WALLET SPECIFICS */
.profile-avatar {
    width: 120px;
    border-radius: 50%;
    border: 4px solid var(--border);
}

.wallet-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.money-display {
    margin: 0;
    color: var(--accent);
    cursor: pointer;
}

.mnemonic-box {
    font-family: monospace;
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
    line-height: 1.5;
    margin: 10px 0;
    overflow-wrap: break-word;
}

/* GRIDS */
.grid-hot {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.grid-inv {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

/* AVATAR DROPDOWN (User Menu) */
.user-menu {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #eee;
    object-fit: cover;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 50px;
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    z-index: 100;
    flex-direction: column;
    overflow: hidden;
}

.dropdown-menu a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    border-bottom: 1px solid #f9f9f9;
    text-align: left;
}

.dropdown-menu a:hover {
    background: #f5f5f5;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-pill {
    background-color: #f5f5f5;
    color: #666;
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.footer-pill:hover {
    background-color: #e0e0e0;
    color: #000;
    border-color: #ccc;
    transform: translateY(-1px);
}

/* QR ZOOM MODAL */
.qr-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.qr-big-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.qr-big-box canvas,
.qr-big-box img {
    display: block;
    margin: 0 auto;
}

/* I style.css */
.react-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 10px;
}

.react-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.like-btn:hover {
    color: #e74c3c !important;
    transform: scale(1.1);
}

textarea {
    resize: none;
    /* Fjerner drahåndtaket i hjørnet */
    border: none;
    /* Fjerner rammen hvis du vil ha "clean" look */
    outline: none;
    /* Fjerner den blå/sorte ringen når du klikker i den */
    overflow: hidden;
    /* Skjuler scrollbar (siden scriptet ditt utvider den uansett) */
    width: 100%;
    /* Sørg for at den fyller bredden */
    box-shadow: none;
    /* Fjern evt skygger */
    background: transparent;
    /* Så den blender inn i containeren */
}

.input-container {
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 8px;
}

/* Definer animasjonen */
@keyframes balance-pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
        text-shadow: 0 0 20px currentColor;
    }

    /* currentColor bruker tekstfargen! */
    100% {
        transform: scale(1);
    }
}

.animate-pop {
    animation: balance-pop 0.3s ease-out;
}

/* DARK MODE */
body.dark-mode {
    --bg: #121212;
    --text: #e0e0e0;
    --primary: #ffffff;
    --gray-light: #1e1e1e;
    --border: #333333;
}

body.dark-mode nav {
    border-bottom: 2px solid #333;
}

body.dark-mode .nav-btn,
body.dark-mode .btn-primary,
body.dark-mode .btn-primary-small {
    background-color: #333;
    color: #fff !important;
}

body.dark-mode .nav-btn:hover,
body.dark-mode .btn-primary:hover {
    background-color: #555;
}

body.dark-mode .peck-card,
body.dark-mode .file-card {
    background: #1a1a1a;
    border-color: #333;
}

body.dark-mode .main-card {
    border-color: #555;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

body.dark-mode .peck-reply {
    background: #181818;
    border-left-color: #444;
}

body.dark-mode .dropdown-menu {
    background: #1a1a1a;
    border-color: #333;
}

body.dark-mode .dropdown-menu a {
    color: #e0e0e0;
    border-bottom-color: #222;
}

body.dark-mode .dropdown-menu a:hover {
    background: #2a2a2a;
}

body.dark-mode .btn-tab.active {
    background: #333;
    color: #fff;
}

body.dark-mode input:not([type="checkbox"]),
body.dark-mode textarea,
body.dark-mode select {
    background: #222;
    color: #eee;
    border-color: #444;
}

body.dark-mode .input-readonly {
    background: #1a1a1a;
    color: #aaa;
}

body.dark-mode svg[stroke="#000"] {
    stroke: #fff !important;
}

body.dark-mode svg[fill="#000"] {
    fill: #fff !important;
}

body.dark-mode .footer-pill {
    background-color: #222;
    color: #aaa;
}

body.dark-mode .footer-pill:hover {
    background-color: #333;
    color: #fff;
    border-color: #555;
}

body.dark-mode .peck-avatar,
body.dark-mode .profile-avatar {
    border-color: #333;
    background-color: #222;
}

body.dark-mode .post-card {
    background: #1a1a1a;
    border-bottom: 1px solid #333;
}

body.dark-mode .post-card:hover {
    background: #252525;
}

body.dark-mode .post-name,
body.dark-mode .post-body,
body.dark-mode .md-content,
body.dark-mode .md-content p,
body.dark-mode .md-content h1,
body.dark-mode .md-content h2,
body.dark-mode .md-content h3,
body.dark-mode .md-content li,
body.dark-mode .md-content span,
body.dark-mode .quote-text {
    color: #e0e0e0 !important;
}

.quote-card {
    background: #fff;
}

.quote-card:hover {
    background: #f7f9f9;
}

body.dark-mode .quote-card {
    background: #1a1a1a;
    border-color: #333 !important;
}

body.dark-mode .quote-card:hover {
    background: #252525;
}

body.dark-mode .post-handle,
body.dark-mode .post-time,
body.dark-mode .post-meta,
body.dark-mode .action-btn {
    color: #aaaaaa;
}

body.dark-mode .reply-line {
    background: #444;
}

body.dark-mode .modal-box {
    background: #1a1a1a;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    color: #eee;
}

body.dark-mode .tab-header {
    border-bottom-color: #333;
}

body.dark-mode .user-row {
    border-bottom-color: #333;
}

/* Invert the main bird logo */
body.dark-mode svg.logo-icon {
    stroke: #fff !important;
}

/* For swapping moon / sun icon on the toggle button */
body:not(.dark-mode) .moon-icon {
    display: block;
}

body:not(.dark-mode) .sun-icon {
    display: none;
}

body.dark-mode .moon-icon {
    display: none;
}

body.dark-mode .sun-icon {
    display: block;
}

/* --- Badges and Timestamps --- */
.app-badge {
    font-size: 0.75em;
    color: #999;
    background: #f5f8fa;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
    border: 1px solid #e1e8ed;
    font-weight: normal;
}

body.dark-mode .app-badge {
    color: #8899a6;
    background: #253341;
    border-color: #38444d;
}

.signed-by-label {
    font-weight: bold;
    font-size: 0.7em;
    color: #aaa;
    margin-right: 4px;
}

body.dark-mode .signed-by-label {
    color: #718ea6;
}

.signer-code {
    font-family: monospace;
    color: #888;
    font-size: 0.7em;
    background: #f8f9fa;
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid #eee;
    word-break: break-all;
}

body.dark-mode .signer-code {
    background: #192734;
    border-color: #2f3336;
    color: #8899a6;
}

.post-time,
.post-time-dot {
    color: #777;
    font-size: 0.9rem;
    font-weight: normal;
}

body.dark-mode .post-time,
body.dark-mode .post-time-dot {
    color: #6a737d;
    opacity: 0.7;
}

body.dark-mode .md-content a,
body.dark-mode a {
    color: #6fb0fc;
}
/* Chat */
#chat-messages::-webkit-scrollbar { width: 4px; }
#chat-messages::-webkit-scrollbar-track { background: transparent; }
#chat-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }
#chat-input:focus { border-color: #000; }
