/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    user-select: none;
}

/* Начальный экран */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.start-content {
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.game-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.game-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.play-button {
    padding: 1.2rem 4rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.play-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.play-button:active {
    transform: scale(0.98);
}

/* Главное меню */
.main-menu {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 3rem;
}

.main-menu.hidden {
    display: none !important;
}

.menu-button {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 280px;
}

.menu-button.primary {
    background: rgba(255, 255, 255, 0.25);
    border-color: white;
}

.menu-button.secondary {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.menu-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.menu-button:active {
    transform: translateY(0);
}

/* Disabled button styles */
.menu-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.menu-button.disabled:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: none;
    box-shadow: none;
}

.button-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: 0.5rem;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.button-icon {
    font-size: 1.5rem;
}

.button-text {
    font-size: 1.2rem;
}

/* Copyright notice */
.copyright-notice {
    margin-top: 2rem;
    padding: 1rem;
    max-width: 900px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.copyright-notice p {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    text-align: center;
    margin: 0;
}

/* Экран выбора класса */
.class-selection {
    margin-top: 1rem;
    animation: fadeIn 0.4s ease;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    padding-right: 10px;
}

.class-selection::-webkit-scrollbar {
    width: 8px;
}

.class-selection::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.class-selection::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.class-selection::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.class-selection.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.selection-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.selection-subtitle {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.class-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 1.5rem;
    max-width: 1100px;
}

.class-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.class-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

.card-header {
    padding: 15px;
    text-align: center;
    color: white;
}

.lower-class {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.middle-class {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.upper-class {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
}

.class-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 8px;
}

.class-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

.card-body {
    padding: 15px;
}

.class-description {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.4;
}

.class-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.class-features li {
    padding: 6px 0;
    font-size: 0.8rem;
    color: #333;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.class-features li:last-child {
    border-bottom: none;
}

/* Игровой интерфейс */
.game-interface {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 1080"><rect fill="%230078D4" width="1920" height="1080"/><rect fill="%23006CBE" x="0" y="0" width="1920" height="1080" opacity="0.3"/></svg>');
    background-size: cover;
    background-position: center;
    z-index: 500;
}

.game-interface.hidden {
    display: none;
}

.start-screen.hidden {
    display: none !important;
}

/* Рабочий стол */
.desktop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 48px);
    padding: 20px;
    overflow: hidden;
}

/* Контейнер для окон */
.window-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.window-container .report-window,
.window-container .app-window {
    pointer-events: auto;
}

/* Иконки на рабочем столе */
.desktop-icons {
    position: relative;
    width: 100%;
    height: 100%;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    padding: 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease;
    user-select: none;
    position: relative;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.desktop-icon:active {
    cursor: grabbing;
}

.desktop-icon[style*="position: absolute"] {
    transition: none;
}

.desktop-icon.dragging {
    opacity: 0.8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.icon-image {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.icon-label {
    color: white;
    font-size: 0.75rem;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Окно отчета */
.report-window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: box-shadow 0.3s ease, opacity 0.3s ease;
}

.report-window.minimizing {
    animation: minimizeWindow 0.3s ease-out forwards;
}

.report-window.minimized {
    height: auto;
    display: none !important;
}

@keyframes minimizeWindow {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    50% {
        transform: scale(0.95) translateY(20px);
        opacity: 0.7;
    }
    100% {
        transform: scale(0.3) translateY(100vh);
        opacity: 0;
    }
}

.report-window.minimized .window-content {
    display: none;
    animation: fadeOutContent 0.2s ease-out;
}

@keyframes fadeOutContent {
    from {
        opacity: 1;
        max-height: 500px;
    }
    to {
        opacity: 0;
        max-height: 0;
    }
}

.report-window.minimized .window-header {
    cursor: pointer;
    border-radius: 8px;
}

/* Анимация разворачивания окна */
.report-window.restoring {
    display: block !important;
    animation: restoreWindow 0.3s ease-out forwards;
}

@keyframes restoreWindow {
    0% {
        transform: scale(0.3) translateY(100vh);
        opacity: 0;
    }
    50% {
        transform: scale(0.95) translateY(20px);
        opacity: 0.7;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.window-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(243, 243, 243, 0.9);
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: border-radius 0.3s ease, background 0.2s ease;
    cursor: grab;
    user-select: none;
}

.window-header:active {
    cursor: grabbing;
}

/* Состояние перетаскивания окна */
.game-window.dragging {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.2s ease;
}

/* Отключаем все transition при перетаскивании для мгновенной реакции */
.game-window.dragging * {
    transition: none !important;
}

/* Явно отключаем transition для transform при перетаскивании */
.game-window.dragging {
    transition: box-shadow 0.2s ease !important;
}

.game-window.dragging .window-header {
    background: rgba(255, 255, 255, 0.95);
}

.window-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.window-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    color: #1a1a1a;
    transition: background 0.2s ease, transform 0.1s ease;
}

.window-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.window-btn:active {
    transform: scale(0.9);
}

.window-btn.close:hover {
    background: #e81123;
    color: white;
}

.window-content {
    padding: 20px;
    overflow-y: auto;
    height: calc(100% - 48px); /* Высота окна минус высота заголовка */
}

.report-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.info-label {
    font-weight: 600;
    color: #1a1a1a;
}

.info-value {
    color: #0078D4;
    font-weight: 500;
}

/* Панель задач */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background: rgba(243, 243, 243, 0.85);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    z-index: 100;
}

.taskbar-left,
.taskbar-center,
.taskbar-right {
    display: flex;
    align-items: center;
}

.taskbar-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.taskbar-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.windows-logo {
    font-size: 1.5rem;
    color: #0078D4;
}

.taskbar-icons {
    display: flex;
    gap: 4px;
}

.taskbar-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.taskbar-icon:hover {
    background: rgba(0, 0, 0, 0.05);
}

.taskbar-icon.active {
    background: rgba(0, 120, 212, 0.1);
    border-bottom: 3px solid #0078D4;
}

.system-tray {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pause-btn {
    font-size: 1.2rem;
}

.time-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.time-display:hover {
    background: rgba(0, 0, 0, 0.05);
}

.game-time {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
}

.game-date {
    font-size: 0.75rem;
    color: #666;
}

/* Меню Пуск */
.start-menu {
    position: fixed;
    bottom: 56px;
    left: 8px;
    width: 320px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 200;
    max-height: 70vh;
    overflow-y: auto;
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.start-menu.hidden {
    display: none;
}

.start-menu-header {
    padding: 16px;
    background: rgba(0, 120, 212, 0.1);
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.start-menu-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #1a1a1a;
}

.start-menu-content {
    padding: 8px;
}

.menu-section {
    margin-bottom: 16px;
}

.menu-section h4 {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 8px 0;
    padding: 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 4px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.95rem;
    color: #1a1a1a;
}

.menu-item:hover {
    background: rgba(0, 120, 212, 0.1);
}

.menu-item:active {
    background: rgba(0, 120, 212, 0.2);
}

.menu-item.danger {
    color: #e81123;
}

.menu-item.danger:hover {
    background: rgba(232, 17, 35, 0.1);
}

.menu-icon {
    margin-right: 12px;
    font-size: 1.1rem;
}

.menu-text {
    flex: 1;
    text-align: left;
}

.start-menu-footer {
    padding: 12px 16px;
    background: rgba(243, 243, 243, 0.9);
    border-radius: 0 0 8px 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.save-status {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
}

/* Анимации уведомлений */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* Пульсация для непрочитанных новостей */
@keyframes pulse-blue {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
    }

    .game-subtitle {
        font-size: 1.2rem;
    }

    .play-button {
        padding: 1rem 3rem;
        font-size: 1.2rem;
    }

    .report-window {
        width: 90%;
        max-width: 400px;
    }

    .desktop-icons {
        max-width: 300px;
    }
}

/* ============================================
   TRADING TERMINAL STYLES
   ============================================ */

/* Основной контейнер терминала */
.trading-terminal {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: linear-gradient(180deg, #0a0e27 0%, #1a1f3a 100%);
    color: #e0e0e0;
    font-family: 'Segoe UI', 'Roboto', monospace;
}

/* Верхняя панель терминала */
.terminal-header {
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid #2d3561;
    padding: 10px;
}

/* Бегущая строка тикера */
.ticker-bar {
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    overflow: hidden;
    white-space: nowrap;
}

.ticker-text {
    display: inline-block;
    animation: ticker-scroll 30s linear infinite;
    font-size: 0.9rem;
    font-weight: 600;
}

@keyframes ticker-scroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Панель поиска и избранного */
.search-favorites-bar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.terminal-search-input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #2d3561;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.terminal-search-input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.15);
}

.btn-favorites-toggle {
    padding: 8px 16px;
    background: linear-gradient(135deg, #ffa500 0%, #ff8c00 100%);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-favorites-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.4);
}

/* Основной контейнер с тремя панелями */
.terminal-main-container {
    display: grid;
    grid-template-columns: 300px 1fr 350px;
    gap: 10px;
    padding: 10px;
    flex: 1;
    overflow: hidden;
}

/* Левая панель: Список активов */
.terminal-left-panel {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

/* Вкладки категорий в терминале */
.terminal-left-panel .market-tabs {
    display: flex;
    gap: 5px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    overflow-x: auto;
    flex-wrap: wrap;
}

.terminal-left-panel .market-tab {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #2d3561;
    border-radius: 6px;
    color: #b0b0b0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.terminal-left-panel .market-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    font-weight: 600;
}

.terminal-left-panel .market-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    border-color: #667eea;
}

/* Контейнер списка активов */
.assets-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 5px;
}

/* Таблица активов в терминале */
.terminal-assets-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.terminal-assets-table thead {
    background: rgba(0, 0, 0, 0.4);
    position: sticky;
    top: 0;
    z-index: 10;
}

.terminal-assets-table th {
    padding: 8px 5px;
    text-align: left;
    color: #888;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    border-bottom: 2px solid #2d3561;
}

.terminal-assets-table td {
    padding: 8px 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-assets-table tbody tr {
    cursor: pointer;
    transition: background 0.2s;
}

.terminal-assets-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.1);
}

.terminal-assets-table tbody tr.selected {
    background: rgba(102, 126, 234, 0.2);
    border-left: 3px solid #667eea;
}

.favorite-star {
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
    user-select: none;
}

.favorite-star:hover {
    transform: scale(1.2);
}

.favorite-star.active {
    color: #ffa500;
    text-shadow: 0 0 8px rgba(255, 165, 0, 0.6);
}

.asset-ticker-cell {
    font-weight: 600;
    color: #fff;
}

.asset-price-cell {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.asset-change-cell.positive {
    color: #4caf50;
    font-weight: 600;
}

.asset-change-cell.negative {
    color: #f44336;
    font-weight: 600;
}

/* Центральная панель: График и стакан */
.terminal-center-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

/* Переключатель режима торговли */
.trading-mode-selector {
    display: flex;
    gap: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.mode-btn {
    flex: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #2d3561;
    border-radius: 6px;
    color: #b0b0b0;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.mode-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    border-color: #667eea;
}

/* Заблокированная кнопка фьючерсов */
.mode-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255, 82, 82, 0.1);
    border-color: rgba(255, 82, 82, 0.3);
    color: #666;
}

.mode-btn.disabled:hover {
    background: rgba(255, 82, 82, 0.1);
    border-color: rgba(255, 82, 82, 0.3);
}

/* Контейнер графика */
.chart-container {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    position: relative;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Панель выбора таймфрейма */
.timeframe-selector {
    display: flex;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid #2d3561;
    overflow-x: auto;
    flex-shrink: 0;
    align-items: center;
}

/* Dropdown для выбора таймфрейма */
.timeframe-dropdown {
    padding: 4px 10px;
    background: rgba(10, 14, 39, 0.9);
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 4px;
    color: #ccd6f6;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'Segoe UI', monospace;
    outline: none;
    min-width: 120px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.timeframe-dropdown:hover {
    border-color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
}

.timeframe-dropdown:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.timeframe-dropdown option {
    background: #0a0e27;
    color: #ccd6f6;
    padding: 8px;
}

/* Стилизация скроллбара для панели таймфреймов */
.timeframe-selector::-webkit-scrollbar {
    height: 3px;
}

.timeframe-selector::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.timeframe-selector::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.4);
    border-radius: 2px;
}

.timeframe-selector::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.6);
}

/* Кнопка полноэкранного режима */
.fullscreen-btn {
    margin-left: auto;
    padding: 3px 10px;
    background: transparent;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 3px;
    color: #8892b0;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-btn:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: #667eea;
    color: #ccd6f6;
}

/* Полноэкранный режим графика */
.chart-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    background: #0a0e27;
}

.chart-container.fullscreen .timeframe-selector {
    background: rgba(10, 14, 39, 0.95);
}

.chart-container.fullscreen #terminal-chart-canvas {
    width: 100%;
    height: calc(100vh - 40px);
}

#terminal-chart-canvas {
    flex: 1;
    width: 100%;
    display: block;
    cursor: crosshair;
}

