/* ─── Base ─────────────────────────────────────────────────────────────────── */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(35deg, #00bfff, #ffffff);
    color: #ffffff;
    min-height: 100vh;
}

/* ─── Header ──────────────────────────────────────────────────────────────── */
header {
    background: linear-gradient(90deg, #00338b, #3399cd);
    color: #ffffff;
    padding: 1rem 1.5rem;
    box-shadow: 0 0 20px rgba(0, 0, 139, 0.5);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
}

.header-brand h1 {
    font-family: 'Orbitron', sans-serif;
    margin: 0;
}

.header-brand p {
    font-family: 'Orbitron', sans-serif;
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    opacity: 0.85;
}

/* ─── Wallet Area ─────────────────────────────────────────────────────────── */
.wallet-area {
    flex-shrink: 0;
}

.btn-wallet {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    transition: background 0.2s;
}

.btn-wallet:hover {
    background: rgba(255, 255, 255, 0.3);
}

.wallet-account {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.wallet-account:hover {
    background: rgba(255, 80, 80, 0.3);
}

/* ─── Nav ─────────────────────────────────────────────────────────────────── */
nav {
    background: #22228b;
    padding: 0.5rem;
    border-bottom: 2px solid #ffffff;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav ul li {
    margin: 0 0.5rem;
}

nav ul li a {
    color: #ffffff;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    transition: all 0.2s;
    border-radius: 4px;
}

nav ul li a:hover,
nav ul li a.nav-active {
    background: #00bfff;
    color: #000000;
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}

/* ─── Tab Content ─────────────────────────────────────────────────────────── */
.tab-content {
    display: none;
    padding: 2rem;
    max-width: 1000px;
    margin: 2rem auto 120px;
    background: rgba(0, 100, 200, 0.75);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 139, 0.3);
}

.tab-content.active {
    display: block;
}

.tab-content h2,
.tab-content h3 {
    color: #d0eeff;
    font-family: 'Orbitron', sans-serif;
}

/* ─── Footer ──────────────────────────────────────────────────────────────── */
footer {
    background: #22228b;
    color: #ffffff;
    text-align: center;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    border-top: 2px solid #ffffff;
    box-shadow: 0 -5px 20px rgba(0, 0, 139, 0.5);
}

/* ─── Utility ─────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

.muted {
    color: rgba(255, 255, 255, 0.65);
    font-style: italic;
}

.error {
    color: #ff8080;
    font-weight: bold;
}

.hint {
    display: block;
    margin-top: 0.25rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

.section-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin: 2rem 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-header h2 {
    margin: 0;
}

/* ─── Stats Row (Home) ────────────────────────────────────────────────────── */
.stats-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    text-align: center;
    min-width: 100px;
}

.stat-num {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    margin-top: 0.25rem;
}

/* ─── Proposal Cards ──────────────────────────────────────────────────────── */
.proposals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.proposal-card {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: box-shadow 0.2s;
    cursor: pointer;
}

.proposal-card:hover {
    box-shadow: 0 0 16px rgba(0, 191, 255, 0.35);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.card-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    margin: 0;
    color: #ffffff;
}

.card-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.card-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
}

.card-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
}

.deadline {
    font-style: italic;
}

/* ─── Progress Bar ────────────────────────────────────────────────────────── */
.progress-bar {
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00bfff, #00ff88);
    border-radius: 6px;
    transition: width 0.4s ease;
    min-width: 2px;
}

.progress-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

