/* Custom styles for Stock Correlations app */

body {
    background-color: #f8f9fa;
}

.navbar-brand {
    font-weight: bold;
}

.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
}

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

.suggested-ticker {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.suggested-ticker:hover {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.table-responsive {
    max-height: 70vh;
    overflow: auto;
}

.correlation-table {
    font-size: 0.9rem;
    position: relative;
}

.correlation-table th,
.correlation-table td {
    text-align: center;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    position: relative;
}

.correlation-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Frozen header row */
.correlation-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

/* Frozen first column */
.correlation-table tbody th:first-child,
.correlation-table thead th:first-child {
    position: sticky;
    left: 0;
    z-index: 11;
    background-color: #f8f9fa;
    border-right: 2px solid #dee2e6;
}

/* Frozen corner cell (top-left) */
.correlation-table thead th:first-child {
    z-index: 12;
}

/* Simple watermark */
.correlation-table thead th:first-child::before {
    content: "stockcor.com";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.6rem;
    color: #000000;
    font-weight: 500;
    z-index: 16;
    pointer-events: none;
    opacity: 0.6;
}


/* Crosshair hover effect */
.correlation-table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.correlation-table tbody tr:hover td {
    background-color: rgba(0, 123, 255, 0.1);
}

/* Highlight header column on row hover */
.correlation-table tbody tr:hover th:first-child {
    background-color: #cce7ff !important;
    z-index: 13;
}

/* Ensure frozen cells remain opaque */
.correlation-table tbody th:first-child,
.correlation-table thead th:first-child {
    background-color: #f8f9fa !important;
}

.correlation-value {
    font-weight: 500;
}

.correlation-table .correlation-high {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    font-weight: 600;
}

.correlation-table .correlation-medium {
    background-color: #fff3cd !important;
    color: #856404 !important;
    font-weight: 500;
}

.correlation-table .correlation-low {
    background-color: #d4edda !important;
    color: #155724 !important;
    font-weight: 500;
}

.correlation-table .correlation-negative {
    background-color: #d4edda !important;
    color: #155724 !important;
    font-weight: 600;
}

.correlation-table .correlation-perfect {
    background-color: #e9ecef !important;
    color: #495057 !important;
    font-weight: 700;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #f5c6cb;
    margin: 1rem 0;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #c3e6cb;
    margin: 1rem 0;
}

@media (max-width: 768px) {
    .correlation-table {
        font-size: 0.8rem;
    }
    
    .correlation-table th,
    .correlation-table td {
        padding: 0.25rem;
    }
}
