/* --- Global Reset & Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Disable tap highlight on mobile */
}

body {
    font-family: 'Roboto', sans-serif;
    background: #0e0e1c;
    color: #ffffff;
    overflow: hidden; /* Prevent scrolling of the whole page */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
}

#app {
    width: 100%;
    height: 100%;
    max-width: 480px; /* Standard mobile web app width */
    display: flex;
    flex-direction: column;
    position: relative;
    background: linear-gradient(135deg, #0e0e1c, #1c1428, #291a34);
}

/* --- Header & Main Balance Display --- */
.top-bar {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}
.top-item {
    text-align: center;
}
.top-item span {
    font-size: 0.8rem;
    color: #ccc;
    display: block;
}
.top-item strong {
    font-size: 1rem;
}

.balance-display {
    text-align: center;
    padding: 15px 0;
    flex-shrink: 0;
}
.balance-display .currency-icon {
    font-size: 2rem;
}
.balance-display h1 {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

/* --- Main Page Container --- */
#page-container {
    flex-grow: 1;
    overflow-y: auto; /* Allow individual page content to scroll */
    padding: 16px;
    padding-bottom: 90px; /* Space for nav bar */
}
.tab-page {
    display: none;
}
.tab-page.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    text-align: center;
    margin-bottom: 20px;
    font-weight: 700;
    color: #d76d77;
}

/* --- Home Page (Dashboard) Styles --- */
.dashboard .stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    margin-bottom: 10px;
}
.dashboard .stat-card span {
    display: block;
    font-size: 0.9rem;
    color: #ccc;
}
.dashboard .stat-card strong {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
}
.positive { color: #00ffae; }
.negative { color: #ff4d6d; }

.flex-box {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
}
.flex-box input {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    margin: 8px 0;
}

/* --- Compact List Styles (for Trade, Portfolio, Empire, etc.) --- */
.compact-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.list-item, .list-item-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    text-decoration: none;
    color: #fff;
}
.list-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.list-item-icon {
    font-size: 2rem;
    line-height: 1;
}
.list-item-name {
    display: block;
    font-weight: bold;
}
.list-item-meta {
    font-size: 0.8rem;
    color: #ccc;
}
.list-item-action .btn {
    padding: 8px 14px;
    font-size: 0.9rem;
    margin-top: 0;
}

/* --- Hub Page --- */
.hub-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.hub-link-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 20px;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.hub-link-btn:hover {
    background: rgba(255,255,255,0.1);
}


/* --- General UI Elements --- */
.btn {
    background: linear-gradient(145deg, #3a1c71, #d76d77, #ffaf7b);
    border: none;
    padding: 12px 18px;
    border-radius: 12px;
    color: #fff;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(255, 175, 123, 0.4);
    transition: all 0.3s ease;
    cursor: pointer;
    display: block;
    width: 100%;
    margin-top: 10px;
    text-align: center;
}
.btn:hover {
    transform: scale(1.02);
    opacity: 0.95;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #555;
}

.feature-box {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
}
.feature-box input, .feature-box select {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: none;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    margin: 8px 0;
}

#portfolioHeader {
    text-align: center;
    margin-bottom: 20px;
}
#portfolioHeader h3 {
    margin-bottom: 10px;
}
#portfolioHeader .btn {
    max-width: 250px;
    margin: 0 auto;
}

/* --- Bottom Navigation --- */
.nav-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    background: rgba(14, 14, 28, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 999;
}
.tab-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 1.8rem; /* Icon size */
    padding: 6px 12px;
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}
.tab-btn.active {
    color: #fff;
    transform: scale(1.1);
}
/* --- Price Change Arrow and Text Colors --- */

.price-up {
    color: #00ffae; /* A vibrant green for price increases */
}

.price-down {
    color: #ff4d6d; /* A clear red for price decreases */
}

 /* --- Trade Modal Styles --- */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(14, 14, 28, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 15px;
}

.modal-content {
    background: #1c1428;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.close-btn:hover {
    opacity: 1;
}

.trade-tabs {
    display: flex;
    margin-bottom: 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 4px;
}

.trade-tab-btn {
    flex-grow: 1;
    background: none;
    border: none;
    color: #888;
    padding: 10px;
    font-weight: bold;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.trade-tab-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.trade-panel {
    display: none;
}

.trade-panel.active {
    display: block;
}

.trade-interface input {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    margin: 8px 0;
    text-align: center;
}

.trade-interface p {
    font-size: 0.9rem;
    color: #ccc;
    text-align: center;
    margin-bottom: 5px;
}

.btn-sell {
    background: linear-gradient(145deg, #c31432, #ff4d6d);
    box-shadow: 0 0 10px rgba(255, 77, 109, 0.4);
}