.chart-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
    font-size: 1rem;
    z-index: 10;
}

.chart-placeholder.hidden {
    display: none;
}

/* Стакан ордеров */
.order-book-container {
    flex: 0 0 auto;
    min-height: 350px;
    max-height: 500px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.order-book-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #2d3561;
}

.order-book-header h4 {
    margin: 0;
    font-size: 0.9rem;
    color: #e0e0e0;
}

.spread-display {
    font-size: 0.8rem;
    color: #888;
    font-family: 'Courier New', monospace;
}

/* Order Book Controls */
.order-book-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    max-width: 100%;
    box-sizing: border-box;
}

.filter-buttons {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.filter-btn {
    padding: 3px 8px;
    border: 1px solid #2d3561;
    background: rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #4a5568;
}

.filter-btn.active {
    background: rgba(102, 126, 234, 0.3);
    border-color: #667eea;
    color: #fff;
}

.range-selector {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.range-selector label {
    font-size: 0.7rem;
    color: #888;
    white-space: nowrap;
}

.range-selector select {
    padding: 3px 6px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #2d3561;
    color: #e0e0e0;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    max-width: 100px;
}

.range-selector select:focus {
    outline: none;
    border-color: #667eea;
}

.order-book-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
    min-height: 0;
}

.order-book-asks,
.order-book-bids {
    flex: 1;
    overflow-y: auto;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
}

.order-book-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 8px;
    margin: 2px 0;
    border-radius: 3px;
    position: relative;
}

