/* Custom styles for Bogoni Qual Lab */

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #059669;
    --info-color: #0891b2;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --bogoni-blue: #1e40af;
    --bogoni-light: #f8fafc;
    --bogoni-gray: #f1f5f9;
}

/* Text selection improvements */
.text-selection {
    font-family: 'Georgia', serif;
    line-height: 1.8;
    text-align: justify;
    color: #000000 !important;
    background-color: white;
}

/* Highlighted segments styling */
.highlighted-segment {
    display: inline;
    padding: 2px 4px;
    border-radius: 3px;
    margin: 1px 0;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.highlighted-segment:hover {
    opacity: 0.9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.highlighted-segment::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bs-dark);
    color: var(--bs-light);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

.highlighted-segment:hover::after {
    opacity: 1;
}

/* Code color indicators */
.color-indicator {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Sidebar styling */
.sidebar {
    background: var(--bs-gray-100);
    border-radius: 8px;
}

/* Segment items in sidebar */
.segment-item {
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    border-left: 4px solid;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.segment-item:hover {
    background: var(--bogoni-light);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Quote preview styling */
.quote-preview {
    font-style: italic;
    color: var(--bs-secondary);
    font-size: 0.9em;
    line-height: 1.4;
}

/* Code buttons */
.code-btn {
    border: 2px solid;
    font-weight: 500;
    transition: all 0.2s ease;
}

.code-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Cards styling */
.card {
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    background: white;
    border-radius: 12px;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.card-header {
    background: var(--bogoni-light);
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    border-radius: 12px 12px 0 0;
}

/* Progress bars for analysis */
.progress {
    background-color: var(--bs-gray-200);
    border-radius: 4px;
}

.progress-bar {
    background: linear-gradient(45deg, var(--primary-color), var(--info-color));
    transition: width 0.6s ease;
}

/* Badge improvements */
.badge {
    font-weight: 500;
    padding: 6px 10px;
}

/* Button group improvements */
.btn-group .btn {
    border: 1px solid var(--bs-border-color);
}

/* Modal improvements */
.modal-content {
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    border-radius: 12px;
    background: white;
}

.modal-header {
    border-bottom: 1px solid #e2e8f0;
    background: var(--bogoni-light);
    border-radius: 12px 12px 0 0;
}

/* Form improvements */
.form-control, .form-select {
    border: 1px solid var(--bs-border-color);
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(23, 162, 184, 0.25);
}

/* Table improvements */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background: var(--bs-gray-50);
    border-bottom: 2px solid var(--bs-border-color);
    font-weight: 600;
}

.table td {
    vertical-align: middle;
}

/* List group improvements */
.list-group-item {
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    background: white;
}

.list-group-item:hover {
    background: var(--bogoni-light);
    border-color: var(--primary-color);
}

/* Responsive improvements */
@media (max-width: 768px) {
    .text-selection {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .code-btn {
        margin-bottom: 8px;
        width: 100%;
    }
    
    .sidebar {
        margin-top: 20px;
    }
}

/* Light theme (default) adjustments */
body {
    background-color: var(--bogoni-light);
    color: #000000 !important; /* Force black text */
}

/* Ensure all text content is black */
.text-content, .document-text, .text-selection {
    color: #000000 !important;
}

/* Force black text in all main content areas */
.card-body, .card-text, p, div, span {
    color: #000000 !important;
}

/* Ensure imported document text is black */
#documentText, #document-text, .document-content {
    color: #000000 !important;
    background-color: white;
}

/* Override any theme text colors */
.container, .row, .col {
    color: #000000 !important;
}

.navbar-light .navbar-nav .nav-link {
    color: #475569;
    font-weight: 500;
}

.navbar-light .navbar-nav .nav-link:hover {
    color: var(--primary-color);
}

.navbar-brand {
    color: var(--bogoni-blue) !important;
    font-size: 1.5rem;
}

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

.btn-primary:hover {
    background-color: #1e3a8a;
    border-color: #1e3a8a;
}

.text-primary {
    color: var(--bogoni-blue) !important;
}

.bg-primary {
    background-color: var(--bogoni-blue) !important;
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--bs-primary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* Animation improvements */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

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

.border-start-thick {
    border-left: 4px solid !important;
}

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

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