/**
 * Custom CSS for Financial Data System
 * Enhances Bootstrap dark theme with financial-specific styling
 */

/* Loading animations */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--bs-primary);
    animation: spin 1s ease-in-out infinite;
}

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

/* Chart containers */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

.chart-container.small {
    height: 200px;
}

/* Status indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
}

.status-indicator .fa-circle {
    font-size: 12px;
}

/* Ticker summary hover effects */
.ticker-summary {
    transition: all 0.2s ease-in-out;
}

.ticker-summary:hover {
    background-color: var(--bs-info) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Price change indicators */
.price-positive {
    color: var(--bs-success) !important;
}

.price-negative {
    color: var(--bs-danger) !important;
}

.price-neutral {
    color: var(--bs-secondary) !important;
}

/* News sentiment badges */
.sentiment-positive {
    background-color: var(--bs-success) !important;
}

.sentiment-negative {
    background-color: var(--bs-danger) !important;
}

.sentiment-neutral {
    background-color: var(--bs-secondary) !important;
}

/* Card enhancements */
.card {
    transition: box-shadow 0.2s ease-in-out;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-bottom: 1px solid var(--bs-border-color);
}

/* Insight cards */
.insight-card {
    border-left: 4px solid var(--bs-primary);
    margin-bottom: 1rem;
}

.insight-card.buy {
    border-left-color: var(--bs-success);
}

.insight-card.sell {
    border-left-color: var(--bs-danger);
}

.insight-card.hold {
    border-left-color: var(--bs-info);
}

.insight-card.watch {
    border-left-color: var(--bs-warning);
}

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

.navbar-nav .nav-link {
    transition: color 0.2s ease-in-out;
}

.navbar-nav .nav-link:hover {
    color: var(--bs-primary) !important;
}

/* Button enhancements */
.btn {
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Modal enhancements */
.modal-content {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid var(--bs-border-color);
}

.modal-footer {
    border-top: 1px solid var(--bs-border-color);
}

/* Form enhancements */
.form-control, .form-select {
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Alert enhancements */
.alert {
    border-radius: 0.5rem;
    border: none;
}

.alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    color: var(--bs-info);
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--bs-success);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--bs-warning);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--bs-danger);
}

/* Table enhancements */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
}

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

/* Footer styling */
footer {
    margin-top: auto;
}

/* Responsive design helpers */
@media (max-width: 768px) {
    .chart-container {
        height: 300px;
    }
    
    .card-body {
        padding: 1rem 0.75rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}

/* Utility classes */
.text-truncate-2 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.border-radius-lg {
    border-radius: 0.75rem !important;
}

.shadow-sm-hover {
    transition: box-shadow 0.2s ease-in-out;
}

.shadow-sm-hover:hover {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

/* Loading states */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: inherit;
}

.loading-text {
    color: var(--bs-light);
    margin-left: 0.5rem;
}

/* Pulse animation for live updates */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bs-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bs-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bs-primary);
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .btn {
        display: none !important;
    }
}