.order-book-row.ask {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.order-book-row.bid {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}

/* Liquidity Walls - highlighted round number levels */
.order-book-row.wall {
    font-weight: bold;
    border-left: 3px solid;
}

.order-book-row.ask.wall {
    background: rgba(244, 67, 54, 0.25);
    border-left-color: #f44336;
}

.order-book-row.bid.wall {
    background: rgba(76, 175, 80, 0.25);
    border-left-color: #4caf50;
}

.order-book-current-price {
    text-align: center;
    padding: 8px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 6px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
    font-family: 'Courier New', monospace;
    margin: 5px 0;
}

/* Правая панель: Панель торговли */
.terminal-right-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

/* Карточка информации об активе */
.asset-info-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.asset-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 8px;
}

.asset-price-large {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    font-family: 'Courier New', monospace;
    margin-bottom: 5px;
}

.asset-change {
    font-size: 1rem;
    font-weight: 600;
}

.asset-change.positive {
    color: #4caf50;
}

.asset-change.negative {
    color: #f44336;
}

/* Панель торговли */
.trading-panel {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px;
}

.trading-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.trade-tab {
    flex: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #2d3561;
    border-radius: 6px;
    color: #b0b0b0;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.trade-tab.active[data-side="buy"] {
    background: linear-gradient(135deg, #4caf50 0%, #8bc34a 100%);
    border-color: #4caf50;
    color: white;
}

.trade-tab.active[data-side="sell"] {
    background: linear-gradient(135deg, #f44336 0%, #ff5252 100%);
    border-color: #f44336;
    color: white;
}

/* Форма торговли */
.trading-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 0.85rem;
    color: #888;
    font-weight: 600;
}

.trade-input {
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #2d3561;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    transition: all 0.2s;
}

.trade-input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.15);
}

