/* Enhanced Stacked Engagement Chart Styles with Dynamic Profile Filtering */
#dtc-stacked-engagement-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin-bottom: 30px;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#dtc-stacked-chart-title {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

/* Main filters container */
.dtc-filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    justify-content: center;
}

.dtc-time-selector {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    min-width: 250px;
}

.dtc-time-selector h4 {
    margin: 0 15px 0 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.dtc-time-selector select {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ced4da;
    background: #ffffff;
    font-size: 14px;
    min-width: 150px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    flex: 1;
}

.dtc-time-selector select:hover {
    border-color: #adb5bd;
}

.dtc-time-selector select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.25);
}

/* Dynamic profile filters (separate row) */
.dtc-stacked-profile-filters {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.dtc-profile-filter-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    min-width: 200px;
}

.dtc-profile-filter-group h4 {
    margin: 0 10px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.dtc-stacked-profile-filter {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ced4da;
    background-color: #ffffff;
    font-size: 14px;
    min-width: 150px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    flex: 1;
}

.dtc-stacked-profile-filter:hover {
    border-color: #adb5bd;
}

.dtc-stacked-profile-filter:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.25);
}

/* Profile filter label styling for options with italic text */
.dtc-stacked-profile-filter option[style*="italic"] {
    font-style: italic;
    color: #6c757d;
}

#dtc-chartdiv-stacked-engagement {
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    position: relative;
}

/* Loading spinner styles */
@keyframes dtc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dtc-loading-spinner-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    border-radius: 8px;
}

.dtc-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: dtc-spin 1s linear infinite;
}

/* Summary stats section (if needed) */
.dtc-summary-stats {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dtc-summary-stats h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.dtc-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.dtc-stat-item {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background-color: #fff;
    border-radius: 6px;
    border-left: 4px solid #008ffb;
}

.dtc-stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.dtc-stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dtc-filters-container {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .dtc-time-selector {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        padding: 10px;
    }
    
    .dtc-time-selector h4 {
        margin-bottom: 8px;
    }
    
    .dtc-time-selector select {
        width: 100%;
        margin: 0;
    }
    
    .dtc-stacked-profile-filters {
        flex-direction: column;
        align-items: center;
        padding: 10px;
    }
    
    .dtc-profile-filter-group {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .dtc-profile-filter-group h4 {
        margin-bottom: 5px;
    }
    
    .dtc-stacked-profile-filter {
        width: 100%;
        margin: 0;
    }
    
    .dtc-stat-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    #dtc-stacked-engagement-container {
        padding: 15px;
    }
    
    #dtc-stacked-chart-title {
        font-size: 18px;
    }
    
    .dtc-time-selector,
    .dtc-stacked-profile-filters {
        padding: 10px;
    }
}

/* Enhanced visual feedback for filters */
.dtc-time-selector select:focus,
.dtc-stacked-profile-filter:focus {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Subtle animations */
.dtc-time-selector select,
.dtc-stacked-profile-filter {
    transition: all 0.2s ease;
}

.dtc-time-selector select:hover,
.dtc-stacked-profile-filter:hover {
    transform: translateY(-1px);
}