/* ─── Badges ──────────────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    font-size: 0.65rem;
    font-family: 'Orbitron', sans-serif;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-active {
    background: rgba(0, 200, 100, 0.3);
    border: 1px solid rgba(0, 200, 100, 0.6);
    color: #80ffb0;
}

.badge-successful {
    background: rgba(255, 200, 0, 0.3);
    border: 1px solid rgba(255, 200, 0, 0.6);
    color: #ffe080;
}

.badge-failed {
    background: rgba(255, 60, 60, 0.3);
    border: 1px solid rgba(255, 60, 60, 0.6);
    color: #ff9090;
}

/* ─── Card Actions (Stake/Tip) ────────────────────────────────────────────── */
.card-action {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.input-inline {
    flex: 1;
    padding: 0.35rem 0.5rem;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.85rem;
    min-width: 0;
}

.input-inline::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn-sm {
    padding: 0.35rem 0.75rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.btn-sm:hover { opacity: 0.85; }

.btn-stake   { background: #00bfff; color: #001a33; }
.btn-tip     { background: #aa80ff; color: #1a0033; }
.btn-claim   { background: #ffe040; color: #332200; }
.btn-deposit { background: #60e080; color: #003311; }
.btn-unstake { background: #ff8040; color: #330800; }

.btn-primary {
    background: #00bfff;
    color: #001a33;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: bold;
    transition: opacity 0.2s;
}

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

.btn-refresh {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

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

/* ─── Forms ───────────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 0.3rem;
    color: rgba(255, 255, 255, 0.9);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00bfff;
    background: rgba(255, 255, 255, 0.18);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ─── My Account Items ────────────────────────────────────────────────────── */
.my-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.my-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.my-item-stats {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.5rem;
}

.my-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ─── Wallet Modal ────────────────────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #0d2a55;
    border: 1px solid rgba(0, 191, 255, 0.4);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 260px;
    box-shadow: 0 0 40px rgba(0, 100, 200, 0.5);
}

.modal-content h3 {
    font-family: 'Orbitron', sans-serif;
    margin: 0 0 0.5rem;
    color: #ffffff;
    text-align: center;
}

.btn-modal {
    padding: 0.65rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: background 0.2s;
}

.btn-modal:hover { background: rgba(255, 255, 255, 0.25); }

.btn-cancel {
    border-color: rgba(255, 100, 100, 0.4);
    color: rgba(255, 180, 180, 0.9);
}

.btn-cancel:hover { background: rgba(255, 80, 80, 0.2); }

/* ─── Notifications ───────────────────────────────────────────────────────── */
.notification {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.9rem;
    z-index: 2000;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: opacity 0.5s;
}

.notification-success {
    background: #1a6633;
    border: 1px solid #40cc80;
    color: #c0ffd8;
}

.notification-error {
    background: #661a1a;
    border: 1px solid #cc4040;
    color: #ffc0c0;
}

.notification-fade {
    opacity: 0;
}

/* ─── Proposals Toolbar ───────────────────────────────────────────────────── */
.proposals-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.proposals-toolbar h2 {
    margin: 0;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-check {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.85);
}

.filter-check input {
    cursor: pointer;
}

/* ─── Create Panel ────────────────────────────────────────────────────────── */
.create-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    color: #ffffff;
    margin-bottom: 0.25rem;
    transition: background 0.2s;
}

.create-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
}

.create-panel-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0;
}

.create-panel-body.open {
    max-height: 1200px;
    padding: 1rem 0 0.5rem;
}

/* ─── Proposal Profile ────────────────────────────────────────────────────── */
.profile-header {
    margin-bottom: 1rem;
}

.profile-title-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.profile-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    margin: 0;
    color: #ffffff;
}

.profile-meta {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
}

.profile-progress {
    margin-bottom: 0.5rem;
}

.profile-stats {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.5rem;
}

.profile-desc {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.profile-desc p {
    margin: 0 0 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.profile-action {
    margin-bottom: 1rem;
}

.edit-section {
    margin-top: 1rem;
}

/* ─── Back Button ─────────────────────────────────────────────────────────── */
.btn-back {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.85);
    padding: 0.4rem 0.9rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
    margin-bottom: 1.25rem;
    display: inline-block;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ─── Description Markdown ────────────────────────────────────────────────── */
.desc-h2 {
    font-family: 'Orbitron', sans-serif;
    color: #ffffff;
    font-size: 1.1rem;
    margin: 1rem 0 0.4rem;
}

.desc-h3 {
    font-family: 'Orbitron', sans-serif;
    color: #d0eeff;
    font-size: 0.95rem;
    margin: 0.75rem 0 0.3rem;
}

.desc-hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    margin: 1rem 0;
}

.desc-img {
    max-width: 100%;
    border-radius: 6px;
    margin: 0.5rem 0;
    display: block;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
    .header-inner { flex-direction: column; gap: 0.75rem; text-align: center; }
    .tab-content { margin: 1rem 0.5rem 120px; padding: 1.25rem; }
    .proposals-grid { grid-template-columns: 1fr; }
    .stats-row { justify-content: center; }
}