.commission-display,
.total-display {
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    color: #ffa500;
    font-weight: 600;
}

.total-display {
    font-size: 1.2rem;
    color: #667eea;
}

.balance-info {
    padding: 10px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
    font-size: 0.85rem;
    color: #b0b0b0;
    border-left: 3px solid #667eea;
}

#asset-holdings {
    padding: 10px;
    background: rgba(0, 230, 118, 0.1);
    border-radius: 6px;
    font-size: 0.85rem;
    color: #b0b0b0;
    border-left: 3px solid #00E676;
    margin-top: 8px;
}

.btn-execute-trade {
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.btn-execute-trade.btn-buy {
    background: linear-gradient(135deg, #4caf50 0%, #8bc34a 100%);
    color: white;
}

.btn-execute-trade.btn-sell {
    background: linear-gradient(135deg, #f44336 0%, #ff5252 100%);
    color: white;
}

.btn-execute-trade:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-execute-trade:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Стакан ордеров */
.order-book-container {
    margin-top: 15px;
    background: rgba(10, 14, 39, 0.8);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    padding: 15px;  /* Увеличен padding для большего пространства */
}

.order-book-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.order-book-header h4 {
    margin: 0;
    font-size: 0.9rem;
    color: #ccd6f6;
}

.spread-display {
    font-size: 0.75rem;
    color: #8892b0;
    font-family: 'Courier New', monospace;
}

.order-book-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
}

.order-book-asks,
.order-book-bids {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-book-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
    border-radius: 3px;
    transition: background 0.2s;
}

.order-book-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.order-book-row.ask {
    background: rgba(255, 23, 68, 0.1);
    color: #FF1744;
}

.order-book-row.bid {
    background: rgba(0, 230, 118, 0.1);
    color: #00E676;
}

.order-book-current-price {
    text-align: center;
    padding: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #667eea;
    border-top: 1px solid rgba(102, 126, 234, 0.3);
    border-bottom: 1px solid rgba(102, 126, 234, 0.3);
    margin: 4px 0;
    font-family: 'Courier New', monospace;
}

/* Открытые позиции */
.open-positions-container {
    margin-top: 15px;
    background: rgba(10, 14, 39, 0.8);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 8px;
    padding: 12px;
}

.positions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.positions-header h4 {
    margin: 0;
    font-size: 0.9rem;
    color: #ccd6f6;
}

.positions-count {
    font-size: 0.75rem;
    color: #8892b0;
}

.positions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.no-positions-message {
    text-align: center;
    padding: 20px;
    color: #8892b0;
    font-size: 0.85rem;
}

.position-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 6px;
    padding: 10px;
    transition: all 0.2s;
}

.position-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(102, 126, 234, 0.4);
}

