:root {
    --bg-color: #0c0e12;
    --card-bg: #1a1d24;
    --accent-color: #00f2ff;
    --secondary-color: #7000ff;
    --text-primary: #ffffff;
    --text-secondary: #9ea4b0;
    --up-color: #00ff88;
    --down-color: #ff3366;
    --glass: rgba(255, 255, 255, 0.05);
    --star-color: #ffcc00;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: 80px;
}

.app-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.logo span span {
    color: var(--accent-color);
}

.date-display {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 300;
}

/* Market Status */
.market-status {
    margin-bottom: 40px;
}

.status-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, #252a35 100%);
    padding: 24px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.change.neutral {
    color: var(--text-secondary);
}

.change.up::before {
    content: '▲ ';
}

.change.down::before {
    content: '▼ ';
}

.status-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 242, 255, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

.status-main h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 4px 0;
}

.status-main .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.change-tag {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 51, 102, 0.15);
    color: var(--down-color);
    font-size: 0.9rem;
}

.status-badge {
    background: var(--secondary-color);
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(112, 0, 255, 0.4);
}

/* Budget Filters */
.budget-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}

.budget-filter::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.3);
}

/* Sections */
.section-title {
    margin-bottom: 20px;
}

.section-title h3 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title h3 span {
    font-weight: 300;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.mt-2 {
    margin-top: 40px;
}

/* Stock Cards */
.stock-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stock-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
}

.stock-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 242, 255, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.rank-pill {
    background: var(--glass);
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stock-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stock-info .name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.stock-info .code {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stock-pricing {
    text-align: right;
    display: flex;
    align-items: center;
    gap: 12px;
}

.star-btn {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.star-btn.active {
    color: var(--star-color);
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.4);
}

.stock-pricing .price {
    font-size: 1.1rem;
    font-weight: 700;
}

.stock-pricing .change {
    font-size: 0.8rem;
    font-weight: 600;
}

.stock-pricing .change.up {
    color: var(--up-color);
}

.stock-pricing .change.down {
    color: var(--down-color);
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 14px;
    border-radius: 12px;
    margin-top: 12px;
    line-height: 1.5;
}

.glossary-link {
    border-bottom: 1px dashed var(--accent-color);
    cursor: help;
    color: var(--text-primary);
}

.target-badge {
    float: right;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--up-color);
    color: #000;
    font-weight: 700;
    margin-left: 8px;
    margin-top: 2px;
}

/* Theme Cloud */
.theme-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.theme-tag {
    background: var(--glass);
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-tag:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
    transform: scale(1.05);
}

.theme-tag span {
    margin-left: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
}

/* Glossary Modal */
.glossary-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.glossary-modal.active {
    display: flex;
}

.glossary-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.glossary-content h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.glossary-content p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.glossary-close {
    background: var(--accent-color);
    color: black;
    border: none;
    padding: 10px 30px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

/* Footer */
.disclaimer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 29, 36, 0.85);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    padding: 12px 0 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    transition: color 0.3s;
    cursor: pointer;
}

.nav-item.active {
    color: var(--accent-color);
}

.nav-item .icon {
    font-size: 1.2rem;
}

.nav-item .label {
    font-size: 0.7rem;
    font-weight: 600;
}

/* Overlay Styles */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 14, 18, 0.95);
    backdrop-filter: blur(15px);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.active {
    display: block;
    opacity: 1;
}

.overlay-content {
    max-width: 500px;
    margin: 0 auto;
    padding: 30px 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.close-btn {
    background: var(--glass);
    border: none;
    color: white;
    font-size: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 30px;
}

.search-input-wrapper input {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 18px 20px 18px 50px;
    color: white;
    font-size: 1rem;
    outline: none;
    font-family: inherit;
}

.search-input-wrapper input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.2);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
}

.search-results-container {
    flex: 1;
    overflow-y: auto;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 50px;
    font-size: 0.9rem;
}

.result-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 0;
    margin-bottom: 20px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stock-card {
    animation: fadeIn 0.5s ease forwards;
}