/* Base styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 16px;
    color: #333;
}

#app {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    padding: 20px;
}


/* Header */

.app-header {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    margin-bottom: 20px;
}

.app-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    opacity: 0.9;
    font-size: 1.1em;
}


/* User Info */

.user-info {
    margin: 20px 0;
}

.balance-card {
    background: linear-gradient(135deg, #00b09b 0%, #96c93d 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
}

.balance-label {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 5px;
}

.balance-amount {
    font-size: 3em;
    font-weight: bold;
    margin: 10px 0;
}

.cash-balance {
    font-size: 1.2em;
    opacity: 0.9;
}


/* Tabs */

.tabs {
    display: flex;
    background: #f5f5f5;
    border-radius: 12px;
    padding: 5px;
    margin: 20px 0;
}

.tab {
    flex: 1;
    padding: 15px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    color: #666;
    border-radius: 8px;
    transition: all 0.3s;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.5);
}

.tab.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}


/* Tab Content */

.tab-content {
    display: none;
    padding: 20px 0;
}

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


/* Market List */

.market-list {
    display: grid;
    gap: 15px;
}

.word-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.word-card:hover {
    transform: translateY(-2px);
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

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

.word-name {
    font-size: 1.4em;
    font-weight: bold;
    color: #333;
}

.word-price {
    font-size: 1.6em;
    font-weight: bold;
}

.word-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.change {
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
}

.change.positive {
    color: #00b09b;
    background: rgba(0, 176, 155, 0.1);
}

.change.negative {
    color: #ff416c;
    background: rgba(255, 65, 108, 0.1);
}

.signal {
    font-size: 0.9em;
    padding: 4px 8px;
    border-radius: 4px;
    background: #f0f0f0;
}

.word-origin {
    color: #666;
    font-size: 0.9em;
    margin: 10px 0;
    line-height: 1.4;
}

.trade-btn {
    width: 100%;
    padding: 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.trade-btn:hover {
    background: #5a6fd8;
}


/* Portfolio */

.portfolio-list {
    display: grid;
    gap: 15px;
}

.portfolio-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.portfolio-word {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 10px;
}

.portfolio-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #666;
}

.profit {
    color: #00b09b;
    font-weight: bold;
}

.loss {
    color: #ff416c;
    font-weight: bold;
}

.portfolio-current {
    font-weight: bold;
    color: #333;
}


/* Modal */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    float: right;
    font-size: 28px;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #333;
}

.modal-body {
    margin-top: 20px;
}

.word-price-display {
    text-align: center;
    margin: 20px 0;
}

.current-price {
    font-size: 3em;
    font-weight: bold;
    color: #333;
}

.price-change {
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 5px;
}

.etymology-section {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.etymology-section h3 {
    margin-bottom: 10px;
    color: #667eea;
}

.trade-section {
    margin: 20px 0;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.quantity-controls button {
    width: 40px;
    height: 40px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    font-size: 1.2em;
    cursor: pointer;
}

.quantity-controls input {
    width: 80px;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    font-size: 1.2em;
}

.trade-buttons {
    display: grid;
    gap: 10px;
}

.btn-buy,
.btn-sell {
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-buy {
    background: linear-gradient(135deg, #00b09b 0%, #96c93d 100%);
    color: white;
}

.btn-sell {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: white;
}

.btn-buy:hover,
.btn-sell:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}


/* Status Bar */

.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #333;
    color: white;
    padding: 10px;
    text-align: center;
    font-size: 0.9em;
}


/* Responsive */

@media (max-width: 600px) {
    #app {
        padding: 10px;
        border-radius: 15px;
    }
    .app-header h1 {
        font-size: 2em;
    }
    .balance-amount {
        font-size: 2.5em;
    }
    .tabs {
        flex-direction: column;
    }
    .tab {
        margin-bottom: 5px;
    }
}