.position-card.long {
    border-left: 3px solid #00E676;
}

.position-card.short {
    border-left: 3px solid #FF1744;
}

.position-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.position-ticker {
    font-weight: bold;
    font-size: 0.95rem;
    color: #ccd6f6;
}

.position-direction {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.position-direction.long {
    background: rgba(0, 230, 118, 0.2);
    color: #00E676;
}

.position-direction.short {
    background: rgba(255, 23, 68, 0.2);
    color: #FF1744;
}

.position-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    font-size: 0.8rem;
}

.position-detail {
    display: flex;
    justify-content: space-between;
}

.position-label {
    color: #8892b0;
}

.position-value {
    color: #ccd6f6;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.position-pnl.positive {
    color: #00E676;
}

.position-pnl.negative {
    color: #FF1744;
}

.position-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
}

.btn-add-margin {
    flex: 1;
    padding: 6px;
    background: rgba(0, 230, 118, 0.2);
    border: 1px solid #00E676;
    border-radius: 4px;
    color: #00E676;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-margin:hover {
    background: rgba(0, 230, 118, 0.3);
}

.btn-close-position {
    flex: 1;
    padding: 6px;
    background: rgba(255, 23, 68, 0.2);
    border: 1px solid #FF1744;
    border-radius: 4px;
    color: #FF1744;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-close-position:hover {
    background: rgba(255, 23, 68, 0.3);
}

/* Селектор направления фьючерсов */
.futures-direction-selector {
    display: flex;
    gap: 10px;
}

