/* Stock Detail Layout Styles */
.stock-detail-layout {
    padding: 20px;
    width: 45%;
    min-width: 900px;
    margin: 0 auto;
    background: #0a0a0a;
    min-height: 100vh;
    color: #fff;
    position: relative;
    overflow-y: auto;
}

.stock-detail-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
    justify-content: center; /* Center the content container */
}

.stock-detail-header-content {
    display: flex;
    align-items: center;
    width: 1330px; /* Same as content width: 1000px (chart) + 30px (gap) + 300px (metrics) */
    justify-content: space-between;
}

.stock-detail-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stock-detail-back-btn {
    background: rgba(124, 195, 228, 0.1);
    border: 1px solid rgba(124, 195, 228, 0.3);
    color: #7CC3E4;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.stock-detail-back-btn:hover {
    background: rgba(124, 195, 228, 0.2);
}

.stock-detail-title {
    display: flex;
    align-items: flex-end; /* Выравнивание по нижнему краю */
    gap: 4px; /* Почти вплотную как просил пользователь */
}

.stock-detail-symbol-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stock-detail-symbol-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stock-detail-symbol {
    font-size: 28px; /* Уменьшили с 32px */
    font-weight: 700;
    margin: 0;
    color: #caa999;
}

.stock-detail-website {
    color: #888;
    text-decoration: none;
    display: flex;
    align-items: center;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.stock-detail-website:hover {
    opacity: 1;
}

.stock-detail-market-cap {
    display: none;
    font-size: 14px;
    font-weight: 600;
    color: #7CC3E4;
    padding: 4px 10px;
    background: rgba(124, 195, 228, 0.1);
    border-radius: 6px;
    margin-left: 8px;
}

.stock-detail-market-cap.has-data {
    display: inline-block;
}

.stock-detail-info {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
    font-weight: 400;
}

.stock-detail-name {
    font-size: 16px;
    color: #888;
    font-weight: 400;
    line-height: 1; /* Убираем лишние отступы */
}

.stock-detail-actions {
    display: flex;
    gap: 12px;
}

.stock-detail-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid rgba(124, 195, 228, 0.3);
    background: rgba(124, 195, 228, 0.1);
    color: #7CC3E4;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.stock-detail-btn:hover {
    background: rgba(124, 195, 228, 0.2);
}

.stock-detail-btn:disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.stock-detail-content {
    display: flex;
    gap: 30px;
    min-height: calc(100vh - 180px);
    height: auto;
    justify-content: center;
    align-items: flex-start;
}

.stock-detail-left-panel {
    flex: 1 1 auto;
    max-width: 1300px;
}

.stock-detail-price-section {
    background: #1a1a1a;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.stock-detail-current-price {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.stock-detail-price-change {
    font-size: 16px;
    color: #4ade80;
}

.stock-detail-period-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.stock-detail-period-btn {
    padding: 6px 12px;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #888;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.stock-detail-period-btn.active,
.stock-detail-period-btn:hover {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
}

.stock-detail-metrics-card {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #333;
}

.stock-detail-metrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.stock-detail-metrics-header span {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    letter-spacing: 1px;
}

.metrics-edit-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metrics-edit-btn:hover {
    color: #7cc3e4;
    background: rgba(124, 195, 228, 0.1);
}

.stock-detail-metrics-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
}

.stock-detail-metric-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    border: 1px solid #2a2a2a;
    margin: -0.5px;
    min-height: 28px;
}

.stock-detail-metric-label {
    color: #888;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.stock-detail-metric-value {
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-align: right;
}

/* Analyst Ratings Card */
.stock-detail-ratings-card {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #333;
    margin-top: 20px;
}

.stock-detail-ratings-header {
    color: #caa999;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
}

.ratings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rating-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rating-row:last-child {
    border-bottom: none;
}

.rating-label {
    color: #ccc;
    font-size: 13px;
    font-weight: 500;
}

.rating-value {
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
    text-align: right;
}

.consensus-buy {
    color: #7CC3E4;
    font-weight: 700;
}

.consensus-hold {
    color: #ffb800;
    font-weight: 700;
}

.consensus-sell {
    color: #FF6B6B;
    font-weight: 700;
}

.upside-positive {
    color: #7CC3E4;
}

.upside-negative {
    color: #FF6B6B;
}

.recent-rating {
    font-size: 11px;
    color: #999;
    line-height: 1.3;
    max-width: 180px;
}

.stock-detail-chart-container {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    min-height: 505px;
    height: auto;
}

