/* Główne style dla gry tradingowej */

/* Reset i podstawowe style */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f0f2f5;
}

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

/* Nagłówek */
header {
    margin-bottom: 20px;
    text-align: center;
}

h1 {
    color: #2a4b8d;
    margin-bottom: 15px;
    font-size: 2.5rem;
}

.game-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.language-selector, .interval-selector, .range-selector {
    display: flex;
    align-items: center;
    gap: 5px;
}

select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 0.9rem;
}

button {
    padding: 8px 16px;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #2563eb;
}

/* Licznik gier */
.game-counter {
    background-color: #e0e7ff;
    padding: 10px;
    text-align: center;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 600;
    color: #4338ca;
}

/* Główny kontener gry */
#game-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 1024px) {
    #game-container {
        flex-direction: row;
    }
}

.chart-controls {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 10px;
}

.control-btn {
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
}

.control-btn:hover {
    background-color: #2563eb;
}

#reset-view {
    background-color: #6b7280;
}

#reset-view:hover {
    background-color: #4b5563;
}

/* Kontener wykresu */
.chart-container {
    flex: 1;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

#chart-area {
    flex: 1;
    position: relative;
    min-height: 350px;
    border: 1px solid #eee;
    overflow: hidden;
}

#indicators-container {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.indicator-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Panel gry */
.game-panel {
    width: 100%;
    max-width: 400px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 600px;
    overflow-y: auto;
}

.stats-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px;
    background-color: #f8fafc;
    border-radius: 6px;
}

.current-position {
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
}

.current-position.buy {
    background-color: rgba(16, 185, 129, 0.1);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.current-position.sell {
    background-color: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.current-position.none {
    background-color: rgba(107, 114, 128, 0.1);
    color: #4b5563;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.position-size-control {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background-color: #f8fafc;
    border-radius: 6px;
}

.position-size-value {
    font-weight: 600;
    color: #3b82f6;
    text-align: right;
}

.action-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.action-btn {
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
}

#buy-btn {
    background-color: #10b981;
}

#buy-btn:hover {
    background-color: #059669;
}

#sell-btn {
    background-color: #ef4444;
}

#sell-btn:hover {
    background-color: #dc2626;
}

#hold-btn {
    background-color: #f59e0b;
}

#hold-btn:hover {
    background-color: #d97706;
}

#pass-btn {
    background-color: #6b7280;
}

#pass-btn:hover {
    background-color: #4b5563;
}

.history-panel {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background-color: #f8fafc;
    border-radius: 6px;
}

.history-panel h3 {
    margin-bottom: 10px;
    font-size: 1rem;
    color: #4b5563;
}

#transaction-history {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.transaction {
    padding: 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.transaction.buy {
    background-color: rgba(16, 185, 129, 0.1);
    color: #047857;
}

.transaction.sell {
    background-color: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.transaction.hold {
    background-color: rgba(245, 158, 11, 0.1);
    color: #b45309;
}

/* Intro container */
#intro-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

#intro-container h2 {
    color: #2a4b8d;
    margin-bottom: 15px;
    text-align: center;
}

#intro-container p {
    margin-bottom: 10px;
}

#intro-container ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

#intro-container li {
    margin-bottom: 5px;
}

/* Results container */
#results-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

#results-container h2 {
    color: #2a4b8d;
    margin-bottom: 15px;
    text-align: center;
}

.results-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 15px;
    background-color: #f8fafc;
    border-radius: 6px;
    margin-bottom: 20px;
}

.company-reveal {
    margin-bottom: 20px;
}

.company-reveal h3 {
    margin-bottom: 10px;
    color: #4b5563;
}

.full-chart-container {
    margin-bottom: 20px;
}

.full-chart-container h3 {
    margin-bottom: 10px;
    color: #4b5563;
}

#full-chart-area {
    height: 400px;
    border: 1px solid #eee;
    position: relative;
}

.game-history-panel {
    margin-bottom: 20px;
}

.game-history-panel h3 {
    margin-bottom: 10px;
    color: #4b5563;
}

.game-history-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background-color: #f8fafc;
    border-radius: 6px;
}

.game-history-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

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

.game-history-item .company {
    font-weight: 600;
    color: #2a4b8d;
}

.game-history-item .score {
    font-weight: 600;
}

.game-history-item .date {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 5px;
}

#play-again, #restart-game-series {
    display: block;
    width: 200px;
    margin: 0 auto;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
}

/* Final summary container */
#final-summary-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

