/**
 * Warroom Layout CSS
 * 
 * Multi-column responsive dashboard for:
 * - Investor Behavior Analysis
 * - Mentor Coaching Suggestions
 * - Market News & Alerts
 * - Portfolio Snapshot
 * - Analytics Report
 * 
 * Features:
 * - Responsive 3-column layout (left, center, right)
 * - Vertical scrollable sections within each column
 * - Optional horizontal scroll for data tables
 * - Resizable panels with drag handles
 * - Collapsible cards with minimize buttons
 */

/* ============================================================================
   Base Warroom Container
   ============================================================================ */

.warroom-section {
    width: 100%;
    height: 100%;
    overflow: auto;
    background: var(--bg-primary);
    color: var(--text-primary);
    box-sizing: border-box;
}

.warroom-container {
    margin-top: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    height: auto;
    padding: 12px 0;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
    
    /* Support for resizable columns via CSS variables */
    --col-left-width: 1fr;
    --col-center-width: 1fr;
    --col-right-width: 1fr;
}

/* Responsive: Tablet - 2 columns */
@media (max-width: 1200px) {
    .warroom-container {
        grid-template-columns: 1fr 1fr;
    }
    
    .warroom-column-right {
        grid-column: 1 / -1;
    }
}

/* Responsive: Mobile - 1 column */
@media (max-width: 768px) {
    .warroom-container {
        grid-template-columns: 1fr;
    }
    
    .warroom-column-center,
    .warroom-column-right {
        grid-column: auto;
    }
}

/* ============================================================================
   Column Layout
   ============================================================================ */

.warroom-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: visible;
    
    /* Smooth scrolling */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Scrollbar styling */
.warroom-column::-webkit-scrollbar {
    width: 8px;
}

.warroom-column::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.warroom-column::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.warroom-column::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ============================================================================
   Card Base Style
   ============================================================================ */

.warroom-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    
    /* Smooth transitions */
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.warroom-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.warroom-card.minimized .card-body {
    display: none;
}

.card-header {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.card-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.card-header i {
    color: var(--accent-color);
}

.header-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.card-minimize {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.card-minimize:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.card-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-body::-webkit-scrollbar {
    width: 6px;
}

.card-body::-webkit-scrollbar-track {
    background: transparent;
}

.card-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* ============================================================================
   Behavior Analysis Card
   ============================================================================ */

.behavior-analysis {
    min-height: 300px;
}

.behavior-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.metric-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-item label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-light));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.metric-value {
    font-size: 12px;
    color: var(--text-secondary);
}

.behavior-insights {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.behavior-insights h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.behavior-insights ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.behavior-insights li {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================================================
   Mentor Coaching Card
   ============================================================================ */

.mentor-coaching {
    min-height: 400px;
}

.coaching-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.coaching-item {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--border-color);
    border-radius: 4px;
    padding: 12px;
    display: flex;
    gap: 12px;
    transition: all 0.2s ease;
}

.coaching-item:hover {
    background: var(--bg-primary);
}

.coaching-item.priority-high {
    border-left-color: #e74c3c;
    background: rgba(231, 76, 60, 0.05);
}

.coaching-item.priority-medium {
    border-left-color: #f39c12;
    background: rgba(243, 156, 18, 0.05);
}

.coaching-item.priority-low {
    border-left-color: #27ae60;
    background: rgba(39, 174, 96, 0.05);
}

.priority-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    min-width: 50px;
    text-align: center;
}

.coaching-item.priority-high .priority-badge {
    background: #e74c3c;
    color: white;
}

.coaching-item.priority-medium .priority-badge {
    background: #f39c12;
    color: white;
}

.coaching-item.priority-low .priority-badge {
    background: #27ae60;
    color: white;
}

.item-content {
    flex: 1;
}

.item-content h5 {
    margin: 0 0 4px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.item-content p {
    margin: 0 0 6px 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.confidence {
    font-size: 11px;
    color: var(--accent-color);
    font-weight: 500;
}

/* ============================================================================
   News Feed Card
   ============================================================================ */

.news-feed {
    min-height: 400px;
}

.news-filter {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
}

.news-body {
    overflow-x: auto;
}

.news-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin-bottom: 8px;
    border-left: 4px solid var(--border-color);
    transition: all 0.2s ease;
}

.news-item:hover {
    background: var(--bg-primary);
    border-left-color: var(--accent-color);
}

.news-item.urgent {
    border-left-color: #e74c3c;
    background: rgba(231, 76, 60, 0.05);
}

.news-time {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    margin-top: 2px;
}

.news-content {
    flex: 1;
}

.news-content h5 {
    margin: 0 0 4px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.news-content p {
    margin: 0 0 8px 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.news-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.tag.portfolio-related {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.tag.high-impact {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.tag.market-wide {
    background: rgba(155, 89, 182, 0.2);
    color: #9b59b6;
}

.tag.opportunity {
    background: rgba(39, 174, 96, 0.2);
    color: #27ae60;
}

.tag.volatility {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

.tag.diversification {
    background: rgba(52, 73, 94, 0.2);
    color: #34495e;
}

/* ============================================================================
   Portfolio Snapshot Card
   ============================================================================ */

.portfolio-snapshot {
    min-height: 300px;
}

.portfolio-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.summary-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-stat label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-change {
    font-size: 12px;
    font-weight: 500;
}

.stat-change.positive {
    color: #27ae60;
}

.stat-change.negative {
    color: #e74c3c;
}

.portfolio-positions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.position {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.position-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
}

.symbol {
    color: var(--text-primary);
    font-weight: 600;
}

.percentage {
    color: var(--text-secondary);
}

.position-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.position-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    border-radius: 3px;
}

.position-value {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ============================================================================
   Analytics Report Card
   ============================================================================ */

.analytics-report {
    min-height: 300px;
}

.analytics-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.analytics-section:last-child {
    border-bottom: none;
}

.analytics-section h5 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.engagement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 12px;
}

.engagement-item span {
    color: var(--text-secondary);
}

.engagement-item strong {
    color: var(--accent-color);
    font-size: 14px;
}

.pattern-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 12px;
}

.pattern-item label {
    color: var(--text-secondary);
}

.pattern-item span {
    color: var(--text-primary);
    font-weight: 500;
}

.interest-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.interest-tag {
    display: inline-block;
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.interest-tag:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* ============================================================================
   Resizable Column Support (for future implementation)
   ============================================================================ */

.warroom-column.resizing {
    user-select: none;
}

.column-resize-handle {
    width: 4px;
    cursor: col-resize;
    background: transparent;
    transition: background 0.2s ease;
}

.column-resize-handle:hover {
    background: var(--accent-color);
}

/* ============================================================================
   Dark Mode Support
   ============================================================================ */

:root[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --bg-tertiary: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-color: #3d3d3d;
    --accent-color: #3498db;
    --accent-light: #5dade2;
}

:root[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f0f1f2;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #e0e6ed;
    --accent-color: #3498db;
    --accent-light: #5dade2;
}

/* ============================================================================
   Animation & Transition
   ============================================================================ */

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.warroom-card {
    animation: slideInRight 0.3s ease;
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

.warroom-no-scroll {
    overflow: hidden;
}

.warroom-hidden {
    display: none !important;
}