.stock-detail-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stock-detail-chart-price {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stock-detail-chart-current-price {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.stock-detail-chart-change {
    font-size: 14px;
    color: #4ade80;
}

.stock-detail-chart-timeframes {
    display: flex;
    gap: 8px;
}

.stock-detail-timeframe-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #333;
    color: #888;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.stock-detail-timeframe-btn.active {
    background: rgba(124, 195, 228, 0.1);
    border: 1px solid rgba(124, 195, 228, 0.3);
    color: #7CC3E4;
}

.stock-detail-timeframe-btn:hover {
    background: rgba(124, 195, 228, 0.2);
    border: 1px solid rgba(124, 195, 228, 0.4);
    color: #7CC3E4;
}

/* Chart Type Selector */
.stock-detail-chart-type-selector {
    margin-top: 15px;
    display: flex;
    gap: 8px;
}

.stock-detail-chart-type-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #333;
    color: #888;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.stock-detail-chart-type-btn.active {
    background: rgba(124, 195, 228, 0.1);
    border: 1px solid rgba(124, 195, 228, 0.3);
    color: #7CC3E4;
}

.stock-detail-chart-type-btn:hover {
    background: rgba(124, 195, 228, 0.2);
    border: 1px solid rgba(124, 195, 228, 0.4);
    color: #7CC3E4;
}

.stock-detail-chart {
    height: 400px;
    background: #0f0f0f;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #333;
}

.stock-detail-chart-placeholder {
    color: #666;
    font-size: 18px;
}

/* Stock Detail Info Cards */
.stock-detail-info-cards {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.stock-detail-info-card {
    flex: 1;
    background-color: #1a1a1a;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #333;
}

.stock-detail-info-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.stock-detail-info-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #caa999;
}

.stock-detail-info-card-subtitle {
    font-size: 12px;
    color: #888;
}

.stock-detail-etf-table {
    width: 100%;
}

.stock-detail-etf-table table {
    width: 100%;
    border-collapse: collapse;
}

.stock-detail-etf-table th,
.stock-detail-etf-table td {
    text-align: left;
    padding: 8px 0;
    border-bottom: 1px solid #333;
    font-size: 12px;
}

.stock-detail-etf-table th {
    color: #888;
    font-weight: 500;
}

.stock-detail-etf-table td {
    color: #fff;
}

.stock-detail-etf-table th:nth-child(2),
.stock-detail-etf-table td:nth-child(2) {
    text-align: right;
}

.stock-detail-etf-table th:nth-child(3),
.stock-detail-etf-table td:nth-child(3) {
    text-align: right;
}

.stock-detail-etf-table tbody tr:hover {
    background-color: #222;
}

.stock-detail-info-card-large {
    flex: 2; /* Takes 2/3 of the row width */
}

.stock-detail-insider-table {
    width: 100%;
}

.stock-detail-insider-table table {
    width: 100%;
    border-collapse: collapse;
}

.stock-detail-insider-table th,
.stock-detail-insider-table td {
    text-align: left;
    padding: 8px 6px;
    border-bottom: 1px solid #333;
    font-size: 11px;
}

.stock-detail-insider-table th {
    color: #888;
    font-weight: 500;
    font-size: 10px;
    text-transform: uppercase;
}

.stock-detail-insider-table td {
    color: #fff;
}

.stock-detail-insider-table th:nth-child(4),
.stock-detail-insider-table td:nth-child(4) {
    text-align: center;
}

.stock-detail-insider-table th:nth-child(5),
.stock-detail-insider-table th:nth-child(6),
.stock-detail-insider-table th:nth-child(7),
.stock-detail-insider-table td:nth-child(5),
.stock-detail-insider-table td:nth-child(6),
.stock-detail-insider-table td:nth-child(7) {
    text-align: right;
}

.stock-detail-insider-table tbody tr:hover {
    background-color: #222;
}

.stock-detail-insider-table tbody tr[onclick] {
    cursor: pointer;
}

.stock-detail-insider-table tbody tr[onclick]:hover {
    background-color: #2a2a3a;
}

.insider-action-buy {
    color: #4ade80;
    font-weight: 600;
}

.insider-action-sell {
    color: #f87171;
    font-weight: 600;
}

.insider-name {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.insider-position {
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    color: #888;
}

/* Company Description Panel */
.stock-detail-description-panel {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 16px;
}

.stock-detail-description-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.stock-detail-description-title {
    font-size: 14px;
    font-weight: 600;
    color: #caa999;
}

.stock-detail-description-content {
    font-size: 13px;
    line-height: 1.6;
    color: #b0b0b0;
    max-height: 200px;
    overflow-y: auto;
}

.stock-detail-description-content.expanded {
    max-height: none;
}

.stock-detail-description-toggle {
    background: none;
    border: none;
    color: #7CC3E4;
    font-size: 12px;
    cursor: pointer;
    padding: 8px 0 0 0;
    display: none;
}

.stock-detail-description-toggle:hover {
    text-decoration: underline;
}

.stock-detail-description-content::-webkit-scrollbar {
    width: 6px;
}

.stock-detail-description-content::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 3px;
}

.stock-detail-description-content::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.stock-detail-description-content::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Portfolio Chart Styles (same as Stock Detail) */
.portfolio-chart-container {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    min-height: 505px;
    height: auto;
}

