/* ===== Action Items Tab Styles ===== */

/* Perspective Toggle */
.perspective-toggle {
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.perspective-toggle .btn-group .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.perspective-toggle .btn-group .btn i {
    flex-shrink: 0;
}

.perspective-description {
    font-style: italic;
    font-size: 0.9rem;
}

/* Enhanced Summary Cards */
.actions-summary {
    margin-bottom: 1.5rem;
}

.summary-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 0.5rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-left-width: 4px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    height: 100%;
}

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

.summary-card.overdue {
    border-left-color: #dc3545;
    background: linear-gradient(to right, rgba(220,53,69,0.05), #fff);
}

.summary-card.due-soon {
    border-left-color: #fd7e14;
    background: linear-gradient(to right, rgba(253,126,20,0.05), #fff);
}

.summary-card.pending {
    border-left-color: #0d6efd;
    background: linear-gradient(to right, rgba(13,110,253,0.05), #fff);
}

.summary-card.completed {
    border-left-color: #198754;
    background: linear-gradient(to right, rgba(25,135,84,0.05), #fff);
}

.summary-icon {
    font-size: 1.5rem;
    margin-right: 1rem;
    opacity: 0.7;
}

.summary-card.overdue .summary-icon { color: #dc3545; }
.summary-card.due-soon .summary-icon { color: #fd7e14; }
.summary-card.pending .summary-icon { color: #0d6efd; }
.summary-card.completed .summary-icon { color: #198754; }

.summary-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.summary-card.overdue .summary-value { color: #dc3545; }
.summary-card.due-soon .summary-value { color: #fd7e14; }
.summary-card.pending .summary-value { color: #0d6efd; }
.summary-card.completed .summary-value { color: #198754; }

.summary-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.summary-content {
    display: flex;
    flex-direction: column;
}

/* Filter Bar */
.actions-filters {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.actions-filters .btn.active {
    font-weight: 600;
}

.sort-control select {
    min-width: 180px;
}

/* Action Item Cards */
.action-item-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

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

.action-item-card.filtered-out {
    display: none !important;
}

.action-item-card.border-danger {
    border-left: 4px solid #dc3545;
}

.action-item-card.border-warning {
    border-left: 4px solid #ffc107;
}

.action-item-card.border-info {
    border-left: 4px solid #17a2b8;
}

.action-item-card.border-secondary {
    border-left: 4px solid #6c757d;
}

.action-item-card.overdue {
    border-left-color: #dc3545;
    background-color: rgba(220,53,69,0.03);
}

.action-item-header {
    padding: 1rem 1rem 0.5rem;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
}

.action-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
}

/* Action Badges */
.action-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.action-badges .badge {
    font-size: 0.7rem;
    padding: 0.35rem 0.6rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.action-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.meta-item {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.action-item-body {
    padding: 1rem;
}

.action-description {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Action Note Box */
.action-note {
    background-color: #f0f9ff;
    border-left: 3px solid #0d6efd;
    padding: 0.75rem 1rem;
    border-radius: 0 0.25rem 0.25rem 0;
}

.note-header {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: #0d6efd;
}

.note-content {
    font-size: 0.9rem;
    color: #495057;
    line-height: 1.6;
}

.action-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f3f5;
    font-size: 0.95rem;
}

.action-detail:last-child {
    border-bottom: none;
}

.action-detail i {
    min-width: 20px;
    color: #6c757d;
}

.action-amount {
    font-size: 0.9rem;
    padding: 0.5rem 0;
}

/* Outcome Boxes */
.action-outcome {
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    margin-top: 0.75rem;
}

.outcome-negative {
    background-color: rgba(220,53,69,0.1);
    color: #842029;
    border-left: 3px solid #dc3545;
}

.outcome-positive {
    background-color: rgba(25,135,84,0.1);
    color: #0f5132;
    border-left: 3px solid #198754;
}

/* Legacy consequence style for backwards compatibility */
.action-consequence {
    margin-top: 1rem;
    border-left: 3px solid #ffc107;
}

/* Calculation and Trigger Info */
.action-calculation,
.action-trigger {
    font-size: 0.8rem;
    padding: 0.25rem 0;
}

.action-calculation {
    color: #6c757d;
}

.action-trigger {
    color: #0dcaf0;
}

.action-source {
    padding-top: 0.5rem;
    border-top: 1px solid #f1f3f5;
    margin-top: 0.5rem;
}

.action-item-footer {
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* Quick stats for actions */
.quick-stat.stat-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.quick-stat.stat-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
}

/* Severity badges */
.severity-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.severity-badge.severity-critical {
    background: #dc3545;
    color: white;
}

.severity-badge.severity-high {
    background: #ffc107;
    color: #212529;
}

.severity-badge.severity-medium {
    background: #17a2b8;
    color: white;
}

.severity-badge.severity-low {
    background: #6c757d;
    color: white;
}

/* Phase 2 action buttons */
.action-item-footer .btn-group {
    width: 100%;
}

.action-item-footer .btn {
    flex: 1;
    font-size: 0.875rem;
    padding: 0.375rem 0.5rem;
}

.action-item-footer .btn i {
    margin-right: 0.25rem;
}

/* Empty state */
.actions-empty-state {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .perspective-toggle {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .perspective-toggle .btn-group {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .perspective-description {
        margin-left: 0 !important;
        margin-top: 0.5rem;
    }
    
    .actions-filters {
        flex-direction: column !important;
        gap: 0.75rem;
    }
    
    .actions-filters .btn-group {
        width: 100%;
    }
    
    .actions-filters .btn {
        flex: 1;
    }
    
    .sort-control select {
        width: 100%;
        min-width: 100%;
    }
    
    .action-meta {
        flex-direction: column;
        gap: 0.5rem !important;
        font-size: 0.85rem;
    }
    
    .summary-card {
        flex-direction: column;
        text-align: center;
    }
    
    .summary-icon {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .action-item-footer .btn-group {
        flex-direction: column;
    }
    
    .action-item-footer .btn {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .action-item-footer .btn:last-child {
        margin-bottom: 0;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .summary-card {
        font-size: 0.9rem;
    }
    
    .summary-value {
        font-size: 1.5rem;
    }
}

/* Empty state */
.detail-card .card-body .bi-calendar-check {
    display: inline-block;
}

/* ===== Phase 2: Interactive Features Styles ===== */

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.action-buttons .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

.action-buttons .btn i {
    font-size: 0.9rem;
}

.action-buttons .btn-link {
    padding: 0.375rem 0.5rem;
}

/* Modal Enhancements */
.modal-header {
    background: linear-gradient(135deg, #06798C 0%, #0891A8 100%);
    color: white;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

/* Timeline (History Modal) */
.timeline {
    position: relative;
    padding-left: 0;
}

.timeline-item {
    position: relative;
    padding-left: 0;
}

.timeline-item:last-child {
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.timeline-item strong {
    color: #06798C;
    font-weight: 600;
}

.timeline-item .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Form Enhancements */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-label .text-danger {
    font-weight: bold;
}

.form-control:focus,
.form-select:focus {
    border-color: #06798C;
    box-shadow: 0 0 0 0.2rem rgba(6, 121, 140, 0.25);
}

textarea.form-control {
    resize: vertical;
}

/* Modal Form Layout */
.modal-body .row {
    margin-bottom: 0;
}

.modal-body .mb-3:last-child {
    margin-bottom: 0 !important;
}

/* Button States in Modals */
.modal-footer .btn-primary {
    background: #06798C;
    border-color: #06798C;
}

.modal-footer .btn-primary:hover {
    background: #055968;
    border-color: #055968;
}

.modal-footer .btn-success:hover {
    background: #157347;
    border-color: #146c43;
}

.modal-footer .btn-danger:hover {
    background: #bb2d3b;
    border-color: #b02a37;
}

/* Spinner Enhancement */
.spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.25rem;
}

/* Status Badge Variants */
.badge.bg-warning {
    color: #000;
}

.badge.bg-info {
    background-color: #0dcaf0 !important;
}

.badge.bg-primary {
    background-color: #06798C !important;
}

/* Responsive Adjustments for Modals */
@media (max-width: 768px) {
    .modal-lg {
        max-width: 95%;
        margin: 1rem auto;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 0.75rem 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-buttons .btn {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Loading States */
.text-center.py-3 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
}

/* Small Text in Forms */
small.text-muted {
    font-size: 0.85rem;
    display: block;
    margin-top: 0.25rem;
}

/* Highlight animation for scrolling to specific action */
.action-item-card.action-highlight {
    animation: highlightPulse 0.5s ease-in-out 3;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.5), 0 4px 15px rgba(0, 0, 0, 0.2);
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.5), 0 4px 15px rgba(0, 0, 0, 0.2);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(13, 110, 253, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
        transform: scale(1.01);
    }
    100% {
        box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.5), 0 4px 15px rgba(0, 0, 0, 0.2);
        transform: scale(1);
    }
}
