/* Stock Trading Simulator CSS */

/* Main container */
.stock-simulator {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    background-color: #f0f2f5;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Dark mode */
.dark-mode .stock-simulator {
    background-color: #1a1a1a;
    color: #d1d4dc;
}

.simulator-container {
    padding: 20px;
}

/* Header styles */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dark-mode .header-container {
    background-color: #2a2a2a;
}

.cash-portfolio {
    display: flex;
    gap: 20px;
}

.value-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.value-item span:first-child {
    font-size: 0.9rem;
    color: #666;
}

.dark-mode .value-item span:first-child {
    color: #9a9a9a;
}

.value-item span:last-child {
    font-size: 1.2rem;
    font-weight: 600;
}

.stock-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.stock-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
}

.stock-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.market-info {
    font-size: 0.9rem;
    color: #666;
}

.dark-mode .market-info {
    color: #9a9a9a;
}

/* Main content */
.main-content {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-container {
    flex: 3;
    height: 500px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.dark-mode .chart-container {
    background-color: #2a2a2a;
}

.controls-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Panels */
.panel {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 15px;
}

.dark-mode .panel {
    background-color: #2a2a2a;
}

.panel h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.dark-mode .panel h3 {
    color: #d1d4dc;
    border-bottom-color: #444;
}

/* Trading panel */
.trading-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-control input {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.dark-mode .quantity-control input {
    background-color: #3a3a3a;
    border-color: #444;
    color: #d1d4dc;
}

.total-cost {
    font-weight: 600;
    margin-bottom: 10px;
}

.trading-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.btn-success {
    background-color: #4caf50;
    color: white;
}

.btn-success:hover {
    background-color: #45a049;
}

.btn-danger {
    background-color: #f44336;
    color: white;
}

.btn-danger:hover {
    background-color: #d32f2f;
}

.btn-warning {
    background-color: #ff9800;
    color: white;
}

.btn-warning:hover {
    background-color: #f57c00;
}

.btn-info {
    background-color: #2196f3;
    color: white;
}

.btn-info:hover {
    background-color: #1976d2;
}

/* Portfolio list */
.portfolio-list, .trade-history {
    max-height: 200px;
    overflow-y: auto;
}

.portfolio-item, .trade-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.dark-mode .portfolio-item, .dark-mode .trade-item {
    border-bottom-color: #444;
}

.portfolio-item:last-child, .trade-item:last-child {
    border-bottom: none;
}

.text-green-400 {
    color: #4caf50;
}

.text-red-400 {
    color: #f44336;
}

.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.text-sm {
    font-size: 0.875rem;
}

.text-center {
    text-align: center;
}

.text-gray-500 {
    color: #6b7280;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* Bottom controls */
.bottom-controls {
    display: flex;
    justify-content: space-between;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 15px;
}

.dark-mode .bottom-controls {
    background-color: #2a2a2a;
}

.stock-selection {
    display: flex;
    gap: 10px;
}

.stock-selector {
    padding: 8px 12px;
    background-color: #eee;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: white !important;
}

.dark-mode .stock-selector {
    background-color: #3a3a3a;
    color: #d1d4dc;
}

.stock-selector:hover {
    background-color: #ddd;
}

.dark-mode .stock-selector:hover {
    background-color: #444;
}

.indicators {
    display: flex;
    gap: 15px;
    align-items: center;
}

.indicators label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.speed-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.speed-controls button {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 4px;
    background-color: #eee;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white !important;
}

.dark-mode .speed-controls button {
    background-color: #3a3a3a;
    color: #d1d4dc;
}

.game-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.game-controls select {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.dark-mode .game-controls select {
    background-color: #3a3a3a;
    border-color: #444;
    color: #d1d4dc;
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.notification {
    padding: 12px 20px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    color: white;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.notification:hover {
    opacity: 1;
}

.notification.info {
    background-color: #2196f3;
}

.notification.success {
    background-color: #4caf50;
}

.notification.error {
    background-color: #f44336;
}

.notification.warning {
    background-color: #ff9800;
}

/* Achievement notification */
.achievement-notification {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: #7e57c2;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slide-in-left 0.5s forwards;
}

.achievement-notification h3 {
    margin-top: 0;
    margin-bottom: 5px;
}

.achievement-notification p {
    margin: 0;
}

/* News container */
.news-container {
    margin-top: 20px;
    max-height: 150px;
    overflow-y: auto;
}

.news-item {
    background-color: #1f2937 !important;
    color: #ffffff !important;
    border-radius: 0.25rem !important;
    margin-bottom: 0.5rem !important;
}

.news-item p {
    color: #ffffff !important;
}

.news-item p.text-sm, 
.news-item p.text-gray-400,
.news-item .text-sm,
.news-item .text-gray-400 {
    color: #9ca3af !important;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

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

.dark-mode .modal-content {
    background-color: #2a2a2a;
    color: #d1d4dc;
}

.tutorial-section {
    margin-bottom: 20px;
}

.tutorial-section h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.tutorial-section p {
    margin-top: 0;
}

/* Animations */
@keyframes slide-in-left {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive design */
@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
    }
    
    .chart-container {
        height: 400px;
    }
    
    .bottom-controls {
        flex-wrap: wrap;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .cash-portfolio {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .value-item {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }
    
    .stock-info {
        text-align: center;
    }
}

#chart-container {
    width: 100%;
    height: 300px;
}
.hidden {
    display: none !important;
}
.trade-history-item {
    border-left: 3px solid;
    transition: all 0.3s ease;
}
.trade-history-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
.indicator-switch {
    position: relative;
    display: inline-block;
    width: 2rem;
    height: 1rem;
}
.indicator-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.indicator-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #4b5563;
    transition: .4s;
    border-radius: 1rem;
}
.indicator-slider:before {
    position: absolute;
    content: "";
    height: 0.75rem;
    width: 0.75rem;
    left: 0.125rem;
    bottom: 0.125rem;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .indicator-slider {
    background-color: #3b82f6;
}
input:checked + .indicator-slider:before {
    transform: translateX(1rem);
}
@media (max-width: 640px) {
    .speed-controls {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    .chart-controls {
        flex-direction: column;
        align-items: start;
    }
    .chart-control-item {
        margin-bottom: 0.5rem;
    }
}
/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #374151;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}
.achievement-item {
    transition: all 0.3s ease;
}
.achievement-unlocked {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

/* Adjust speed indicator */
#speed-indicator {
    width: 100%;
    text-align: center;
    margin-bottom: 0.5rem;
}

#speed-indicator.paused {
    font-weight: bold;
    color: #f59e0b; /* Amber color for paused state */
}

/* RSI Window Fix - Ensure container allows content visibility */
#indicators-container {
    overflow: visible !important;
}

/* Button styles */
button {
    background-color: #3b82f6;
    color: #ffffff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

button:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

/* Stock selector buttons */
.stock-selector {
    background-color: #4b5563;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.stock-selector:hover {
    background-color: #6b7280;
}

.stock-selector.active {
    background-color: #3b82f6;
}

/* Speed controls */
.speed-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.speed-controls button {
    background-color: #4b5563;
    color: #ffffff;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 40px;
}

.speed-controls button:hover {
    background-color: #6b7280;
}

.speed-controls button.active {
    background-color: #3b82f6;
}

.speed-controls button i.fas {
    color: #ffffff;
}

/* Mobile responsiveness for speed controls */
@media (max-width: 640px) {
    .speed-controls {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
    }
    
    .speed-controls button {
        flex: 1;
        min-width: 60px;
        padding: 0.5rem;
    }
    
    #speed-indicator {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }
}

/* Ensure all button text and icons are visible */
button, 
.stock-selector, 
.speed-controls button {
    color: #ffffff;
}

button i.fas,
.stock-selector i.fas,
.speed-controls button i.fas {
    color: #ffffff;
}

/* Dark mode adjustments */
.dark-mode button,
.dark-mode .stock-selector,
.dark-mode .speed-controls button {
    background-color: #4b5563;
    color: #ffffff;
}

.dark-mode button:hover,
.dark-mode .stock-selector:hover,
.dark-mode .speed-controls button:hover {
    background-color: #6b7280;
}

.dark-mode button.active,
.dark-mode .stock-selector.active,
.dark-mode .speed-controls button.active {
    background-color: #3b82f6;
}

/* Remove the !important declarations that were causing issues */
.stock-selector {
    color: #ffffff;
}

.speed-controls button {
    color: #ffffff;
}

.speed-controls button i.fas {
    color: #ffffff;
}

.speed-controls button:hover i.fas {
    color: #ffffff;
}

.technical-indicators {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.indicator-switch {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 0.8rem;
}

.indicator-switch label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    color: var(--text-color);
}

.indicator-switch input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
}

/* RSI specific styles */
.rsi-container {
    height: 60px;
    margin-top: 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.rsi-chart {
    width: 100%;
    height: 100%;
}

/* Dark mode adjustments */
.dark-mode .indicator-switch {
    background: rgba(0, 0, 0, 0.2);
}

/* Ensure market news container has proper background */
#news-container {
    background-color: #1f2937 !important;
}

/* Additional news items fixes to ensure dark background */
#news-container .news-item {
    background-color: #1f2937 !important; /* Dark gray background */
    border-radius: 0.375rem !important; /* Equivalent to 'rounded' */
    margin-bottom: 0.5rem !important;
    color: white !important;
}

#news-container .news-item p.font-bold,
#news-container .news-item strong,
#news-container .news-item .font-bold {
    color: #ffffff !important; /* Ensure white text for bold/titles */
}

/* Force white text specifically for the welcome message title */
#news-container .news-item:first-child p:first-child {
    color: #ffffff !important;
}

/* Chart controls container - moved above stock name */
.chart-controls {
    position: relative;
    z-index: 50;
}

#indicators-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.25rem;
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.375rem;
    padding: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    min-width: 8rem;
    max-width: 10rem;
    z-index: 1000;
}

.chart-control-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
}

.chart-control-item:last-child {
    margin-bottom: 0;
}

.chart-control-item select {
    background-color: #374151;
    color: white;
    border: none;
    border-radius: 0.25rem;
    padding: 0.125rem;
    font-size: 0.7rem;
    margin-left: 0.25rem;
    width: 3rem;
}

.indicator-switch {
    position: relative;
    display: inline-block;
    width: 1.5rem;
    height: 0.75rem;
    margin-left: 0.25rem;
}

.indicator-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #4b5563;
    transition: .4s;
    border-radius: 0.75rem;
}

.indicator-slider:before {
    position: absolute;
    content: "";
    height: 0.5rem;
    width: 0.5rem;
    left: 0.125rem;
    bottom: 0.125rem;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .indicator-slider {
    background-color: #3b82f6;
}

input:checked + .indicator-slider:before {
    transform: translateX(0.75rem);
}

@media (max-width: 640px) {
    #indicators-dropdown {
        width: 8rem;
        left: 0;
        transform: none;
    }
}

/* Make period inputs smaller */
#sma-period, #rsi-period {
    width: 40px;
    padding: 2px 4px;
    font-size: 0.75rem;
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 3px;
    color: white;
}