.portfolio-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.portfolio-chart-price {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.portfolio-chart-current-price {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.portfolio-chart-change {
    font-size: 14px;
    color: #7CC3E4;
}

.portfolio-chart-timeframes {
    display: flex;
    gap: 8px;
}

.portfolio-timeframe-btn {
    padding: 8px 12px;
    border: 1px solid #333;
    background: #1a1a1a;
    color: #ccc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    font-weight: 500;
}

.portfolio-timeframe-btn:hover {
    border-color: rgba(124, 195, 228, 0.6);
    background: rgba(124, 195, 228, 0.1);
    color: #7CC3E4;
}

.portfolio-timeframe-btn.active {
    background: rgba(124, 195, 228, 0.2);
    border: 1px solid rgba(124, 195, 228, 0.4);
    color: #7CC3E4;
}

.portfolio-chart {
    height: 400px;
    background: #0f0f0f;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #333;
}

.portfolio-chart-placeholder {
    color: #666;
    font-size: 18px;
}

/* GEX (Gamma Exposure) Panel */
.stock-detail-gex-container {
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
}
.stock-detail-gex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
}
.stock-detail-gex-title {
    font-size: 12px;
    font-weight: 600;
    color: #8a8a8a;
    letter-spacing: 0.5px;
}
.stock-detail-gex-state {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 4px;
}
.gex-state-sticky {
    background: rgba(50, 215, 75, 0.15);
    color: #32D74B;
}
.gex-state-trending {
    background: rgba(255, 69, 58, 0.15);
    color: #FF453A;
}
.gex-metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-bottom: 1px solid #2a2a2a;
}
.gex-metric-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 6px;
    border-right: 1px solid #2a2a2a;
}
.gex-metric-cell:last-child {
    border-right: none;
}
.gex-metric-label {
    font-size: 10px;
    color: #666;
    margin-bottom: 3px;
    text-transform: uppercase;
}
.gex-metric-value {
    font-size: 13px;
    font-weight: 600;
    color: #e0e0e0;
}
.gex-chart-wrapper {
    padding: 8px;
    min-height: 200px;
}
.gex-levels-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 14px 12px;
    border-top: 1px solid #2a2a2a;
}
.gex-level-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #8a8a8a;
}
.gex-level-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.gex-level-value {
    color: #e0e0e0;
    font-weight: 500;
}

/* Institutional Holdings Panel */
.stock-detail-holdings-container {
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #333;
    margin-top: 20px;
    height: 530px;
    display: flex;
    flex-direction: column;
}

.stock-detail-holdings-header {
    padding: 20px 20px 15px 20px;
    border-bottom: 1px solid #333;
}

.stock-detail-holdings-title {
    font-size: 18px;
    font-weight: 600;
    color: #caa999;
    margin-bottom: 8px;
}

.stock-detail-holdings-stats {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #888;
}

.stock-detail-holdings-stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stock-detail-holdings-table {
    flex: 1;
    overflow-y: auto;
}

.stock-detail-holdings-table table {
    width: 100%;
    border-collapse: collapse;
}

.stock-detail-holdings-table th {
    background: #222;
    color: #888;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 1;
}

.stock-detail-holdings-table th:nth-child(3),
.stock-detail-holdings-table th:nth-child(4),
.stock-detail-holdings-table th:nth-child(5),
.stock-detail-holdings-table th:nth-child(6),
.stock-detail-holdings-table th:nth-child(7) {
    text-align: right;
}

.stock-detail-holdings-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #2a2a2a;
    font-size: 13px;
    vertical-align: middle;
}

.stock-detail-holdings-table tbody tr:hover {
    background: rgba(124, 195, 228, 0.05);
}

.holdings-fund-name {
    color: #fff;
    font-weight: 500;
}

.holdings-date {
    color: #888;
}

.holdings-shares {
    color: #fff;
    text-align: right;
}

.holdings-change {
    text-align: right;
    font-weight: 500;
}

.holdings-change.positive {
    color: #7CC3E4;
}

.holdings-change.negative {
    color: #FF6B6B;
}

.holdings-value {
    color: #fff;
    text-align: right;
    font-weight: 500;
}

.holdings-float {
    color: #7CC3E4;
    text-align: right;
    font-weight: 500;
}

.holdings-weight {
    color: #888;
    text-align: right;
}

.stock-detail-holdings-pagination {
    padding: 15px 20px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.holdings-pagination-info {
    font-size: 12px;
    color: #888;
}

.holdings-pagination-controls {
    display: flex;
    gap: 10px;
}

.holdings-page-btn {
    background: #2a2a2a;
    border: 1px solid #444;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.holdings-page-btn:hover {
    background: #333;
    border-color: #555;
}

.holdings-page-btn.active {
    background: rgba(124, 195, 228, 0.2);
    border-color: rgba(124, 195, 228, 0.3);
    color: #7CC3E4;
}

.holdings-page-btn:disabled {
    background: #1a1a1a;
    border-color: #333;
    color: #666;
    cursor: not-allowed;
}