.direction-btn {
    flex: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #2d3561;
    border-radius: 6px;
    color: #b0b0b0;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.direction-btn.long.active {
    background: linear-gradient(135deg, #4caf50 0%, #8bc34a 100%);
    border-color: #4caf50;
    color: white;
}

.direction-btn.short.active {
    background: linear-gradient(135deg, #f44336 0%, #ff5252 100%);
    border-color: #f44336;
    color: white;
}

/* Быстрые кнопки объема */
.quick-volume-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-top: 10px;
}

.quick-volume-buttons button {
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #2d3561;
    border-radius: 6px;
    color: #b0b0b0;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-volume-buttons button:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    color: white;
}

.position-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
}

.btn-add-margin {
    flex: 1;
    padding: 6px;
    background: rgba(0, 230, 118, 0.2);
    border: 1px solid #00E676;
    border-radius: 4px;
    color: #00E676;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-margin:hover {
    background: rgba(0, 230, 118, 0.3);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 1200px) {
    .terminal-main-container {
        grid-template-columns: 250px 1fr 300px;
    }
}

@media (max-width: 992px) {
    .terminal-main-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .terminal-left-panel {
        max-height: 300px;
    }
    
    .terminal-center-panel {
        min-height: 400px;
    }
}

@media (max-width: 576px) {
    .timeframe-selector {
        gap: 6px;
        padding: 4px 8px;
    }
    
    .timeframe-dropdown {
        font-size: 0.7rem;
        min-width: 100px;
        padding: 3px 8px;
    }
}

/* ========================================
   Full-Screen News Modal Styles
   ======================================== */

#news-detail-modal {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

#news-detail-modal > div {
    animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideUp {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Comments Section Styles */
#news-comments-section {
    transition: all 0.3s ease;
}

/* When comments are visible, ensure proper spacing */
#news-comments-section[style*="display: block"] {
    min-height: 250px !important;
}

.comment-item {
    animation: commentSlideIn 0.3s ease-out;
    animation-fill-mode: both;
}

/* Стили для веток комментариев (ответов) */
.comment-replies {
    margin-left: 20px;
    padding-left: 12px;
    border-left: 2px solid #e8ecf1;
    margin-top: 8px;
}

/* Визуальная лесенка для глубоких веток */
.comment-replies .comment-replies {
    border-left-color: #d1d5db;
}

.comment-replies .comment-replies .comment-replies {
    border-left-color: #9ca3af;
}

.comment-reply-indicator {
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.comment-reply-indicator::before {
    content: '↳';
    font-size: 1rem;
    color: #667eea;
}

.comment-item:nth-child(1) { animation-delay: 0.05s; }
.comment-item:nth-child(2) { animation-delay: 0.1s; }
.comment-item:nth-child(3) { animation-delay: 0.15s; }
.comment-item:nth-child(4) { animation-delay: 0.2s; }
.comment-item:nth-child(5) { animation-delay: 0.25s; }

@keyframes commentSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scrollbar styling for comments */
#news-comments-section::-webkit-scrollbar,
#news-detail-body::-webkit-scrollbar {
    width: 8px;
}

#news-comments-section::-webkit-scrollbar-track,
#news-detail-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#news-comments-section::-webkit-scrollbar-thumb,
#news-detail-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: background 0.2s;
}

#news-comments-section::-webkit-scrollbar-thumb:hover,
#news-detail-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

#news-comments-section::-webkit-scrollbar-track,
#news-detail-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#news-comments-section::-webkit-scrollbar-thumb,
#news-detail-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: background 0.2s;
}

#news-comments-section::-webkit-scrollbar-thumb:hover,
#news-detail-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Empty state animation */
#news-comments-section > div:first-child {
    animation: emptyStatePulse 2s ease-in-out infinite;
}

@keyframes emptyStatePulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    #news-detail-modal {
        padding: 10px;
    }
    
    #news-detail-modal > div {
        width: 100%;
        max-height: 95vh;
    }
    
    #news-comments-section {
        max-height: 25vh;
        min-height: 120px;
    }
}

/* Fullscreen Mode Styles */
#news-detail-modal.fullscreen-mode {
    padding: 0 !important;
}

#news-detail-modal.fullscreen-mode > div {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Ensure modal doesn't go under Windows taskbar */
    margin-top: 0;
    margin-bottom: 0;
}

/* Smooth transitions for modal content elements */
#news-detail-body,
#news-comments-section,
#news-detail-headline,
#news-detail-meta {
    transition: all 0.3s ease;
}
