/* Custom styles for AI PQC Audit platform */

/* Intelligence Cards */
.intelligence-card {
    background: #212529;
    border-radius: 0.375rem;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.intelligence-header {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    font-size: 1.25rem;
    font-weight: 500;
}

.intelligence-header i {
    margin-right: 0.5rem;
    width: 20px;
    height: 20px;
}

.intelligence-header-red {
    background-color: #dc3545;
    color: white;
    border-bottom: 2px solid #dc3545;
}

.intelligence-header-purple {
    background-color: #6f42c1;
    color: white;
    border-bottom: 2px solid #6f42c1;
}

.intelligence-header-secondary {
    background-color: #6c757d;
    color: white;
    border-bottom: 2px solid #6c757d;
}

.intelligence-body {
    flex: 1;
    padding: 1rem;
    color: #adb5bd;
}

.intelligence-footer {
    padding: 0.75rem 1rem;
    background: #212529;
    color: #6c757d;
    border-top: 1px solid #495057;
}

.intelligence-footer-red {
    border-left: 3px solid #dc3545;
}

.intelligence-footer-secondary {
    border-left: 3px solid #6c757d;
}

.intelligence-placeholder {
    text-align: center;
    padding: 2rem 0;
    color: #6c757d;
}

.intelligence-placeholder i {
    margin-right: 0.5rem;
}

.intelligence-archive-link {
    text-align: center;
    margin-top: 1rem;
}

/* Score circle component */
.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: conic-gradient(#ef4444 0%, #374151 0%);
    padding: 8px;
}

.score-circle::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--bs-body-bg);
    z-index: 1;
}

.score-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--bs-body-color);
    z-index: 2;
    position: relative;
}

.score-max {
    font-size: 0.8rem;
    color: var(--bs-text-muted);
    z-index: 2;
    position: relative;
}

.quantum-score-display {
    padding: 1rem;
}

