/* SIVIA Enhanced - Compliance Workflow Styles */
/* Modern Clinical Interface with Professional Healthcare Design */

/* ===== COMPLIANCE WORKFLOW CONTAINER ===== */
.compliance-workflow {
    background: #fafbfc;
    min-height: 100vh;
    padding: 2rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== FILTER CONTROLS ===== */
.compliance-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 160px;
}

.filter-group.search-group {
    flex: 1;
    min-width: 200px;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.filter-select,
.filter-search {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    transition: all 0.2s ease;
    outline: none;
}

.filter-select:focus,
.filter-search:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn-filter-clear,
.btn-filter-apply {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.btn-filter-clear {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.btn-filter-clear:hover {
    background: #e5e7eb;
    color: #374151;
}

.btn-filter-apply {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.btn-filter-apply:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* ===== ISSUES CONTAINER ===== */
.issues-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    width: 1170px !important;
    max-width: 1170px !important;
    min-width: 1170px !important;
    min-height: 800px !important;
    margin: 0 auto !important;
}

.issues-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.issues-count {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.view-controls {
    display: flex;
    gap: 0.5rem;
}

.view-toggle {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-toggle.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.view-toggle:hover:not(.active) {
    background: #f3f4f6;
}

/* ===== ISSUES GRID ===== */
.issues-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1rem !important;
    padding: 1rem !important;
    width: 100% !important;
    max-width: none !important;
}


/* ===== ISSUE CARDS ===== */
.issue-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    word-wrap: break-word;
    max-width: 100%;
}

.issue-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #3b82f6;
}

.issue-card.overdue {
    border-left: 4px solid #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
}

.issue-card.overdue::before {
    content: 'OVERDUE';
    position: absolute;
    top: 0;
    right: 0;
    background: #dc2626;
    color: white;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-bottom-left-radius: 8px;
}

/* ===== CARD HEADER ===== */
.issue-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.25rem;
    min-height: 1.25rem;
}

.issue-meta {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.issue-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.625rem;
    font-weight: 600;
    color: #3b82f6;
    background: #eff6ff;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.issue-category {
    font-size: 0.5rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

.issue-badges {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.priority-badge,
.status-badge {
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    font-size: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.125rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.priority-critical { background: #dc2626; }
.priority-high { background: #ea580c; }
.priority-medium { background: #d97706; }
.priority-low { background: #65a30d; }

/* ===== CARD CONTENT ===== */
.issue-card-content {
    margin-bottom: 0.5rem;
}

.issue-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.25rem;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.issue-description {
    color: #6b7280;
    font-size: 0.625rem;
    line-height: 1.3;
    margin-bottom: 0.375rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.issue-details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.625rem;
    color: #4b5563;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.detail-item i {
    width: 10px;
    color: #6b7280;
    font-size: 0.5rem;
    flex-shrink: 0;
}

.detail-item span {
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 0;
}

/* ===== WORKFLOW PROGRESS ===== */
.workflow-progress {
    margin-bottom: 0.25rem;
}

.workflow-stage {
    font-size: 0.625rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.workflow-progress-bar {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    justify-content: space-between;
    overflow-x: auto;
    padding: 0.125rem 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 63px;
    position: relative;
}

.step-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e5e7eb;
    border: 1px solid #d1d5db;
    transition: all 0.3s ease;
}

.progress-step.completed .step-indicator {
    background: #10b981;
    border-color: #10b981;
}

.progress-step.current .step-indicator {
    background: #3b82f6;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.step-label {
    font-size: 0.625rem;
    color: #6b7280;
    margin-top: 0.25rem;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.progress-step.completed .step-label,
.progress-step.current .step-label {
    color: #374151;
    font-weight: 600;
}

/* Connect steps with lines */
.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 6px;
    right: -25px;
    width: 20px;
    height: 2px;
    background: #e5e7eb;
    z-index: -1;
}

.progress-step.completed:not(:last-child)::after {
    background: #10b981;
}

/* ===== CARD FOOTER ===== */
.issue-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.due-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.due-date.urgent {
    color: #f59e0b;
}

.due-date.overdue {
    color: #dc2626;
    font-weight: 700;
}

/* ===== QUICK ACTIONS ===== */
.issue-quick-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.quick-actions-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quick-action-btn {
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.quick-action-btn:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    transform: translateY(-1px);
}

/* ===== BULK ACTIONS BAR ===== */
.bulk-actions-bar {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-top: 1px solid #bfdbfe;
    border-bottom: 1px solid #e2e8f0;
}

.bulk-info {
    font-size: 0.875rem;
    color: #1e40af;
    font-weight: 600;
}

.bulk-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.bulk-action-select {
    padding: 0.5rem;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    background: white;
    font-size: 0.875rem;
}

.btn-bulk-apply,
.btn-bulk-cancel {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-bulk-apply {
    background: #3b82f6;
    color: white;
}

.btn-bulk-apply:hover {
    background: #1d4ed8;
}

.btn-bulk-cancel {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.btn-bulk-cancel:hover {
    background: #e5e7eb;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.empty-icon {
    font-size: 4rem;
    color: #10b981;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* ===== ASSIGNMENT MODAL ===== */
.assignment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.assignment-modal .modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    min-width: 400px;
    max-width: 500px;
    width: 90vw;
}

.assignment-modal h3 {
    margin-bottom: 1.5rem;
    color: #111827;
    font-size: 1.25rem;
    font-weight: 700;
}

.assignment-modal select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.modal-actions button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.modal-actions button:first-child {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.modal-actions button:last-child {
    background: #3b82f6;
    color: white;
}

/* ===== NOTIFICATIONS ===== */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: #10b981;
}

.notification-error {
    background: #dc2626;
}

.notification-info {
    background: #3b82f6;
}



/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .issues-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .compliance-filters {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-group {
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .compliance-workflow {
        padding: 1rem;
    }
    
    .issues-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    .issue-card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .issue-badges {
        align-self: stretch;
    }
    
    .issue-card-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .workflow-progress-bar {
        flex-wrap: wrap;
    }
    
    .quick-actions-menu {
        justify-content: center;
    }
    
    .issues-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .bulk-actions-bar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .issue-card {
        padding: 1rem;
    }
    
    .compliance-filters {
        padding: 1rem;
    }
    
    .filter-actions {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .btn-filter-clear,
    .btn-filter-apply {
        flex: 1;
        padding: 0.75rem;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.issue-card:focus,
.quick-action-btn:focus,
.filter-select:focus,
.filter-search:focus,
.btn-filter-apply:focus,
.btn-filter-clear:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .issue-card {
        border-width: 2px;
    }
    
    .priority-badge,
    .status-badge {
        border: 1px solid currentColor;
    }
}



/* ===== COMPACT PROFESSIONAL MODAL ===== */
.compact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: modalFadeIn 0.3s ease-out;
}

.compact-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-width: 600px;
    width: 90vw;
    max-height: 85vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

.compact-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.5rem 2rem 1rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.header-content {
    flex: 1;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    color: white;
    line-height: 1.3;
}

.header-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #374151;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: 1rem;
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modal-close-btn:hover {
    background: #ffffff;
    border-color: rgba(255, 255, 255, 0.8);
    color: #ef4444;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.modal-close-btn:active {
    transform: scale(0.95);
}

.compact-modal-body {
    padding: 1.5rem 2rem 2rem 2rem;
    max-height: calc(85vh - 120px);
    overflow-y: auto;
}

.issue-summary {
    margin-bottom: 1.5rem;
}

.description-text {
    color: #4b5563;
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
    word-break: break-word;
}

.score-value {
    color: #059669;
    font-weight: 700;
}

.risk-value {
    color: #dc2626;
    font-weight: 700;
}

.workflow-section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.action-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    color: #374151;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

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

.action-btn.btn-assigned {
    border-color: #3b82f6;
    color: #3b82f6;
}

.action-btn.btn-assigned:hover {
    background: #3b82f6;
    color: white;
}

.action-btn.btn-progress {
    border-color: #f59e0b;
    color: #f59e0b;
}

.action-btn.btn-progress:hover {
    background: #f59e0b;
    color: white;
}

.action-btn.btn-review {
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.action-btn.btn-review:hover {
    background: #8b5cf6;
    color: white;
}

.action-btn.btn-resolved {
    border-color: #10b981;
    color: #10b981;
}

.action-btn.btn-resolved:hover {
    background: #10b981;
    color: white;
}

.action-btn.btn-approved {
    border-color: #10b981;
    color: #10b981;
}

.action-btn.btn-approved:hover {
    background: #10b981;
    color: white;
}

.action-btn.btn-rejected {
    border-color: #ef4444;
    color: #ef4444;
}

.action-btn.btn-rejected:hover {
    background: #ef4444;
    color: white;
}

.action-btn.btn-revision {
    border-color: #f59e0b;
    color: #f59e0b;
}

.action-btn.btn-revision:hover {
    background: #f59e0b;
    color: white;
}

.action-btn.btn-closed {
    border-color: #6b7280;
    color: #6b7280;
}

.action-btn.btn-closed:hover {
    background: #6b7280;
    color: white;
}

.action-btn.loading {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
    transform: none;
}

.action-btn.loading i {
    animation: spin 1s linear infinite;
}

.action-btn.success {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.action-btn.error {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.action-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.recommendations-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.recommendations-list {
    margin: 0;
    padding-left: 1.25rem;
    color: #4b5563;
    line-height: 1.6;
}

.recommendations-list li {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 1rem 1.25rem;
    z-index: 1100;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    border-left: 4px solid #3b82f6;
    max-width: 400px;
}

.toast-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-notification.toast-success {
    border-left-color: #10b981;
}

.toast-notification.toast-error {
    border-left-color: #ef4444;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-content i {
    font-size: 1.125rem;
}

.toast-success .toast-content i {
    color: #10b981;
}

.toast-error .toast-content i {
    color: #ef4444;
}

.toast-info .toast-content i {
    color: #3b82f6;
}

.toast-content span {
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
}

/* ===== ANIMATIONS ===== */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

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

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .compact-content {
        width: 95vw;
        max-height: 90vh;
        margin: 1rem;
    }
    
    .compact-modal-header {
        padding: 1rem 1.5rem 0.75rem 1.5rem;
    }
    
    .compact-modal-body {
        padding: 1rem 1.5rem 1.5rem 1.5rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .action-buttons-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .modal-title {
        font-size: 1.125rem;
    }
    
    .toast-notification {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .toast-notification.show {
        transform: translateY(0);
    }
}



/* ===== COMMENTS FUNCTIONALITY STYLES ===== */

/* Comment indicator on issue cards */
.comment-indicator {
    position: relative;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
    transition: all 0.2s ease;
}

.comment-indicator:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.comment-indicator.has-comments {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.comment-indicator.has-comments:hover {
    background-color: #138496;
    border-color: #117a8b;
}

.comment-count {
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    margin-left: 4px;
    min-width: 18px;
    text-align: center;
    display: inline-block;
}

.comment-indicator.has-comments .comment-count {
    background-color: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Comments section in modal */
.comments-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 600px;
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.comments-header h4 {
    margin: 0;
    color: #1f2937;
    font-weight: 600;
}

.comment-filters {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.filter-btn.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* Comments list */
.comments-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    max-height: 400px;
}

.comment-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.2s ease;
}

.comment-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comment-header {
    margin-bottom: 0.75rem;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
}

.comment-meta {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
}

.comment-time {
    font-size: 0.75rem;
    color: #6b7280;
}

.comment-body {
    color: #374151;
    line-height: 1.6;
    font-size: 0.875rem;
}

/* No comments state */
.no-comments {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.no-comments i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #d1d5db;
}

.no-comments p {
    margin: 0;
    font-size: 0.875rem;
}

/* Error message */
.error-message {
    text-align: center;
    padding: 2rem 1rem;
    color: #dc2626;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
}

.error-message i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.error-message p {
    margin: 0;
    font-size: 0.875rem;
}

/* Comment composer */
.comment-composer {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
}

.composer-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.composer-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
}

.user-role {
    font-size: 0.75rem;
    color: #6b7280;
}

.comment-input {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 0.75rem;
    background: white;
}

.comment-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.comment-input::placeholder {
    color: #9ca3af;
}

.composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-attach,
.btn-mention {
    background: none;
    border: 1px solid #d1d5db;
    color: #6b7280;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-attach:hover,
.btn-mention:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

.btn-submit-comment {
    background-color: #3b82f6;
    border: 1px solid #3b82f6;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-submit-comment:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}

.btn-submit-comment:active {
    transform: translateY(1px);
}

/* Responsive design for comments */
@media (max-width: 768px) {
    .comments-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .comment-filters {
        width: 100%;
        justify-content: flex-start;
    }
    
    .composer-actions {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .composer-actions > div {
        display: flex;
        gap: 0.5rem;
    }
    
    .btn-submit-comment {
        width: 100%;
        justify-content: center;
    }
}

/* Animation for comment loading */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-item {
    animation: fadeInUp 0.3s ease-out;
}

/* Comment count badge animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.comment-count {
    animation: pulse 0.3s ease-out;
}

/* ===== END COMMENTS FUNCTIONALITY STYLES ===== */


/* Category Breakdown Modal Styles */
.clickable-categories {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 2px 4px;
}

.clickable-categories:hover {
    background-color: #e3f2fd;
    color: #1976d2;
    transform: scale(1.05);
}

.category-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.category-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

.category-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
}

.category-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
}

.category-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.category-modal-close:hover {
    background-color: #e0e0e0;
    color: #333;
}

.category-modal-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.category-title {
    flex: 1;
    font-weight: 500;
    color: #333;
    margin-right: 15px;
}

.category-count {
    font-weight: 600;
    color: #1976d2;
    background-color: #e3f2fd;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.9rem;
}

.category-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    text-align: right;
    background-color: #f8f9fa;
}

.category-modal-button {
    background-color: #1976d2;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.category-modal-button:hover {
    background-color: #1565c0;
}

.no-categories {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

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

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .category-modal {
        width: 95%;
        margin: 10px;
    }
    
    .category-modal-header h3 {
        font-size: 1.1rem;
    }
    
    .category-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .category-count {
        align-self: flex-end;
    }
}


/* ===== DOCUMENT LIBRARY STATUS BADGES ===== */
/* Fix for Document Library status color coding to match Dashboard */

.status-analyzed {
    background-color: #10b981 !important; /* Solid green for analyzed documents */
    color: white !important;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-uploaded {
    background-color: #6b7280 !important; /* Grey for uploaded documents (same as pending) */
    color: white !important;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-analyzing {
    background-color: #f59e0b !important; /* Solid yellow/orange for analyzing documents */
    color: white !important;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-error {
    background-color: #dc2626 !important; /* Solid dark red for error status */
    color: white !important;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

/* Also add the generic status classes used by Dashboard for consistency */
.status-badge.compliant {
    background-color: #10b981 !important; /* Solid Green */
    color: white !important;
}

.status-badge.warning {
    background-color: #f59e0b !important; /* Solid Yellow/Orange */
    color: white !important;
}

.status-badge.non-compliant {
    background-color: #ef4444 !important; /* Solid Red */
    color: white !important;
}

.status-badge.disabled {
    background-color: #6b7280 !important; /* Solid Gray */
    color: white !important;
}


/* Critical risk level - solid maroon color */
.status-badge.critical {
    background-color: #800000 !important; /* Solid Maroon for critical risk level */
    color: white !important;
}

/* ===== TAB CONTENT DISPLAY RULES ===== */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block !important;
}

/* Specific rule for edit tab */
#editTab {
    display: none;
}

#editTab.active {
    display: block !important;
}