/* Make stock selectors more compact */
.stock-selector {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    height: auto;
    line-height: 1.2;
}

/* Make chart title and price smaller */
#current-stock-name, #current-stock-price {
    font-size: 0.8rem;
}

@media (min-width: 640px) {
    #current-stock-name, #current-stock-price {
        font-size: 0.9rem;
    }
}

/* Chart Controls Info */
.chart-controls-info {
    transition: all 0.3s ease;
}

.chart-controls-info:hover {
    background-color: rgba(31, 41, 55, 0.8) !important;
}

.chart-controls-info ul {
    transition: all 0.3s ease;
}

.chart-controls-info li {
    transition: all 0.2s ease;
}

.chart-controls-info li:hover {
    color: #60a5fa;
    transform: translateX(2px);
}

@media (max-width: 640px) {
    .chart-controls-info {
        font-size: 0.7rem;
    }
}

#chart-controls-toggle {
    transition: all 0.2s ease;
    background-color: #4b5563;
    color: #ffffff;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.65rem;
    pointer-events: auto;
    z-index: 100;
}

#chart-controls-toggle:hover {
    background-color: #6b7280;
}

#chart-controls-toggle i {
    color: #ffffff;
    transition: transform 0.3s ease;
    font-size: 0.65rem;
}

#chart-controls-info {
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: auto;
    z-index: 100;
}

#chart-controls-info:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

/* Account Summary Styles */
.account-btn {
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 40;
}

.account-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.account-btn i {
    margin-right: 0.25rem;
}

#account-summary-modal {
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 50;
    transition: opacity 0.3s ease;
}

#close-account-summary {
    transition: all 0.2s ease;
    padding: 0.5rem;
    font-size: 1.25rem;
    border-radius: 50%;
}

#close-account-summary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

/* Trade history toggle styles */
#toggle-trade-history {
    transition: all 0.2s ease;
}

#toggle-trade-history:hover {
    background-color: #4a5568;
}

.last-trade {
    border-left: 4px solid #4a5568;
}

.bg-gray-750 {
    background-color: rgba(55, 65, 81, 0.5);
}

/* Make sure the fixed buttons don't overlap with other elements */
@media (max-width: 640px) {
    .account-btn {
        top: 1rem;
        right: 1rem;
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
    
    #notification-container {
        top: 3.5rem;
    }
    
    /* Mobile-specific styles for account summary */
    #account-summary-modal .bg-gray-800 {
        max-width: 100%;
        width: 95%;
    }
    
    #full-trade-history {
        max-height: 50vh;
    }
} 