/* Swing Trade Manager - Custom Styles */

/* Base overrides */
body {
    background-color: #f8f9fa;
}

/* Navigation enhancements */
.navbar-brand {
    font-weight: 600;
}

.nav-link.active {
    font-weight: 500;
}

/* Card improvements */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: none;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

/* Summary cards on dashboard */
.summary-card {
    transition: transform 0.15s ease-in-out;
}

.summary-card:hover {
    transform: translateY(-2px);
}

.summary-card .card-title {
    font-size: 0.85rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.summary-card .card-value {
    font-size: 1.5rem;
    font-weight: 600;
}

.summary-card .card-value.positive {
    color: #198754;
}

.summary-card .card-value.negative {
    color: #dc3545;
}

/* Portfolio treemap */
.treemap-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 200px;
    padding: 4px;
    background-color: #e9ecef;
    border-radius: 0.375rem;
}

.treemap-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 0.25rem;
    color: #fff;
    text-align: center;
    min-width: 80px;
    transition: transform 0.1s ease;
    cursor: pointer;
}

.treemap-item:hover {
    transform: scale(1.02);
    z-index: 1;
}

.treemap-item .symbol {
    font-weight: 700;
    font-size: 1rem;
}

.treemap-item .pnl {
    font-size: 0.75rem;
    opacity: 0.9;
}

.treemap-item .value {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* Table enhancements */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Signal indicators */
.signal-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.rule-passed {
    color: #198754;
}

.rule-failed {
    color: #dc3545;
}

/* Rules badge in watchlist table */
.rules-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.rules-badge:hover {
    background-color: #e9ecef;
}

/* Rules popover styling */
.rules-popover {
    min-width: 200px;
    font-size: 0.8125rem;
}

.rules-popover .rules-section {
    margin-bottom: 0.5rem;
}

.rules-popover .rules-section:last-child {
    margin-bottom: 0;
}

.rules-popover .rule-item {
    display: flex;
    align-items: center;
    padding: 0.25rem 0;
    white-space: nowrap;
}

.rules-popover .rule-passed {
    color: #198754;
}

.rules-popover .rule-failed {
    color: #dc3545;
}

/* Form enhancements */
.form-label {
    font-weight: 500;
    color: #495057;
}

.form-text {
    font-size: 0.8rem;
}

/* Loading states */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

/* Empty states */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Stats grid for journal */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background-color: #fff;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
}

.stat-item .stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.stat-item .stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
}

/* Position indicator */
.position-indicator {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.position-indicator .filled {
    height: 100%;
    background-color: #0d6efd;
    transition: width 0.3s ease;
}

/* Quick actions */
.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Modal adjustments */
.modal-header {
    border-bottom: 1px solid #dee2e6;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .summary-card .card-value {
        font-size: 1.25rem;
    }

    .treemap-item {
        min-width: 60px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .toast-container {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}
