/*
 * Codeliance - Main CSS
 * Common styles for the DSA Compliance Testing application
 */

/* =============================================================================
   LAYOUT & NAVIGATION
   ============================================================================= */

.sidebar {
    min-height: 100vh;
    background-color: #f8f9fa;
}

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

/* Fix dropdown menu positioning and styling */
.dropdown-menu {
    border: 1px solid rgba(0,0,0,.125);
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
    min-width: 200px;
}

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

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

/* Ensure proper z-index for dropdown */
.navbar .dropdown-menu {
    z-index: 1050;
}

/* =============================================================================
   CARDS & COMPONENTS
   ============================================================================= */

.card-stats {
    border-left: 4px solid #007bff;
}

.status-badge {
    font-size: 0.8em;
}

/* CTA Button Shadow */
.cta-shadow {
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

/* Custom button color for third CTA */
.btn-custom-purple {
    background-color: #6f42c1;
    border-color: #6f42c1;
    color: #fff;
}

.btn-custom-purple:hover {
    background-color: #5a32a3;
    border-color: #4e2a8e;
    color: #fff;
}

/* =============================================================================
   SEARCH FUNCTIONALITY
   ============================================================================= */

/* Search snippets */
.search-snippet {
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Clean yellow highlighting for search terms */
mark {
    background-color: #fff3cd;
    color: #856404;
    padding: 0.15em 0.4em;
    border-radius: 1rem;
    border: 1px solid #ffeaa7;
    font-weight: 500;
}

/* Search result cards */
.search-result-card {
    transition: box-shadow 0.15s ease-in-out;
}

.search-result-card:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.match-location-badges {
    flex-shrink: 0;
}

/* Snippet containers */
.snippet-container {
    border-left: 3px solid #ffc107;
    transition: border-color 0.2s ease;
}

.snippet-container:hover {
    border-left-color: #ff9500;
}

/* Link hover effects */
.hover-primary {
    text-decoration: underline !important;
}
.hover-primary:hover {
    color: var(--bs-primary) !important;
}

/* =============================================================================
   Regulation Article Detail
   ============================================================================= */

/* Fix scroll position for fragment links with sticky navbar */
[id^="paragraph-"] {
    scroll-margin-top: 70px; /* 56px navbar + 14px extra spacing for visibility */
}

.regulation-article-detail .article-content {
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Ensure scenario cards take full width of their container */
.regulation-article-detail .scenario-item {
    width: 100%;
}

.regulation-article-detail .scenario-details .card {
    width: 100%;
}

.regulation-article-detail .card-header h5 {
    font-size: 1.1rem;
}

.regulation-article-detail .paragraph-text {
    font-size: 0.95rem;
    line-height: 1.6;
}

.regulation-article-detail .paragraph-row {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1rem;
    margin-bottom: 2rem !important;
}

.regulation-article-detail .paragraph-row:last-child {
    border-bottom: none;
}

.regulation-article-detail .collapsing {
    transition: height 0.35s ease;
}

.regulation-article-detail .related-evaluation-cases-section summary {
    list-style: none;
    -webkit-appearance: none;
}

.regulation-article-detail .related-evaluation-cases-section summary::-webkit-details-marker {
    display: none;
}

.regulation-article-detail .related-evaluation-cases-section[open] .details-toggle-icon {
    transform: rotate(180deg);
}

.regulation-article-detail .details-toggle-icon {
    transition: transform 0.3s ease;
}

.regulation-article-detail .paragraph-group:last-child {
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.regulation-article-detail .border-primary {
    border-color: var(--bs-primary) !important;
    border-width: 2px !important;
}

@media (max-width: 991px) {
    .regulation-article-detail .paragraph-row .col-lg-6:first-child {
        margin-bottom: 1rem;
    }
}

/* =============================================================================
   Platform Wizard
   ============================================================================= */

.platform-wizard .step-indicator {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.platform-wizard .step-indicator.active {
    color: #0d6efd;
}

.platform-wizard .step-indicator.completed {
    color: #198754;
}

.platform-wizard .progress {
    height: 8px;
}

/* =============================================================================
   Platform Regulations
   ============================================================================= */

.platform-regulations .regulation-list .form-check-input {
    margin-top: 0.5rem;
}

.platform-regulations .regulation-list .form-check-label {
    width: 100%;
    cursor: pointer;
}

.platform-regulations .regulation-list .card {
    transition: all 0.2s ease;
}

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

.platform-regulations .regulation-list .form-check-input:checked + .form-check-label .card {
    border-color: #0d6efd;
    background-color: #f8f9ff;
}

/* =============================================================================
   COMPLIANCE DASHBOARD
   ============================================================================= */

/* Compliance disclaimer banner */
.compliance-disclaimer {
    background-color: #fff3cd;
    border-left: 4px solid #d97706;
    padding: 16px;
    margin-bottom: 24px;
    border-radius: 4px;
}

.compliance-disclaimer p {
    margin: 0;
    color: #92400e;
    font-size: 0.9rem;
}

/* Status indicators for obligations - DEPRECATED: Now using Bootstrap Icons instead */
/* Keeping for backward compatibility with other pages that might still use these classes */
.status-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    margin-right: 8px;
    font-size: 0.85rem;
}

.status-evidence {
    background-color: #0db137;
    color: white;
}

.status-no-evidence {
    background-color: #4589bd;
    color: white;
}

.status-gap {
    background-color: #db3e09;
    color: white;
}

/* Four-segment progress bar for obligation evidence */
.evidence-progress {
    display: flex;
    height: 20px;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f3f4f6;
    margin-top: 8px;
}

.progress-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.progress-evidence {
    background-color: #0db137;
}

.progress-being-addressed {
    background-color: #0284c7; /* Darker blue - work in progress */
}

.progress-gap-acknowledged {
    background-color: #f59e0b; /* Amber/orange - acknowledged issue */
}

.progress-gap {
    background-color: #db3e09;
}

.progress-not-evaluated {
    background-color: #64748b; /* Slate gray with slight blue tint */
}

.progress-manual {
    background-color: #8b7a99; /* Gray with slight purple tint */
}

.progress-not-applicable {
    background-color: #9ca3af; /* Gray - not applicable */
}

/* Obligation cards for detail view - table-like layout */
.obligation-card {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.obligation-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Column widths for table-like structure */
.obligation-checkbox-col {
    width: 20px;
    flex-shrink: 0;
}

.obligation-status-col {
    width: 220px;
    flex-shrink: 0;
}

.obligation-description-col {
    flex: 1;
    min-width: 0; /* Allow text to wrap */
}

.obligation-scenarios-col {
    width: 200px;
    flex-shrink: 0;
    text-align: right;
}

/* Status pills - fixed width for consistency */
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.375rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    color: white;
}

.status-pill i {
    font-size: 0.75rem;
}

/* Scenario details dropdown */
.scenario-details {
    display: inline-block;
}

.scenario-details summary {
    list-style: none;
    display: inline;
}

.scenario-details summary::-webkit-details-marker {
    display: none;
}

.scenario-details[open] summary i {
    transform: rotate(90deg);
}

.scenario-details summary i {
    display: inline-block;
    transition: transform 0.2s ease;
}

.scenario-result-item {
    padding-left: 0.5rem;
    border-left: 2px solid #e5e7eb;
}

/* Filter count badges */
.filter-count {
    display: inline-block;
    min-width: 1.5rem;
    padding: 0.125rem 0.375rem;
    font-weight: 600;
    text-align: center;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    color: white;
}

/* Evidence status labels */
.status-label {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Sticky header for obligations section - combines title, actions, progress bar, and filters */
.obligations-sticky-header {
    position: sticky;
    top: 56px; /* Account for navbar height */
    z-index: 100; /* Below navbar (1050) but above content */
    background-color: #ffffff; /* White background for entire header */
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125); /* Match card border */
    margin: -1px -1.25rem 0 -1.25rem; /* Extend to card edges, overlap card border */
    border-top-left-radius: calc(0.375rem - 1px);
    border-top-right-radius: calc(0.375rem - 1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); /* Subtle shadow when sticky */
}

/* Status icons using Bootstrap Icons - replaces old text-based indicators */
.status-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.status-icon-evidence,
.status-icon-evidence {
    color: #0db137;
}

.status-icon-being-addressed {
    color: #0284c7; /* Darker blue - work in progress */
}

.status-icon-gap-acknowledged {
    color: #f59e0b; /* Amber - acknowledged issue */
}

.status-icon-possible-gap,
.status-icon-gap {
    color: #db3e09;
}

.status-icon-not-evaluated {
    color: #64748b; /* Slate gray with slight blue tint */
}

.status-icon-manual {
    color: #8b7a99; /* Gray with slight purple tint */
}

.status-icon-not-applicable {
    color: #9ca3af; /* Fully desaturated gray */
}

/* =============================================================================
   PRIORITY BADGES FOR OBLIGATIONS
   ============================================================================= */

.priority-badge {
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 0.35rem 0.65rem;
    border-radius: 0.25rem;
    flex-shrink: 0;
}

/* Priority 0 - Gray (Not prioritized or placeholder) */
.priority-0 {
    background-color: #6c757d;
    color: #ffffff;
}

/* Priority 1-25 - Light Blue (Low priority) */
.priority-low {
    background-color: #0dcaf0;
    color: #000000;
}

/* Priority 26-50 - Blue (Medium-low priority) */
.priority-medium-low {
    background-color: #0d6efd;
    color: #ffffff;
}

/* Priority 51-75 - Orange (Medium-high priority) */
.priority-medium-high {
    background-color: #fd7e14;
    color: #ffffff;
}

/* Priority 76-100 - Red (High priority) */
.priority-high {
    background-color: #dc3545;
    color: #ffffff;
}

/* Priority >100 - Dark Red (Critical priority) */
.priority-critical {
    background-color: #8b0000;
    color: #ffffff;
}

/* =============================================================================
   PRIORITY-BASED REMEDIATION DASHBOARD
   ============================================================================= */

/* Priority badge colors matching the existing progress color scheme */
.badge.bg-danger {
    background-color: #db3e09 !important; /* Critical priority - matches progress-gap */
}

.badge.bg-warning {
    background-color: #f59e0b !important; /* High priority - matches progress-gap-acknowledged */
}

.badge.bg-info {
    background-color: #0284c7 !important; /* Medium priority - matches progress-being-addressed */
}

.badge.bg-secondary {
    background-color: #64748b !important; /* Low priority - matches progress-not-evaluated */
}

.badge.bg-light {
    background-color: #9ca3af !important; /* Zero priority - matches progress-not-applicable */
    color: #374151 !important;
}

/* Summary cards with enhanced styling */
.card.border-danger {
    border-color: #db3e09 !important;
    border-width: 2px !important;
}

.card.border-warning {
    border-color: #f59e0b !important;
    border-width: 2px !important;
}

.card.border-info {
    border-color: #0284c7 !important;
    border-width: 2px !important;
}

.card.border-primary {
    border-color: #0d6efd !important;
    border-width: 2px !important;
}

/* Priority context alert boxes */
.alert-danger {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: #fed7aa;
    color: #92400e;
}

.alert-info {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* Priority group accordion styling */
.priority-group .accordion-button {
    font-weight: 500;
}

.priority-group .accordion-button:not(.collapsed) {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

/* Enhanced obligation cards in priority view */
.obligation-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.obligation-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

/* Priority badge in obligation cards */
.obligation-card .badge {
    font-size: 0.75rem;
    font-weight: 600;
}

/* External links in priority context */
.alert a {
    color: inherit;
    text-decoration: underline;
    font-weight: 500;
}

.alert a:hover {
    text-decoration: none;
}

/* Responsive summary cards */
@media (max-width: 768px) {
    .card.h-100 {
        margin-bottom: 1rem;
    }

    .card-body h2 {
        font-size: 1.5rem;
    }
}

/* Status filter styling for remediation dashboard */
.form-check-inline .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.filter-count {
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    margin-right: 0.25rem;
}

/* Accordion improvements for priority sections */
.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}
