/* Main Styles for Subcontractor Management System */

/* Custom Variables */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

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

.page {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Dashboard Styles */
.card {
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border: none;
}

.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    background-color: #fff;
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
    font-weight: 600;
}

.card-header h5 {
    margin-bottom: 0;
}

.card .display-4 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Timeline Styles */
#timeline {
    position: relative;
    padding: 20px 0;
}

/* Activity and Timeline Container Styles */
#recent-activity-container, #timeline-container {
    max-height: 400px;
    overflow-y: auto;
}

/* Contracts Page Styles */
#contracts-page .container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

#contracts-page .card {
    margin-bottom: 1rem;
}

#contracts-page .table-responsive {
    max-width: 100%;
    overflow-x: auto;
}

#contracts-page .workflow-diagram {
    max-width: 100%;
    overflow-x: auto;
}

#contracts-page .workflow-steps {
    min-width: 800px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Responsive adjustments for contracts page */
@media (max-width: 1200px) {
    #contracts-page .workflow-steps {
        min-width: 600px;
    }
}

@media (max-width: 768px) {
    #contracts-page .container-fluid {
        padding: 0 10px;
    }
    
    #contracts-page .workflow-steps {
        min-width: 400px;
    }
}

/* E-Bidding Page Styles */
#ebidding-page .container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* E-Bidding Workflow Section Styles */
#ebidding-workflow-section {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#ebidding-workflow-section .card {
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

#ebidding-workflow-section .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem;
}

#ebidding-workflow-section .card-body {
    padding: 1rem;
}

#ebidding-page .card {
    margin-bottom: 1rem;
}

#ebidding-page .table-responsive {
    max-width: 100%;
    overflow-x: auto;
}

#ebidding-page .nav-tabs {
    border-bottom: 1px solid #dee2e6;
}

#ebidding-page .tab-content {
    padding: 20px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
}

/* Responsive adjustments for e-bidding page */
@media (max-width: 1200px) {
    #ebidding-page .container-fluid {
        max-width: 1200px;
    }
}

@media (max-width: 768px) {
    #ebidding-page .container-fluid {
        padding: 0 10px;
    }
    
    #ebidding-page .tab-content {
        padding: 15px;
    }
    
    #ebidding-page .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    #ebidding-page .btn-group .btn {
        margin-bottom: 5px;
    }
}

.activity-item {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s;
}

.activity-item:hover {
    background-color: #f8f9fa;
    cursor: pointer;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.activity-icon i {
    color: white;
    font-size: 14px;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}

.activity-description {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 6px;
}

.activity-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #6c757d;
}

.activity-user, .activity-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

.timeline-day {
    margin-bottom: 20px;
}

.timeline-date {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    padding: 4px 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    display: inline-block;
}

.timeline-items {
    padding-left: 16px;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    padding: 8px 0;
    border-left: 2px solid #e9ecef;
    padding-left: 12px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #6c757d;
}

.activity-empty, .timeline-empty {
    text-align: center;
    color: #6c757d;
    padding: 20px;
    font-style: italic;
}

/* Risk Heatmap Styles */
.risk-heatmap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    padding: 10px;
}

.risk-heatmap-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.risk-heatmap-cell:hover {
    transform: scale(1.05);
}

.timeline-item {
    position: relative;
    padding-left: 40px;
    margin-bottom: 20px;
}

.timeline-marker {
    position: absolute;
    top: 0;
    left: 0;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 2px solid #fff;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 7px;
    height: 100%;
    width: 2px;
    background-color: #e9ecef;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-content {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.timeline-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

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

.table th {
    font-weight: 600;
    color: #495057;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

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

/* Risk Gauge Styles */
.risk-gauge {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(
        #dc3545 0% 33%, 
        #ffc107 33% 66%, 
        #198754 66% 100%
    );
    margin: 0 auto;
}

.risk-gauge::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border-radius: 50%;
    background: white;
}

.risk-score {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-60%);
    text-align: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: #333;
}

.risk-label {
    position: absolute;
    bottom: 35%;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

/* Button Styles */
.btn {
    border-radius: 5px;
    font-weight: 500;
}

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

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* Form Styles */
.form-control, .form-select {
    border-radius: 5px;
    border: 1px solid #ced4da;
    padding: 0.5rem 0.75rem;
}

.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* AI Features Styles */
.tab-content {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    padding: 20px;
}

.nav-tabs .nav-link {
    color: #495057;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

#copilot-suggestions, #multi-agent-results {
    max-height: 500px;
    overflow-y: auto;
}

/* Extracted Clauses Styles */
.extracted-clause {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    border-left: 4px solid var(--primary-color);
    background-color: #f8f9fa;
}

.extracted-clause h6 {
    margin-bottom: 5px;
    color: var(--primary-color);
    font-weight: 600;
}

.clause-content {
    font-size: 0.9rem;
    color: #495057;
}

.clause-type {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-top: 8px;
}

/* Compliance Status Badges */
.badge.compliant {
    background-color: var(--success-color);
}

.badge.non-compliant {
    background-color: var(--danger-color);
}

.badge.partially-compliant {
    background-color: var(--warning-color);
    color: #212529;
}

.badge.pending {
    background-color: var(--info-color);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .card .display-4 {
        font-size: 2rem;
    }
    
    .timeline-item {
        padding-left: 30px;
    }
    
    .timeline-marker {
        width: 12px;
        height: 12px;
    }
    
    .timeline-item::before {
        left: 6px;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
}

/* Contract Preview Styles */
#generated-contract-preview {
    font-family: 'Times New Roman', Times, serif;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    max-height: 500px;
    overflow-y: auto;
}

.contract-section {
    margin-bottom: 20px;
}

.contract-section h4 {
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 5px;
}

.contract-clause {
    margin-bottom: 15px;
}

.contract-clause h5 {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 5px;
}

/* Additional AI UI Elements */
.ai-suggestion {
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    background-color: #e9f5ff;
    border-left: 4px solid var(--primary-color);
}

.ai-suggestion-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.ai-suggestion-content {
    color: #495057;
}

.ai-suggestion-tag {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 8px;
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--primary-color);
    border-radius: 10px;
    margin-top: 5px;
    margin-right: 5px;
}

/* Agent Review Styles */
.agent-review {
    border-left: 4px solid;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 5px;
}

.agent-legal {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
}

.agent-technical {
    border-color: var(--info-color);
    background-color: rgba(13, 202, 240, 0.05);
}

.agent-commercial {
    border-color: var(--success-color);
    background-color: rgba(25, 135, 84, 0.05);
}

.agent-compliance {
    border-color: var(--warning-color);
    background-color: rgba(255, 193, 7, 0.05);
}

.agent-heading {
    font-weight: 600;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.agent-heading i {
    margin-right: 8px;
}

/* Rules Table */
#rules-table .rule-enabled {
    width: 70px;
    text-align: center;
}

.rule-actions {
    width: 120px;
    text-align: right;
}

/* Highlighted Rule Issues */
.highlighted-issue {
    background-color: rgba(255, 193, 7, 0.2);
    padding: 2px 4px;
    border-radius: 3px;
}

.severe-issue {
    background-color: rgba(220, 53, 69, 0.2);
    padding: 2px 4px;
    border-radius: 3px;
}

/* Tooltip Styling */
.tooltip-inner {
    max-width: 300px;
    padding: 10px;
    text-align: left;
} 