/* Carbon14 Decay Engine - Custom Styles */

/* Health Indicators */
.health-indicator {
    height: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.health-green {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

.health-amber {
    background: linear-gradient(90deg, #ffc107 0%, #fd7e14 100%);
}

.health-red {
    background: linear-gradient(90deg, #dc3545 0%, #e83e8c 100%);
}

.health-score {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Entity Cards */
.card {
    transition: all 0.3s ease;
    border-left: 4px solid #dee2e6;
    margin-bottom: 1rem;
}

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

.card.business-goal {
    border-left-color: #007bff;
}

.card.project {
    border-left-color: #28a745;
}

.card.work-area {
    border-left-color: #ffc107;
}

.card.critical-path {
    border-left-color: #dc3545;
    border-left-width: 6px;
}

/* Dashboard Header */
.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    margin: 0;
    font-weight: 600;
}

.dashboard-header .lead {
    opacity: 0.9;
}

/* Summary Cards */
.summary-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    margin-bottom: 1rem;
}

.summary-card.healthy {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.summary-card.warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.summary-card.critical {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.summary-card .card-body {
    text-align: center;
    padding: 1.5rem;
}

.summary-card h3 {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
}

.summary-card p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
}

/* Timeline Control */
.timeline-control {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

#timeline-slider {
    cursor: pointer;
    width: 100%;
}

#timeline-slider::-webkit-slider-thumb {
    background: #007bff;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    width: 20px;
    height: 20px;
}

#timeline-slider::-moz-range-thumb {
    background: #007bff;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    width: 20px;
    height: 20px;
}

#current-timeline-date {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    display: inline-block;
    margin-top: 0.5rem;
}

/* Hierarchy Indentation */
.hierarchy-indent {
    margin-left: 2rem;
}

.hierarchy-indent-2 {
    margin-left: 4rem;
}

/* Status Badges */
.status-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

.lifecycle-badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.7rem;
}

/* Cascade Animation */
.cascade-highlight {
    animation: cascadePulse 2s ease-in-out;
}

@keyframes cascadePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0.3);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}

/* Entity Card Styling */
.entity-card {
    margin-bottom: 1rem;
}

.entity-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.entity-card .card-body {
    padding: 1rem;
}

.entity-card h2, .entity-card h3, .entity-card h4 {
    margin: 0;
    font-size: 1.25rem;
}

.entity-card .owner {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.entity-card .kpi-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.5rem 0;
}

.entity-card .kpi-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Decay Info */
.decay-info {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

/* Update Button */
.update-btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

/* Breadcrumbs */
.breadcrumb {
    background-color: transparent;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

/* Form Styling */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-range {
    margin: 0.5rem 0;
}

/* Modal Enhancements */
.modal .form-label {
    color: #000 !important;
}

.modal .kpi-slider-container {
    margin-bottom: 1rem;
}

.modal .kpi-value-display {
    min-width: 50px;
    text-align: center;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Organization Type Cards */
.organization-type-card {
    transition: all 0.3s ease;
    border: 2px solid #dee2e6;
}

.organization-type-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.organization-type-card.border-primary {
    border-color: #007bff !important;
    background-color: #f0f7ff;
}

/* Setup Wizard Progress */
.setup-progress {
    height: 25px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hierarchy-indent {
        margin-left: 1rem;
    }
    
    .hierarchy-indent-2 {
        margin-left: 2rem;
    }
    
    .summary-card h3 {
        font-size: 1.5rem;
    }
    
    .entity-card .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Utility Classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   Dashboard V2 Styles - Modern UI Update
   ======================================== */

:root {
    --c14-bg: #f8f9fa;
    --c14-card-bg: #ffffff;
    --c14-primary: #4f46e5; /* Indigo-600 */
    --c14-primary-soft: #e0e7ff;
    --c14-text-main: #1e293b;
    --c14-text-muted: #64748b;
    
    /* Health Colors */
    --health-good: #10b981;
    --health-warn: #f59e0b;
    --health-crit: #ef4444;
}

/* Stat Cards (Dashboard Overview Summary) */
.stat-card {
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 0.75rem;
    background: var(--c14-card-bg);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Goal Cards (Dashboard Overview) */
.goal-card {
    border: 1px solid #f1f5f9;
    border-radius: 1rem;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.goal-card:hover {
    border-color: var(--c14-primary-soft);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Vertical Project Cards (Goal Details View) */
.project-card-vertical {
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: white;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.project-header {
    background: #fff;
    padding: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

/* Work Area List Section */
.work-area-list {
    background: #f8fafc;
    padding: 1rem;
}

/* Work Area Rows (Compact) */
.work-area-row {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.work-area-row:hover {
    border-color: var(--c14-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transform: translateX(4px);
}

/* Health Badge (Color-coded circles) */
.health-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35em 0.65em;
    font-size: 0.85em;
    font-weight: 700;
    border-radius: 6px;
}

.bg-health-good { 
    background-color: #ecfdf5; 
    color: var(--health-good); 
    border: 1px solid #a7f3d0; 
}

.bg-health-warn { 
    background-color: #fffbeb; 
    color: var(--health-warn); 
    border: 1px solid #fde68a; 
}

.bg-health-crit { 
    background-color: #fef2f2; 
    color: var(--health-crit); 
    border: 1px solid #fecaca; 
}

/* Offcanvas Flyout (Replaces Modal) */
.offcanvas-end {
    width: 500px;
    border-left: none;
    box-shadow: -10px 0 30px rgba(0,0,0,0.05);
}

@media (max-width: 768px) {
    .offcanvas-end { 
        width: 100%; 
    }
}

/* Text Label (Small caps labels) */
.text-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--c14-text-muted);
    font-weight: 600;
}

/* KPI Pills (Small badges in work area rows) */
.kpi-pill {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: #f1f5f9;
    border-radius: 4px;
    color: #64748b;
    font-weight: 600;
    margin-right: 4px;
}

/* Responsive adjustments for Dashboard V2 */
@media (max-width: 992px) {
    .project-header {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .work-area-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

@media (max-width: 576px) {
    .goal-card {
        padding: 1rem !important;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
    }
}

/* View Animation (Smooth page transitions) */
.view-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

