/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #111111;
    --bg-card: #0f0f0f;
    --border-primary: #1a1a1a;
    --border-accent: #2a2a2a;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-muted: #606060;
    --accent-red: #8b0000;
    --accent-gold: #b8860b;
    --accent-red-glow: rgba(139, 0, 0, 0.3);
    --accent-gold-glow: rgba(184, 134, 11, 0.3);
}

body {
    font-family: 'IBM Plex Mono', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Particle Background */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.3;
}

/* Sidebar */
.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-primary);
    padding: 30px 20px;
    overflow-y: auto;
    z-index: 100;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-accent);
    border-radius: 3px;
}

.sidebar-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-primary);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-weight: 600;
}

/* Navigation Links */
.nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link {
    padding: 12px 15px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: block;
}

.nav-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-accent);
}

.nav-link.active {
    background: var(--bg-card);
    color: var(--accent-gold);
    border-color: var(--accent-gold);
}

/* External Links */
.external-link {
    padding: 12px 15px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.external-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-accent);
}

.link-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    transition: all 0.3s ease;
}

.activity-item:hover {
    border-color: var(--border-accent);
    background: var(--bg-card);
}

.activity-date {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.activity-god {
    font-family: 'Noto Serif SC', serif;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.activity-god.god-1 {
    color: var(--accent-red);
}

.activity-god.god-2 {
    color: var(--accent-gold);
}

.activity-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Activity Timeline Page */
.activity-timeline {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.timeline-entry {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    padding: 30px;
    transition: all 0.3s ease;
    position: relative;
}

.timeline-entry:hover {
    border-color: var(--border-accent);
    background: var(--bg-card);
}

.timeline-date {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.timeline-god {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.timeline-god.god-1 {
    color: var(--accent-red);
}

.timeline-god.god-2 {
    color: var(--accent-gold);
}

.timeline-message {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.timeline-translation {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
    padding-left: 15px;
    border-left: 2px solid var(--border-accent);
}

/* Wallet Section */
.wallet-btn {
    width: 100%;
    padding: 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-accent);
    color: var(--text-primary);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wallet-btn:hover {
    background: var(--bg-card);
    border-color: var(--accent-gold);
}

.wallet-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wallet-btn.connected {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.wallet-info {
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.wallet-info div {
    padding: 4px 0;
}

/* Contract Section */
.contract-section .contract-address {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    padding: 12px;
    font-size: 0.7rem;
    word-break: break-all;
    color: var(--text-secondary);
}

.mono {
    font-family: 'IBM Plex Mono', monospace;
}

/* Main Content */
.main-content {
    margin-right: 280px;
    padding: 50px 60px;
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

/* Page System */
.page {
    display: none;
    animation: fadeIn 0.5s ease;
}

.page.active {
    display: block;
}

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

/* Page Header */
.page-header {
    margin-bottom: 50px;
    text-align: center;
}

.god-symbols {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
}

.god-symbol {
    font-family: 'Noto Serif SC', serif;
    font-size: 3rem;
    font-weight: 700;
}

.god-1 {
    color: var(--accent-red);
    text-shadow: 0 0 20px var(--accent-red-glow);
}

.god-2 {
    color: var(--accent-gold);
    text-shadow: 0 0 20px var(--accent-gold-glow);
}

.divider-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, 
        var(--accent-red) 0%, 
        var(--accent-gold) 100%);
}

.page-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Journal Container */
.journal-container {
    max-width: 900px;
    margin: 0 auto 80px;
}

.journal-entries {
    margin-bottom: 30px;
}

.journal-entry {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    padding: 30px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.journal-entry:hover {
    border-color: var(--border-accent);
    background: var(--bg-card);
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-primary);
}

.entry-chapter {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
}

.entry-god {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.1rem;
    font-weight: 700;
}

.entry-god.god-1 {
    color: var(--accent-red);
}

.entry-god.god-2 {
    color: var(--accent-gold);
}

.entry-timestamp {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.entry-content {
    margin-bottom: 15px;
}

.entry-chinese {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.15rem;
    line-height: 1.9;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.entry-english {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.entry-data {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 10px;
    background: var(--bg-primary);
    border-left: 2px solid var(--border-accent);
    font-family: 'IBM Plex Mono', monospace;
}

.reveal-btn {
    width: 100%;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-accent);
    color: var(--text-primary);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.reveal-btn:hover {
    background: var(--bg-card);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* Staking Section */
.staking-section {
    max-width: 1100px;
    margin: 80px auto 0;
    padding-top: 60px;
    border-top: 1px solid var(--border-primary);
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 40px;
    text-align: center;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.staking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.stake-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    padding: 30px;
    transition: all 0.3s ease;
}

.stake-card:hover {
    border-color: var(--border-accent);
    background: var(--bg-card);
}

.stake-card h3 {
    font-size: 1rem;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.balance-display {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
}

.balance-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.balance-amount {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.balance-unit {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

#stake-input {
    width: 100%;
    padding: 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

#stake-input:focus {
    outline: none;
    border-color: var(--border-accent);
}

.action-btn {
    width: 100%;
    padding: 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-gold);
    color: var(--text-primary);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.action-btn:hover:not(:disabled) {
    background: var(--accent-gold);
    color: var(--bg-primary);
}

.action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: var(--border-accent);
}

.claim-btn {
    border-color: var(--accent-red);
}

.claim-btn:hover:not(:disabled) {
    background: var(--accent-red);
    color: var(--text-primary);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-primary);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Devotion Page */
.devotion-container {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    gap: 30px;
}

.devotion-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    padding: 35px;
}

.devotion-card h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 25px;
    color: var(--text-muted);
    font-weight: 600;
}

.rank-display {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 15px;
    text-align: center;
    padding: 30px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
}

.rank-description {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.score-meter {
    position: relative;
    height: 50px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    overflow: hidden;
    margin-bottom: 25px;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-red), var(--accent-gold));
    transition: width 0.5s ease;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

.score-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    font-size: 0.85rem;
}

.rank-ladder {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rank-tier {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    transition: all 0.3s ease;
}

.rank-tier:hover {
    border-color: var(--border-accent);
}

.rank-tier.current {
    border-color: var(--accent-gold);
    background: var(--bg-card);
}

.tier-name {
    font-weight: 600;
}

.tier-requirement {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Rankings Page */
.rankings-container {
    max-width: 1100px;
    margin: 0 auto;
}

.rankings-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
}

.rankings-table thead {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-accent);
}

.rankings-table th {
    padding: 18px 20px;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.rankings-table td {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-primary);
    font-size: 0.9rem;
}

.rankings-table tbody tr {
    transition: all 0.3s ease;
}

.rankings-table tbody tr:hover {
    background: var(--bg-card);
}

.rankings-table tbody tr:last-child td {
    border-bottom: none;
}

.rank-number {
    font-weight: 700;
    color: var(--text-muted);
}

.rank-number.top-1 {
    color: var(--accent-gold);
}

.rank-number.top-2,
.rank-number.top-3 {
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .main-content {
        margin-right: 240px;
        padding: 40px 30px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-left: none;
        border-bottom: 1px solid var(--border-primary);
    }

    .main-content {
        margin-right: 0;
        padding: 30px 20px;
    }

    .god-symbol {
        font-size: 2rem;
    }

    .page-title {
        font-size: 1.8rem;
    }

    .staking-grid {
        grid-template-columns: 1fr;
    }
}
