/* Main Styles for Investment Odyssey Game */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
}

/* Card styling */
.card {
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-header {
    border-radius: 10px 10px 0 0;
    font-weight: bold;
}

/* Button styling */
.btn {
    border-radius: 5px;
    font-weight: 500;
}

/* Table styling */
.table th {
    background-color: #f8f9fa;
}

/* Chart containers */
canvas {
    max-width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 1.8rem;
    }

    h3 {
        font-size: 1.4rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table {
        font-size: 0.9rem;
    }
}

/* Animation for price changes */
.price-up {
    color: green;
    animation: flash-green 1s;
}

.price-down {
    color: red;
    animation: flash-red 1s;
}

@keyframes flash-green {
    0% { background-color: rgba(0, 255, 0, 0.3); }
    100% { background-color: transparent; }
}

@keyframes flash-red {
    0% { background-color: rgba(255, 0, 0, 0.3); }
    100% { background-color: transparent; }
}

/* Portfolio allocation chart */
.portfolio-allocation-container {
    height: 300px;
    position: relative;
}

/* Enhanced portfolio charts */
#portfolio-allocation-chart-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Card equal height for better layout */
.card-equal-height {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-equal-height .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Portfolio performance section */
.card-header.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%) !important;
}

/* Game controls section */
.card-header.bg-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
}

/* Custom form elements */
.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Trade history styling */
.trade-history-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.trade-buy {
    border-left: 4px solid green;
}

.trade-sell {
    border-left: 4px solid red;
}

/* Loading spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Asset Price Ticker */
.ticker-container {
    background-color: #1a1a1a;
    color: white;
    padding: 10px 0;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.ticker-wrap {
    width: 100%;
    overflow: hidden;
}

.ticker {
    display: flex;
    white-space: nowrap;
    padding-right: 100%;
    animation: ticker 30s linear infinite;
}

.ticker:hover {
    animation-play-state: paused;
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.ticker-item {
    display: inline-block;
    padding: 0 20px;
    font-size: 1.2rem;
    font-weight: bold;
}

.ticker-item .asset-name {
    margin-right: 10px;
}

.ticker-item .price {
    margin-right: 5px;
}

.ticker-item .change-positive {
    color: #4caf50;
}

.ticker-item .change-negative {
    color: #f44336;
}

/* Price change animation */
@keyframes pulse-green {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); color: #4caf50; }
    100% { transform: scale(1); }
}

@keyframes pulse-red {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); color: #f44336; }
    100% { transform: scale(1); }
}

.price-up {
    animation: pulse-green 0.5s;
    color: #4caf50;
    font-weight: bold;
}

.price-down {
    animation: pulse-red 0.5s;
    color: #f44336;
    font-weight: bold;
}

/* Market data card styling */
.market-data-card {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 10px;
    overflow: hidden;
}

.market-data-card .card-header {
    background: linear-gradient(135deg, #343a40 0%, #121416 100%);
}

/* Market data table styling */
#market-data-table {
    margin-bottom: 0;
    font-size: 1.1rem;
}

#market-data-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    text-align: center;
    border-bottom: 2px solid #dee2e6;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

#market-data-table td {
    vertical-align: middle;
    padding: 0.75rem;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

#market-data-table .chart-cell {
    width: 120px;
    height: 40px;
    padding: 0;
}

#market-data-table canvas {
    width: 100%;
    height: 40px;
}

#market-data-table tr:hover {
    background-color: rgba(220, 53, 69, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

#market-data-table tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Price animation */
.price-cell {
    font-weight: bold;
    transition: all 0.3s;
    position: relative;
    font-size: 1.1rem;
}

.change-cell {
    font-weight: bold;
}

.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

/* Enhanced price animations */
@keyframes pulse-green {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: #28a745; }
    100% { transform: scale(1); }
}

@keyframes pulse-red {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: #dc3545; }
    100% { transform: scale(1); }
}

/* Base price animation classes */
.price-up {
    animation: pulse-green 0.7s;
    color: #28a745;
    font-weight: bold;
}

.price-down {
    animation: pulse-red 0.7s;
    color: #dc3545;
    font-weight: bold;
}

/* Animation intensity levels for price-up */
.price-up-0 { animation: pulse-green 0.7s; }
.price-up-1 { animation: pulse-green 0.8s; }
.price-up-2 { animation: pulse-green 0.9s; }
.price-up-3 { animation: pulse-green 1.0s; }
.price-up-4 { animation: pulse-green 1.1s; }
.price-up-5 { animation: pulse-green 1.2s; }
.price-up-6 { animation: pulse-green 1.3s; }
.price-up-7 { animation: pulse-green 1.4s; }
.price-up-8 { animation: pulse-green 1.5s; }
.price-up-9 { animation: pulse-green 1.6s; }

/* Animation intensity levels for price-down */
.price-down-0 { animation: pulse-red 0.7s; }
.price-down-1 { animation: pulse-red 0.8s; }
.price-down-2 { animation: pulse-red 0.9s; }
.price-down-3 { animation: pulse-red 1.0s; }
.price-down-4 { animation: pulse-red 1.1s; }
.price-down-5 { animation: pulse-red 1.2s; }
.price-down-6 { animation: pulse-red 1.3s; }
.price-down-7 { animation: pulse-red 1.4s; }
.price-down-8 { animation: pulse-red 1.5s; }
.price-down-9 { animation: pulse-red 1.6s; }

/* Asset toggle container styling */
.asset-toggle-container {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.asset-toggle-container .form-check {
    padding-left: 1.8rem;
}

.asset-toggle-container .form-check-input {
    margin-top: 0.2rem;
}

.asset-toggle-container .form-check-label {
    font-weight: 500;
    font-size: 0.95rem;
}

/* Color indicators for each asset */
.form-check-label[for="show-sp500"] {
    color: rgba(54, 162, 235, 1);
}

.form-check-label[for="show-bonds"] {
    color: rgba(75, 192, 192, 1);
}

.form-check-label[for="show-real-estate"] {
    color: rgba(255, 99, 132, 1);
}

.form-check-label[for="show-gold"] {
    color: rgba(255, 206, 86, 1);
}

.form-check-label[for="show-commodities"] {
    color: rgba(153, 102, 255, 1);
}

.form-check-label[for="show-bitcoin"] {
    color: rgba(255, 159, 64, 1);
}

.form-check-label[for="show-cpi"] {
    color: rgba(220, 53, 69, 1);
}
