/* Multi-Timeframe Dashboard - Professional Styles */

/* === Layout === */
.sidebar-mini {
    width: 80px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 0;
    height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar-mini .logo {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 3rem;
}

.sidebar-mini nav ul {
    list-style: none;
    width: 100%;
}

.sidebar-mini nav li {
    width: 100%;
    margin-bottom: 1rem;
}

.sidebar-mini nav li a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    text-decoration: none;
}

.sidebar-mini nav li a:hover,
.sidebar-mini nav li.active a {
    color: var(--accent-color);
    background: rgba(59, 130, 246, 0.1);
    border-left-color: var(--accent-color);
}

.mtf-main {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: var(--bg-color);
    max-width: 1800px;
    margin: 0 auto;
}

/* === Header === */
.mtf-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2.5rem;
    border-radius: 16px;
    color: white;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.mtf-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="white" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.1;
}

.mtf-header-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mtf-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mtf-header p {
    margin: 0;
    opacity: 0.95;
    font-size: 1.1rem;
}

.mtf-header-actions {
    display: flex;
    gap: 1rem;
}

.btn-export,
.btn-refresh {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-export:hover,
.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* === Stats Grid === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stat-card:hover::before {
    opacity: 0.05;
}

.glow-blue::before { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }
.glow-green::before { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.glow-purple::before { background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%); }
.glow-red::before { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.glow-orange::before { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.glow-teal::before { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); }

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    position: relative;
    z-index: 1;
}

.glow-blue .stat-icon { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: white; }
.glow-green .stat-icon { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; }
.glow-purple .stat-icon { background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%); color: white; }
.glow-red .stat-icon { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); color: white; }
.glow-orange .stat-icon { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }
.glow-teal .stat-icon { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); color: white; }

.stat-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* === Filter Section === */
.filter-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
}

.filter-group.inline {
    flex-direction: row;
    align-items: center;
}

.filter-group label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group select {
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* === Charts Container === */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.chart-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chart-legend {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.info-tooltip {
    color: var(--text-secondary);
    cursor: help;
    transition: color 0.3s ease;
}

.info-tooltip:hover {
    color: var(--accent-color);
}

.chart-body {
    position: relative;
    min-height: 300px;
}

.chart-body canvas {
    max-height: 400px;
}

/* === Tables === */
.table-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--sidebar-bg);
}

.table-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-collapse {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.btn-collapse:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

.table-body {
    padding: 1.5rem;
    max-height: 600px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

.table-body.collapsed {
    max-height: 0;
    padding: 0;
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.data-table th:hover {
    color: var(--accent-color);
}

.data-table th i {
    margin-left: 0.5rem;
    font-size: 0.75rem;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.data-table tbody tr {
    transition: all 0.3s ease;
}

.data-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.trades-table .trade-direction {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
}

.trade-long {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.trade-short {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.pnl-positive {
    color: var(--success-color);
    font-weight: 600;
}

.pnl-negative {
    color: var(--danger-color);
    font-weight: 600;
}

.btn-view {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.btn-view:hover {
    background: #2563eb;
    transform: scale(1.05);
}

/* === Modal === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--sidebar-bg);
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    color: var(--danger-color);
    transform: scale(1.2);
}

.modal-body {
    padding: 2rem;
}

.modal-detail {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.modal-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-detail-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.modal-detail-value {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* === Loading Overlay === */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-overlay p {
    margin-top: 1.5rem;
    font-size: 1.125rem;
    color: var(--text-primary);
}

/* === Animations === */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === Responsive Design === */
@media (max-width: 1400px) {
    .charts-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar-mini {
        width: 60px;
        padding: 1rem 0;
    }

    .sidebar-mini .logo {
        font-size: 1.5rem;
    }

    .mtf-main {
        padding: 1rem;
    }

    .mtf-header {
        padding: 1.5rem;
    }

    .mtf-header h1 {
        font-size: 1.75rem;
    }

    .mtf-header p {
        font-size: 0.95rem;
    }

    .mtf-header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .mtf-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filter-section {
        flex-direction: column;
        gap: 1rem;
    }

    .charts-container {
        grid-template-columns: 1fr;
    }

    .chart-card {
        min-width: 0;
    }

    .modal-detail {
        grid-template-columns: 1fr;
    }

    .data-table {
        font-size: 0.875rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .btn-export,
    .btn-refresh {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}

/* === Utility Classes === */
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.text-muted { color: var(--text-secondary); }
.font-bold { font-weight: 700; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