/* Scan card animations and interactions */
.scan-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.scan-card.border-success {
    border-color: var(--bs-success) !important;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

.scan-card.border-danger {
    border-color: var(--bs-danger) !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Progress indicators */
.progress {
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Remove backgrounds from AI analysis sections */
.bg-light {
    background-color: transparent !important;
}

.text-primary {
    color: inherit !important;
}

.text-dark {
    color: inherit !important;
}

/* Logo styling */
.navbar-brand img {
    max-height: 32px;
    width: auto;
}

.logo-small {
    height: 24px;
    width: auto;
}

.logo-medium {
    height: 80px;
    width: auto;
    max-width: 100%;
}

.logo-large {
    height: 120px;
    width: auto;
    max-width: 100%;
}

/* Enhanced logo styling for transparent logo */
.navbar-brand img,
img[alt="AI PQ Logo"] {
    object-fit: contain;
    max-width: 100%;
}

/* Navigation logo specific styling */
.navbar-brand {
    padding: 0.25rem 0;
    margin-right: 0;
}

.navbar-brand img {
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Navbar adjustments for smaller logo */
.navbar {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

/* Force smaller navigation logo */
.navbar-brand img {
    min-height: 120px !important;
    max-height: 120px !important;
}

/* Center navigation container */
.navbar .container {
    justify-content: center;
    align-items: center;
}

/* Navigation items styling */
.navbar-nav {
    margin-left: 2rem;
    gap: 0.5rem;
}

.navbar-nav .nav-item {
    margin: 0 0.25rem;
}

.navbar-nav .nav-link {
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
}

/* Logo hover effect */
.navbar-brand:hover img {
    transform: scale(1.05);
}

/* Responsive logo adjustments */
@media (max-width: 768px) {
    .navbar-brand img {
        min-height: 100px !important;
        max-height: 100px !important;
    }
    
    .navbar-brand {
        margin-right: 0;
    }
    
    .navbar .container {
        justify-content: space-between;
    }
    
    .navbar-nav {
        margin-left: 0;
        gap: 0.25rem;
    }
    
    .navbar-nav .nav-item {
        margin: 0 0.1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.9rem;
    }
    
    /* Homepage logo on mobile */
    .container .row .col-lg-8 img[alt="AI PQ Logo"] {
        height: 300px !important;
    }
    
    /* Header logos on mobile */
    .card-header img[alt="AI PQ Logo"] {
        height: 24px !important;
    }
}

@media (max-width: 576px) {
    .navbar-brand img {
        min-height: 80px !important;
        max-height: 80px !important;
    }
    
    .navbar-nav .nav-link {
        padding: 0.25rem 0.35rem;
        font-size: 0.85rem;
    }
    
    .navbar-nav .nav-item {
        margin: 0;
    }
    
    /* Even smaller screens */
    .container .row .col-lg-8 img[alt="AI PQ Logo"] {
        height: 220px !important;
    }
}

/* Alert customizations */
.alert-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* Policy Dashboard Styles */
.policy-dashboard {
    min-height: 100vh;
}

.dashboard-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.compliance-items {
    max-height: 400px;
    overflow-y: auto;
}

.compliance-items::-webkit-scrollbar {
    width: 6px;
}

.compliance-items::-webkit-scrollbar-track {
    background: var(--bs-gray-200);
    border-radius: 3px;
}

.compliance-items::-webkit-scrollbar-thumb {
    background: var(--bs-gray-400);
    border-radius: 3px;
}

.recommendation-item {
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.recommendation-item:hover {
    border-color: var(--bs-primary) !important;
    background-color: rgba(13, 110, 253, 0.05);
}

.recommendation-item[data-priority="critical"] {
    border-left: 4px solid var(--bs-danger);
}

.recommendation-item[data-priority="high"] {
    border-left: 4px solid var(--bs-warning);
}

.recommendation-item[data-priority="medium"] {
    border-left: 4px solid var(--bs-info);
}

.recommendation-item[data-priority="low"] {
    border-left: 4px solid var(--bs-success);
}

/* Chart containers */
.chart-container {
    position: relative;
    height: 250px;
    margin: 1rem 0;
}

.chart-container canvas {
    max-height: 100%;
}

/* Dashboard metrics */
.metric-card {
    background: linear-gradient(135deg, var(--bs-primary-bg-subtle), var(--bs-info-bg-subtle));
    border: none;
    color: var(--bs-body-color);
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.metric-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

/* Status badges */
.status-badge-success {
    background: linear-gradient(135deg, var(--bs-success), #0d8043);
    color: white;
}

.status-badge-secondary {
    background: linear-gradient(135deg, var(--bs-secondary), #6c757d);
    color: white;
}

.status-badge-danger {
    background: linear-gradient(135deg, var(--bs-danger), #a02834);
    color: white;
}

.status-badge-info {
    background: linear-gradient(135deg, var(--bs-info), #0a6fb0);
    color: white;
}

/* Loading states */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(var(--bs-body-bg-rgb), 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Removed loading spinner - replaced with progress bars */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Policy Dashboard specific overrides */
.policy-dashboard .card {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}

.policy-dashboard .card-body {
    background-color: transparent;
}

.policy-dashboard .form-select {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}

.policy-dashboard .form-label {
    color: var(--bs-body-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chart-container {
        height: 200px;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
    
    .recommendation-item {
        margin-bottom: 1rem;
    }
}

/* File upload styling */
.form-control[type="file"] {
    padding: 0.5rem;
}

.form-control[type="file"]:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Navigation enhancements */
.navbar-brand {
    font-size: 1.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

/* Card enhancements */
.card {
    border: 1px solid rgba(255, 255, 255, 0.125);
    backdrop-filter: blur(10px);
}

.card-header {
    background-color: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.125);
}

/* Tab styling */
.nav-tabs .nav-link {
    color: var(--bs-text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
}

.nav-tabs .nav-link:hover {
    color: var(--bs-primary);
    border-bottom-color: var(--bs-primary);
}

.nav-tabs .nav-link.active {
    color: var(--bs-primary);
    border-bottom-color: var(--bs-primary);
    background: none;
}

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

/* Badge improvements */
.badge {
    font-weight: 500;
    letter-spacing: 0.025em;
}

/* Button enhancements */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

/* Loading states */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Chart containers */
canvas {
    max-height: 200px;
}

/* Risk level indicators */
.text-success { color: #22c55e !important; }
.text-warning { color: #eab308 !important; }
.text-danger { color: #ef4444 !important; }
.text-info { color: #06b6d4 !important; }

.bg-success { background-color: #22c55e !important; }
.bg-warning { background-color: #eab308 !important; }
.bg-danger { background-color: #ef4444 !important; }
.bg-info { background-color: #06b6d4 !important; }

/* Override background colors for ALL individual analysis items across all audit areas */
.border.border-danger.rounded,
.border.border-warning.rounded,
.border.border-info.rounded,
.border.border-success.rounded {
    background-color: transparent !important;
}

/* Specifically target all analysis containers */
.tab-pane .border.border-danger,
.tab-pane .border.border-warning,
.tab-pane .border.border-info,
.tab-pane .border.border-success,
#criticalItemsList .border.border-danger,
#moderateItemsList .border.border-warning,
#lowRiskItemsList .border.border-info,
#compliantItemsList .border.border-success {
    background-color: transparent !important;
}

/* Additional coverage for all audit area individual items */
.card-body .border.border-danger,
.card-body .border.border-warning,
.card-body .border.border-info,
.card-body .border.border-success {
    background-color: transparent !important;
}

/* Footer styling */
footer {
    background-color: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    .text-muted {
        color: #6c757d !important;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .score-circle {
        width: 100px;
        height: 100px;
    }
    
    .score-value {
        font-size: 1.5rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Animation utilities */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Focus improvements for accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    outline: none;
}

/* Status indicators */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-pending { background-color: var(--bs-secondary); }
.status-processing { background-color: var(--bs-warning); }
.status-complete { background-color: var(--bs-success); }
.status-error { background-color: var(--bs-danger); }