#final-summary-container h2 {
    color: #2a4b8d;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
    border-bottom: 2px solid #e0e7ff;
    padding-bottom: 10px;
}

.summary-stats {
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 30px;
    background-color: #f8fafc;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.summary-stats div {
    font-size: 1.1rem;
    margin-bottom: 10px;
    padding: 5px 0;
    border-bottom: 1px solid #e5e7eb;
}

.investor-quote {
    background-color: #f0f9ff;
    border-left: 4px solid #3b82f6;
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.investor-quote p {
    margin: 0;
    line-height: 1.8;
    font-size: 1.1rem;
}

.player-style {
    margin-top: 30px;
    border-top: 2px solid #e0e7ff;
    padding-top: 20px;
}

.player-style h3 {
    color: #2a4b8d;
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 1px solid #e0e7ff;
    padding-bottom: 10px;
    text-align: center;
}

.player-style-item {
    background-color: #f8f9fa;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.player-style-image {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.player-style-content {
    flex: 1;
}

.player-style-title {
    font-weight: bold;
    font-size: 1.3rem;
    color: #2a4b8d;
    margin-bottom: 12px;
}

.player-style-description {
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.animal-description {
    line-height: 1.5;
    font-style: italic;
    color: #4b5563;
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
}

/* CSS for style-item and style-emoji (for backward compatibility) */
.style-item {
    background-color: #f8f9fa;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
}

.style-emoji {
    font-size: 2.5rem;
    margin-right: 15px;
    min-width: 60px;
    text-align: center;
}

.style-description {
    flex: 1;
}
.best-worst-games {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.best-game, .worst-game {
    padding: 20px;
    background-color: #f8fafc;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.best-game {
    border-left: 4px solid #10b981;
}

.worst-game {
    border-left: 4px solid #ef4444;
}

.best-game h3, .worst-game h3 {
    margin-bottom: 15px;
    color: #4b5563;
    font-size: 1.2rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 8px;
}

/* Elementy wykresu */
.candle {
    position: absolute;
    background-color: #ef4444;
}

.candle.up {
    background-color: #10b981;
}

.candle-wick {
    position: absolute;
    width: 1px;
    background-color: #000;
}

.indicator-line {
    position: absolute;
    height: 2px;
    background-color: #3b82f6;
    transform-origin: 0 0;
}

.rsi-line {
    position: absolute;
    height: 2px;
    background-color: #8b5cf6;
    transform-origin: 0 0;
}

.rsi-threshold {
    position: absolute;
    height: 1px;
    background-color: #d1d5db;
}

.candle-tooltip {
    position: absolute;
    display: none;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    z-index: 100;
    pointer-events: none;
}

.price-label {
    position: absolute;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.7rem;
    z-index: 5;
}

.date-label {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.7rem;
    z-index: 5;
}

/* Pomocnicze klasy */
.hidden {
    display: none !important;
}

/* Stopka */
footer {
    margin-top: 30px;
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
}

/* Responsywność */
@media (max-width: 768px) {
    .game-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .results-stats, .best-worst-games {
        grid-template-columns: 1fr;
    }
}

/* Ulepszony układ strony */
@media (min-width: 1024px) {
    #game-container {
        display: grid;
        grid-template-columns: 1fr 400px;
        gap: 20px;
    }
    
    .chart-container {
        height: 600px;
    }
    
    .game-panel {
        height: 600px;
        overflow-y: auto;
    }
    
    .action-panel {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
    }
    
    .history-panel {
        max-height: 200px;
    }
}

/* Skróty klawiszowe - wizualne wskazówki */
.keyboard-shortcut {
    display: inline-block;
    background-color: #e5e7eb;
    color: #4b5563;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
    margin-left: 5px;
    font-family: monospace;
}

/* Większe markery transakcji */
.trade-marker {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    box-shadow: 0 0 0 3px white;
    z-index: 20;
}

/* Poprawiony układ historii transakcji */
.history-panel {
    max-height: 150px;
    overflow-y: auto;
}

#transaction-history {
    max-height: 120px;
    overflow-y: auto;
}

.player-style {
    margin: 20px 0;
    padding: 0;
}

.player-style h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.style-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.style-emoji {
    font-size: 2.5rem;
    margin-right: 15px;
    min-width: 60px;
    text-align: center;
}

.style-description {
    flex: 1;
}

.style-description p {
    margin: 5px 0;
    line-height: 1.4;
}

.style-description p:first-child {
    font-weight: bold;
    margin-bottom: 8px;
}
